diff --git a/.gitignore b/.gitignore index e69de29b..bb1ec317 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,4 @@ + +src/Mooege/Mooege-VS2010.suo +src/Mooege-VS2010.sln +*.orig \ No newline at end of file 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..367d3f86 --- /dev/null +++ b/CREDITS @@ -0,0 +1,42 @@ +== 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 +* fasbat +* Farmy +* DarkLotus +* BoyC +* tehCm +* BackAndForward +* Shadow^Dancer +* dark0ne +* Egris +* dustinconrad +* mdz444 +* [TOM_RUS] +* Wetwlly +* Cubido +* angerwin +* xsochor +* thesinx +* HDANILO +* Swiftsmoke +* flippy +* PeteGet27 +* Tharuler +* farces +* fortenbt +* rafal +* sqoou +* Xpload +* YasRavenheart +* raptium +* DrakeFish +* Reelix +* sku + +If you have contributed to the project and you are not on this list, please contact +raistlinthewiz in order to have your name added. \ No newline at end of file diff --git a/Compatibility b/Compatibility new file mode 100644 index 00000000..d385c06e --- /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: Patch6 (7841) + +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..f6ace280 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,28 @@ # 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). +* Status: Will get you ingame.. not much else. +* 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) + +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., 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/account.db b/assets/account.db new file mode 100644 index 00000000..66b9eef9 Binary files /dev/null and b/assets/account.db differ diff --git a/assets/config.ini b/assets/config.ini new file mode 100644 index 00000000..4cef3cb7 --- /dev/null +++ b/assets/config.ini @@ -0,0 +1,96 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; ; +; 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 +Port = 1345 +MOTD = Welcome to mooege development server! + +; Settings for game server +[Game-Server] +BindIP = 0.0.0.0 +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 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; 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 + +; Settings for packet logger, only recommended for developers! +[PacketLog] +Enabled=true +Target=File +FileName="packet-dump.log" +IncludeTimeStamps=false +MinimumLevel=Dump +MaximumLevel=Dump +ResetOnStartup=true + + 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..fda1c6d3 Binary files /dev/null and b/assets/mpqdata.db differ diff --git a/build/.gitignore b/build/.gitignore new file mode 100644 index 00000000..9fed9948 --- /dev/null +++ b/build/.gitignore @@ -0,0 +1,6 @@ +/_ReSharper.Mooege-VS2010/ +/*.6.0.ReSharper.user +/*.suo +/*.userprefs +/*.user +/_ReSharper.Mooege-Mono/ 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 100755 index 00000000..2b13e1a4 --- /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=`readlink -f $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/tools/GameServer/.gitignore b/build/tools/GameServer/.gitignore new file mode 100644 index 00000000..a4e21d13 --- /dev/null +++ b/build/tools/GameServer/.gitignore @@ -0,0 +1,9 @@ +/_ReSharper.GS-Tools/ +/*.6.0.ReSharper.user +/*.suo +/*.userprefs +/*.user +/_ReSharper.GSDumper/ +/_ReSharper.GSPacketDumper/ +/_ReSharper.TypeExtractor/ +/_ReSharper.GameMessageViewer/ 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/.gitignore b/build/tools/MooNet/.gitignore new file mode 100644 index 00000000..34a2e7db --- /dev/null +++ b/build/tools/MooNet/.gitignore @@ -0,0 +1,5 @@ +/_ReSharper.MooNet-Tools/ +/*.6.0.ReSharper.user +/*.suo +/*.userprefs +/*.user 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/protocompiler/README.txt b/contrib/protocompiler/README.txt new file mode 100644 index 00000000..44ccf4fe --- /dev/null +++ b/contrib/protocompiler/README.txt @@ -0,0 +1,6 @@ +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..a8e005ba --- /dev/null +++ b/contrib/protocompiler/definitions/Account.proto @@ -0,0 +1,50 @@ +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.Items.ItemList normal_shared_saved_items = 4; + optional .D3.Items.ItemList hardcore_shared_saved_items = 5; + optional .D3.ItemCrafting.CrafterSavedData crafter_saved_data = 6; + repeated sfixed32 seen_tutorials = 7; + optional sfixed64 num_vote_kicks_participated_in = 8; + optional sfixed64 num_vote_kicks_initiated = 9; + optional sfixed64 num_public_games_no_kick = 10; + optional sfixed64 times_vote_kicked = 11; + optional .D3.OnlineService.EntityId gold_id = 12; +} + 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/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..356544f1 --- /dev/null +++ b/contrib/protocompiler/definitions/GameMessage.proto @@ -0,0 +1,96 @@ +import "Hero.proto"; +import "OnlineService.proto"; +import "Settings.proto"; +import "Account.proto"; +import "Items.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 +{ + repeated .D3.OnlineService.EntityId toon_id = 1; +} + +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; +} + +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 SetAchievementShowcase +{ + required uint64 achievement_id = 1; + required uint32 slot = 2; +} + diff --git a/contrib/protocompiler/definitions/Hero.proto b/contrib/protocompiler/definitions/Hero.proto new file mode 100644 index 00000000..e2b79493 --- /dev/null +++ b/contrib/protocompiler/definitions/Hero.proto @@ -0,0 +1,149 @@ +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]; +} + +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 = 10; + required sint32 highest_unlocked_act = 11; + required sint32 last_played_difficulty = 12; + required sint32 highest_unlocked_difficulty = 13; + required sfixed32 last_played_quest = 14; + required sint32 last_played_quest_step = 15; + required uint32 time_played = 16 [default = 0]; +} + +message HotbarButtonData +{ + required sfixed32 sno_power = 1 [default = -1]; + required sfixed32 gbid_item = 2 [default = -1]; +} + +message SkillKeyMapping +{ + required sfixed32 sno_power = 1 [default = -1]; + required sint32 id_hotkey = 2 [default = -1]; + required sint32 skill_button = 3 [default = 0]; +} + +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 SavedData +{ + repeated .D3.Hero.HotbarButtonData hotbar_button_assignments = 1; + repeated .D3.Hero.SkillKeyMapping skill_key_map = 2; + required uint32 time_played = 3 [default = 0]; + required uint32 activated_waypoints = 4 [default = 0]; + required .D3.Hireling.SavedData hireling_saved_data = 5; + required uint32 last_level_time = 6 [default = 0]; + required .D3.Hero.LearnedLore learned_lore = 7; + required .D3.Hero.SavedConversations saved_conversations = 8; + repeated sfixed32 sno_active_skills = 9; + repeated sfixed32 sno_traits = 10; + repeated sfixed32 seen_tutorials = 11; + required .D3.Hero.SavePointData_Proto save_point = 12; +} + +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 NameSequence +{ + optional int64 sequence = 1 [default = 0]; +} + +message NameText +{ + required string name = 1; +} + +message Escrow +{ + required uint32 version = 1; + optional .D3.Items.Generator generator = 2; + optional .D3.Hero.SavedData hero_data = 3; + optional uint32 state = 4; + repeated .D3.OnlineService.ItemId serviced_tokens = 5; +} + +message HeroList +{ + repeated .D3.OnlineService.EntityId hero_ids = 1; +} + diff --git a/contrib/protocompiler/definitions/Hireling.proto b/contrib/protocompiler/definitions/Hireling.proto new file mode 100644 index 00000000..eee3c16c --- /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 = 11; + required bool dead = 12; +} + +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..28d31295 --- /dev/null +++ b/contrib/protocompiler/definitions/ItemCrafting.proto @@ -0,0 +1,15 @@ +package D3.ItemCrafting; + +message CrafterData +{ + repeated sfixed32 recipes = 1; + repeated sfixed32 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..c0eff5e5 --- /dev/null +++ b/contrib/protocompiler/definitions/Items.proto @@ -0,0 +1,81 @@ +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; + required .D3.Items.RareItemName rare_item_name = 4; + required sfixed32 enchant_affix = 5 [default = -1]; + required sfixed32 socket_affix = 6 [default = -1]; + required uint32 flags = 7 [default = 0]; + required uint32 durability = 8; + required uint64 stack_size = 9; + required uint32 dye_type = 10; + required sint32 item_quality_level = 11; + required sint32 item_binding_level = 12; + required uint32 max_durability = 13; + repeated .D3.Items.EmbeddedGenerator contents = 14; + optional sfixed32 attuned_skill = 15 [default = -1]; + optional uint64 item_unlock_timestamp = 16 [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 AuctionAccountInfo +{ + required .D3.OnlineService.EntityId account_id = 1; + required .D3.OnlineService.EntityId escrow_id = 2; +} + +message AuctionItem +{ + required .D3.OnlineService.ItemId id = 1; + required .D3.Items.Generator generator = 2; +} + +message AuctionInfo +{ + required .D3.OnlineService.ItemId id = 1; + optional .D3.Items.Ownership owner = 2; +} + +message ItemList +{ + repeated .D3.Items.SavedItem items = 1; +} + +message Ownership +{ + required .D3.OnlineService.EntityId owner_entity_id = 1; + optional sint64 delete_time = 2; + optional .D3.OnlineService.EntityId escrow_id = 3; +} + diff --git a/contrib/protocompiler/definitions/OnlineService.proto b/contrib/protocompiler/definitions/OnlineService.proto new file mode 100644 index 00000000..3d67d780 --- /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; + required bool is_private = 6 [default = true]; +} + +message HeroCreateParams +{ + required sfixed32 gbid_class = 1 [default = -1]; + required bool is_hardcore = 2 [default = false]; + required bool is_female = 3 [default = false]; +} + diff --git a/contrib/protocompiler/definitions/PartyMessage.proto b/contrib/protocompiler/definitions/PartyMessage.proto new file mode 100644 index 00000000..ebe518fa --- /dev/null +++ b/contrib/protocompiler/definitions/PartyMessage.proto @@ -0,0 +1,18 @@ +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; +} + diff --git a/contrib/protocompiler/definitions/Profile.proto b/contrib/protocompiler/definitions/Profile.proto new file mode 100644 index 00000000..ab60f6cb --- /dev/null +++ b/contrib/protocompiler/definitions/Profile.proto @@ -0,0 +1,91 @@ +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 sfixed32 rune = 2 [default = -1]; +} + +message SkillsWithRunes +{ + repeated .D3.Profile.SkillWithRune runes = 1; +} + +message PassiveSkills +{ + repeated sfixed32 sno_traits = 1; +} + +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 attack = 8; + optional uint32 precision = 9; + optional uint32 defense = 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.GameBalance.Handle killer = 23; + optional .D3.GameBalance.Handle kill_location = 24; + optional string epitaph = 25; + optional .D3.OnlineService.EntityId hero_id = 26; + optional float damage_increase = 27; + optional float crit_chance = 28; + optional float damage_reduction = 29; + optional uint32 life = 30; +} + +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; + optional uint64 achievement_showcase_0 = 16; + optional uint64 achievement_showcase_1 = 17; + optional uint64 achievement_showcase_2 = 18; +} + diff --git a/contrib/protocompiler/definitions/Quest.proto b/contrib/protocompiler/definitions/Quest.proto new file mode 100644 index 00000000..3e878e41 --- /dev/null +++ b/contrib/protocompiler/definitions/Quest.proto @@ -0,0 +1,17 @@ +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; +} + +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..e295df27 --- /dev/null +++ b/contrib/protocompiler/definitions/Settings.proto @@ -0,0 +1,22 @@ +package D3.Client; + +message ToonSettings +{ + optional uint32 ui_flags = 1 [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; +} + +message Preferences +{ + optional int32 key_1 = 1; + optional int32 key_2 = 2; + optional int32 key_3 = 3; + optional int32 key_4 = 4; +} + diff --git a/contrib/protocompiler/definitions/Stats.proto b/contrib/protocompiler/definitions/Stats.proto new file mode 100644 index 00000000..53f47ac8 --- /dev/null +++ b/contrib/protocompiler/definitions/Stats.proto @@ -0,0 +1,15 @@ +package D3.Stats; + +message StatCategory +{ + required uint32 stat_id = 1; + required uint32 data_1 = 2; + optional uint32 data_2 = 3; + required uint64 total = 4; +} + +message StatList +{ + repeated .D3.Stats.StatCategory stats = 1; +} + 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/definitions/lib/config/process_config.proto b/contrib/protocompiler/definitions/lib/config/process_config.proto new file mode 100644 index 00000000..e8be2087 --- /dev/null +++ b/contrib/protocompiler/definitions/lib/config/process_config.proto @@ -0,0 +1,79 @@ +import "lib/rpc/rpc.proto"; + +package bnet.protocol.config; + +message Var +{ + required string name = 1; + required string value = 2; +} + +message Resource +{ + required string name = 1; + required string url = 2; +} + +message ProgramResources +{ + repeated .bnet.protocol.config.Resource program = 1; +} + +message ServerAddress +{ + required .bnet.protocol.Address address = 1; + required string process_name = 2; + optional string server_name = 3; +} + +message ServerSet +{ + repeated .bnet.protocol.config.ServerAddress server_address = 1; + repeated string exported_service = 2; + repeated string imported_service = 3; +} + +message SupplementalService +{ + required string name = 1; + required uint32 port = 2; +} + +message ListenPoint +{ + required uint32 port = 1; + optional string address = 2 [default = "0.0.0.0"]; + repeated .bnet.protocol.config.ServerSet accept = 3; +} + +message ServiceShard +{ + required string process_name = 1; +} + +message ServiceConfig +{ + required string name = 1; + required string url = 2; + repeated .bnet.protocol.config.ServiceShard shard = 3; +} + +message RPCServerConfig +{ + required string name = 1; + optional .bnet.protocol.config.ListenPoint listen = 2; + repeated .bnet.protocol.config.ServerSet connect = 3; +} + +message ProcessConfig +{ + required string process_name = 1; + repeated uint32 cpu_affinity_main_event_processor = 7 [packed=true]; + repeated uint32 cpu_affinity_network_event_processor = 8 [packed=true]; + repeated .bnet.protocol.config.RPCServerConfig server = 2; + repeated .bnet.protocol.config.Resource resource = 3; + repeated .bnet.protocol.config.ServiceConfig service = 4; + repeated .bnet.protocol.config.Var var = 5; + repeated .bnet.protocol.config.SupplementalService supplemental_service = 6; +} + diff --git a/contrib/protocompiler/definitions/lib/profanity/profanity.proto b/contrib/protocompiler/definitions/lib/profanity/profanity.proto new file mode 100644 index 00000000..4f074cf9 --- /dev/null +++ b/contrib/protocompiler/definitions/lib/profanity/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/lib/protocol/attribute.proto b/contrib/protocompiler/definitions/lib/protocol/attribute.proto new file mode 100644 index 00000000..21f2d117 --- /dev/null +++ b/contrib/protocompiler/definitions/lib/protocol/attribute.proto @@ -0,0 +1,37 @@ +import "lib/protocol/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/lib/protocol/content_handle.proto b/contrib/protocompiler/definitions/lib/protocol/content_handle.proto new file mode 100644 index 00000000..661740fe --- /dev/null +++ b/contrib/protocompiler/definitions/lib/protocol/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/lib/protocol/descriptor.proto b/contrib/protocompiler/definitions/lib/protocol/descriptor.proto new file mode 100644 index 00000000..e9773cb8 --- /dev/null +++ b/contrib/protocompiler/definitions/lib/protocol/descriptor.proto @@ -0,0 +1,7 @@ +package bnet.protocol; + +message Path +{ + repeated uint32 ordinal = 1 [packed=true]; +} + diff --git a/contrib/protocompiler/definitions/lib/protocol/entity.proto b/contrib/protocompiler/definitions/lib/protocol/entity.proto new file mode 100644 index 00000000..c0d8607c --- /dev/null +++ b/contrib/protocompiler/definitions/lib/protocol/entity.proto @@ -0,0 +1,15 @@ +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; + optional .bnet.protocol.EntityId toon_id = 3; +} + diff --git a/contrib/protocompiler/definitions/lib/protocol/exchange.proto b/contrib/protocompiler/definitions/lib/protocol/exchange.proto new file mode 100644 index 00000000..77007a49 --- /dev/null +++ b/contrib/protocompiler/definitions/lib/protocol/exchange.proto @@ -0,0 +1,31 @@ +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; +} + diff --git a/contrib/protocompiler/definitions/lib/protocol/exchange_object_provider.proto b/contrib/protocompiler/definitions/lib/protocol/exchange_object_provider.proto new file mode 100644 index 00000000..f5398b72 --- /dev/null +++ b/contrib/protocompiler/definitions/lib/protocol/exchange_object_provider.proto @@ -0,0 +1,61 @@ +import "lib/protocol/entity.proto"; +import "lib/protocol/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; +} + +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; +} + +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; +} + +message GetPaymentMethodsRequest +{ + optional .bnet.protocol.EntityId bnet_account = 1; + optional .bnet.protocol.EntityId game_account = 2; + optional .bnet.protocol.EntityId toon = 3; + required string currency = 4; + required uint32 cash_in_out_mask = 5; + optional bool refresh_payment_method_cache = 6 [default = false]; + optional bool refresh_e_balance_cache = 7 [default = false]; +} + +message PaymentMethod +{ + required .bnet.protocol.exchange.BlobFrom account = 1; + required string description = 2; + optional uint64 amount = 3; + optional uint32 cash_in_out_mask = 4 [default = 3]; + optional uint32 country_id = 5; + optional string state = 6; + optional string city = 7; + optional string postal_code = 8; +} + +message GetPaymentMethodsResponse +{ + repeated .bnet.protocol.exchange_object_provider.PaymentMethod methods = 1; +} + diff --git a/contrib/protocompiler/definitions/lib/protocol/exchange_risk.proto b/contrib/protocompiler/definitions/lib/protocol/exchange_risk.proto new file mode 100644 index 00000000..34236a05 --- /dev/null +++ b/contrib/protocompiler/definitions/lib/protocol/exchange_risk.proto @@ -0,0 +1,28 @@ +import "lib/protocol/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; +} + diff --git a/contrib/protocompiler/definitions/lib/protocol/invitation.proto b/contrib/protocompiler/definitions/lib/protocol/invitation.proto new file mode 100644 index 00000000..e81a89ea --- /dev/null +++ b/contrib/protocompiler/definitions/lib/protocol/invitation.proto @@ -0,0 +1,48 @@ +import "lib/protocol/attribute.proto"; +import "lib/protocol/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; +} + +message SendInvitationRequest +{ + optional .bnet.protocol.Identity agent_identity = 1; + required .bnet.protocol.EntityId target_id = 2; + optional string invitation_message = 3; + optional uint64 expiration_time = 4 [default = 0]; + extensions 100 to 10000; +} + +message SendInvitationResponse +{ + optional .bnet.protocol.invitation.Invitation invitation = 2; +} + +message GenericRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + optional .bnet.protocol.EntityId target_id = 2; + required fixed64 invitation_id = 3; +} + diff --git a/contrib/protocompiler/definitions/lib/protocol/resource.proto b/contrib/protocompiler/definitions/lib/protocol/resource.proto new file mode 100644 index 00000000..ae5bb0d6 --- /dev/null +++ b/contrib/protocompiler/definitions/lib/protocol/resource.proto @@ -0,0 +1,35 @@ +import "lib/protocol/content_handle.proto"; +import "lib/protocol/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/lib/rpc/connection.proto b/contrib/protocompiler/definitions/lib/rpc/connection.proto new file mode 100644 index 00000000..2c0f753e --- /dev/null +++ b/contrib/protocompiler/definitions/lib/rpc/connection.proto @@ -0,0 +1,98 @@ +import "lib/rpc/rpc.proto"; + +package bnet.protocol.connection; + +option cc_generic_services = false; + +message ConnectRequest +{ + optional .bnet.protocol.ProcessId client_id = 1; +} + +message ConnectResponse +{ + required .bnet.protocol.ProcessId server_id = 1; + optional .bnet.protocol.ProcessId client_id = 2; +} + +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/lib/rpc/rpc.proto b/contrib/protocompiler/definitions/lib/rpc/rpc.proto new file mode 100644 index 00000000..543ffecc --- /dev/null +++ b/contrib/protocompiler/definitions/lib/rpc/rpc.proto @@ -0,0 +1,65 @@ +import "google/protobuf/descriptor.proto"; + +package bnet.protocol; + +message NO_RESPONSE +{ +} + +message Address +{ + required string address = 1; + optional uint32 port = 2; + optional .bnet.protocol.Address next = 3; +} + +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; +} + +extend .google.protobuf.MethodOptions +{ + optional uint32 cost = 50001; +} + +extend .google.protobuf.MethodOptions +{ + optional float timeout = 50002; +} + diff --git a/contrib/protocompiler/definitions/service/achievements/definition/achievements.proto b/contrib/protocompiler/definitions/service/achievements/definition/achievements.proto new file mode 100644 index 00000000..d636b004 --- /dev/null +++ b/contrib/protocompiler/definitions/service/achievements/definition/achievements.proto @@ -0,0 +1,128 @@ +import "lib/rpc/rpc.proto"; +import "lib/protocol/entity.proto"; +import "lib/protocol/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 uint64 criteria_Id = 1; + optional uint64 start_time = 2 [default = 0]; + optional uint64 quantity = 3 [default = 0]; + optional uint32 flags = 4 [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]; +} + +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]; +} + +message RegisterWithServiceResponse +{ + optional uint32 max_records_per_update = 1 [default = 0]; + optional uint32 max_criteria_per_record = 2 [default = 0]; + optional uint32 max_achievements_per_record = 3 [default = 0]; + optional uint32 max_registrations = 4 [default = 0]; + optional uint64 flush_frequency = 5 [default = 0]; + optional .bnet.protocol.achievements.Snapshot snapshot = 6; +} + +message UnregisterFromServiceRequest +{ + required .bnet.protocol.EntityId target_id = 1; + required uint64 object_id = 2; +} + +message Snapshot +{ + repeated .bnet.protocol.achievements.AchievementUpdateRecord achievement_snapshot = 1; + repeated .bnet.protocol.achievements.CriteriaUpdateRecord criteria_snapshot = 2; +} + +message RequestSnapshotRequest +{ + required .bnet.protocol.EntityId entity_id = 1; + required uint32 filter = 2; +} + +message RequestSnapshotResponse +{ + optional .bnet.protocol.achievements.Snapshot snapshot = 1; +} + +message InitializeRequest +{ + optional fixed32 program_id = 1; +} + +message InitializeResponse +{ + required .bnet.protocol.ContentHandle content_handle = 1; +} + +message SnapshotUpdateNotification +{ + required .bnet.protocol.EntityId target_id = 1; + required .bnet.protocol.achievements.Snapshot snapshot = 2; +} + +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; + } +} + +service AchievementsNotify +{ + rpc NotifySnapshotUpdate(.bnet.protocol.achievements.SnapshotUpdateNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } +} + diff --git a/contrib/protocompiler/definitions/service/achievements/definition/achievements_static_data.proto b/contrib/protocompiler/definitions/service/achievements/definition/achievements_static_data.proto new file mode 100644 index 00000000..cf84b781 --- /dev/null +++ b/contrib/protocompiler/definitions/service/achievements/definition/achievements_static_data.proto @@ -0,0 +1,73 @@ +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; +} + +enum ModiferTargetType +{ + SUBJECT = 1400201834; + OBJECT = 5202538; +} + diff --git a/contrib/protocompiler/definitions/service/authentication/definition/authentication.proto b/contrib/protocompiler/definitions/service/authentication/definition/authentication.proto new file mode 100644 index 00000000..c5f279a0 --- /dev/null +++ b/contrib/protocompiler/definitions/service/authentication/definition/authentication.proto @@ -0,0 +1,68 @@ +import "lib/rpc/rpc.proto"; +import "lib/protocol/content_handle.proto"; +import "lib/protocol/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 ModuleLoadResponse +{ + optional int32 module_id = 2; +} + +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 uint64 listener_id = 5; + optional string version = 6; + optional int32 application_version = 7; +} + +message LogonResponse +{ + required .bnet.protocol.EntityId account = 1; + required .bnet.protocol.EntityId game_account = 2; +} + +service AuthenticationClient +{ + rpc ModuleLoad(.bnet.protocol.authentication.ModuleLoadRequest) returns(.bnet.protocol.authentication.ModuleLoadResponse) + { + option (method_id) = 1; + option (timeout) = 180; + } + rpc ModuleMessage(.bnet.protocol.authentication.ModuleMessageRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 2; + } +} + +service AuthenticationServer +{ + rpc Logon(.bnet.protocol.authentication.LogonRequest) returns(.bnet.protocol.authentication.LogonResponse) + { + option (method_id) = 1; + option (timeout) = 600; + } + rpc ModuleMessage(.bnet.protocol.authentication.ModuleMessageRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 2; + } +} + diff --git a/contrib/protocompiler/definitions/service/challenge/definition/challenge.proto b/contrib/protocompiler/definitions/service/challenge/definition/challenge.proto new file mode 100644 index 00000000..8c7c497f --- /dev/null +++ b/contrib/protocompiler/definitions/service/challenge/definition/challenge.proto @@ -0,0 +1,66 @@ +import "lib/protocol/attribute.proto"; +import "lib/protocol/entity.proto"; +import "lib/rpc/rpc.proto"; + +package bnet.protocol.challenge; + +option cc_generic_services = false; + +message Challenge +{ + required uint32 type = 1; + optional string info = 2; + optional string answer = 3; +} + +message ChallengePickedRequest +{ + required uint32 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; +} + +message SendChallengeToUserResponse +{ + required .bnet.protocol.challenge.Challenge challenge = 1; +} + +message ChallengeUserRequest +{ + repeated .bnet.protocol.challenge.Challenge challenges = 1; +} + +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.NO_RESPONSE) + { + option (method_id) = 2; + } + rpc SendChallengeToUser(.bnet.protocol.challenge.SendChallengeToUserRequest) returns(.bnet.protocol.challenge.SendChallengeToUserResponse) + { + option (method_id) = 3; + } +} + +service ChallengeNotify +{ + rpc ChallengeUser(.bnet.protocol.challenge.ChallengeUserRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } +} + diff --git a/contrib/protocompiler/definitions/service/channel/definition/channel.proto b/contrib/protocompiler/definitions/service/channel/definition/channel.proto new file mode 100644 index 00000000..1de0b63c --- /dev/null +++ b/contrib/protocompiler/definitions/service/channel/definition/channel.proto @@ -0,0 +1,164 @@ +import "lib/protocol/attribute.proto"; +import "lib/protocol/entity.proto"; +import "lib/rpc/rpc.proto"; +import "service/channel/definition/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 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; +} + +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/service/channel/definition/channel_owner.proto b/contrib/protocompiler/definitions/service/channel/definition/channel_owner.proto new file mode 100644 index 00000000..87740477 --- /dev/null +++ b/contrib/protocompiler/definitions/service/channel/definition/channel_owner.proto @@ -0,0 +1,92 @@ +import "lib/protocol/attribute.proto"; +import "lib/protocol/entity.proto"; +import "lib/rpc/rpc.proto"; +import "service/channel/definition/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.ChannelState state = 2; + optional .bnet.protocol.EntityId channel_id = 3; + optional uint64 object_id = 4; +} + +message CreateChannelResponse +{ + required uint64 object_id = 1; + optional .bnet.protocol.EntityId channel_id = 2; +} + +message JoinChannelRequest +{ + optional .bnet.protocol.Identity agent_identity = 1; + required .bnet.protocol.EntityId channel_id = 2; + required uint64 object_id = 3; + repeated .bnet.protocol.EntityId friend_account_id = 4; +} + +message JoinChannelResponse +{ + optional uint64 object_id = 1; + optional bool require_friend_validation = 2 [default = false]; + repeated .bnet.protocol.EntityId privileged_account = 3; +} + +message FindChannelRequest +{ + required .bnet.protocol.attribute.AttributeFilter filter = 1; +} + +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/service/channel/definition/channel_types.proto b/contrib/protocompiler/definitions/service/channel/definition/channel_types.proto new file mode 100644 index 00000000..08a54962 --- /dev/null +++ b/contrib/protocompiler/definitions/service/channel/definition/channel_types.proto @@ -0,0 +1,66 @@ +import "lib/protocol/attribute.proto"; +import "lib/protocol/entity.proto"; +import "lib/protocol/invitation.proto"; + +package bnet.protocol.channel; + +message Message +{ + repeated .bnet.protocol.attribute.Attribute attribute = 1; + optional uint32 role = 2; + 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; + extensions 100 to 10000; +} + +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 bool public = 8; + optional string name = 9; + optional string delegate_name = 10; + optional string channel_type = 11 [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]; + 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/service/channel_invitation/definition/channel_invitation.proto b/contrib/protocompiler/definitions/service/channel_invitation/definition/channel_invitation.proto new file mode 100644 index 00000000..0f0ac353 --- /dev/null +++ b/contrib/protocompiler/definitions/service/channel_invitation/definition/channel_invitation.proto @@ -0,0 +1,128 @@ +import "lib/protocol/entity.proto"; +import "lib/protocol/invitation.proto"; +import "lib/rpc/rpc.proto"; +import "service/channel/definition/channel.proto"; +import "service/channel_invitation/definition/channel_invitation_types.proto"; + +package bnet.protocol.channel_invitation; + +option cc_generic_services = false; + +message AcceptInvitationRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required fixed64 invitation_id = 2; + required uint64 object_id = 3; +} + +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; +} + +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/service/channel_invitation/definition/channel_invitation_types.proto b/contrib/protocompiler/definitions/service/channel_invitation/definition/channel_invitation_types.proto new file mode 100644 index 00000000..319d6f79 --- /dev/null +++ b/contrib/protocompiler/definitions/service/channel_invitation/definition/channel_invitation_types.proto @@ -0,0 +1,38 @@ +import "lib/protocol/invitation.proto"; +import "lib/protocol/entity.proto"; +import "service/channel/definition/channel_types.proto"; + +package bnet.protocol.channel_invitation; + +message Invitation +{ + 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.Invitation channel_invitation = 105; + } +} + +message SendInvitationRequest +{ + required .bnet.protocol.EntityId channel_id = 1; + optional bool reserved = 2; + optional bool rejoin = 3; + required uint32 service_type = 4; + extend .bnet.protocol.invitation.SendInvitationRequest + { + optional .bnet.protocol.channel_invitation.SendInvitationRequest channel_invitation = 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/service/chat/definition/chat_types.proto b/contrib/protocompiler/definitions/service/chat/definition/chat_types.proto new file mode 100644 index 00000000..178dd029 --- /dev/null +++ b/contrib/protocompiler/definitions/service/chat/definition/chat_types.proto @@ -0,0 +1,15 @@ +import "service/channel/definition/channel_types.proto"; + +package bnet.protocol.chat; + +message ChannelState +{ + optional string identity = 1; + optional fixed32 program = 2; + optional fixed32 locale = 3; + extend .bnet.protocol.channel.ChannelState + { + optional .bnet.protocol.chat.ChannelState chat = 100; + } +} + diff --git a/contrib/protocompiler/definitions/service/exchange/definition/exchange.proto b/contrib/protocompiler/definitions/service/exchange/definition/exchange.proto new file mode 100644 index 00000000..d138f1d8 --- /dev/null +++ b/contrib/protocompiler/definitions/service/exchange/definition/exchange.proto @@ -0,0 +1,423 @@ +import "google/protobuf/csharp_options.proto"; +import "lib/rpc/rpc.proto"; +import "lib/protocol/exchange.proto"; +import "lib/protocol/exchange_object_provider.proto"; +import "lib/protocol/exchange_risk.proto"; +import "lib/protocol/entity.proto"; +import "service/exchange/definition/exchange_types.proto"; + +package bnet.protocol.exchange; + +option cc_generic_services = false; +option (google.protobuf.csharp_file_options).umbrella_classname = "ExchangeService"; + +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; + optional string currency = 6; + optional int32 specialist = 7; + optional bool bootstrap = 8; + optional uint64 bootstrap_oldest_created_time = 9; +} + +message UnsubscribeOrderBookStatusChangeRequest +{ +} + +message SubscribeOrderStatusChangeRequest +{ + required .bnet.protocol.EntityId agent_id = 1; + required uint64 object_id = 2; +} + +message UnsubscribeOrderStatusChangeRequest +{ + required .bnet.protocol.EntityId agent_id = 1; + required uint64 object_id = 2; +} + +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; +} + +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 GetConfigurationRequest +{ + required fixed32 program = 1; +} + +message GetConfigurationResponse +{ + repeated .bnet.protocol.exchange.SpecialistConfig configs = 1; +} + +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 .bnet.protocol.exchange.BlobFrom extra_info = 3; +} + +message BidNotificationRequest +{ + required .bnet.protocol.exchange.BidExtended bid = 1; + required uint32 event = 2; + optional .bnet.protocol.exchange.BlobFrom extra_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; +} + +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 SubscribeOrderStatusChange(.bnet.protocol.exchange.SubscribeOrderStatusChangeRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 18; + } + rpc UnsubscribeOrderStatusChange(.bnet.protocol.exchange.UnsubscribeOrderStatusChangeRequest) 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; + } +} + +service ExchangeNotify +{ + rpc NotifyOrderBookStatusChange(.bnet.protocol.exchange.OrderBookNotificationRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } + rpc NotifyOfferStatusChange(.bnet.protocol.exchange.OfferNotificationRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 2; + } + rpc NotifyBidStatusChange(.bnet.protocol.exchange.BidNotificationRequest) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 3; + } +} + diff --git a/contrib/protocompiler/definitions/service/exchange/definition/exchange_types.proto b/contrib/protocompiler/definitions/service/exchange/definition/exchange_types.proto new file mode 100644 index 00000000..fe9031c0 --- /dev/null +++ b/contrib/protocompiler/definitions/service/exchange/definition/exchange_types.proto @@ -0,0 +1,238 @@ +import "lib/protocol/entity.proto"; +import "lib/protocol/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.EntityId toon = 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]; +} + +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; +} + +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; +} + +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; +} + +message QueryOrderFilter +{ + optional string currency = 1; + optional uint32 specialist = 2; + optional uint32 order_type = 3; + optional uint32 claimable = 4 [default = 0]; + required int32 order_status = 5; + required .bnet.protocol.exchange.QueryFilterByCreatedTime time_filter = 6; +} + +message Settlement +{ + required uint64 order_book_id = 1; + required uint64 money_amount = 2; + required uint64 items_amount = 3; + required uint64 offer_settle_id = 4; +} + +message CurrencyConfig +{ + required string currency = 1; + required uint64 tick_size = 2; + required uint64 min_unit_price = 3; + required uint64 max_unit_price = 4; + required uint64 max_total_price = 7; +} + +message SpecialistConfig +{ + required int32 specialist = 1; + repeated uint64 auction_durations = 2 [packed=true]; + repeated uint64 auction_start_delays = 3 [packed=true]; + required uint64 anti_sniping_extension_delay = 4; + required uint64 max_items_amount = 5; + required int32 starting_unit_price_rule = 6; + required int32 reserved_unit_price_rule = 7; + required int32 trade_now_unit_price_rule = 8; + required int32 current_unit_price_rule = 9; + required int32 maximum_unit_price_rule = 10; + repeated .bnet.protocol.exchange.CurrencyConfig currency_config = 11; +} + +message BillingAddress +{ + required int32 country_id = 1; + required string city = 2; + optional string state = 3; + optional string postal_code = 4; +} + +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 uint64 scaling_fee_amount = 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; +} + diff --git a/contrib/protocompiler/definitions/service/followers/definition/followers.proto b/contrib/protocompiler/definitions/service/followers/definition/followers.proto new file mode 100644 index 00000000..ad5e1679 --- /dev/null +++ b/contrib/protocompiler/definitions/service/followers/definition/followers.proto @@ -0,0 +1,93 @@ +import "lib/protocol/attribute.proto"; +import "lib/protocol/entity.proto"; +import "lib/rpc/rpc.proto"; + +package bnet.protocol.followers; + +option cc_generic_services = false; + +message FollowedUser +{ + required .bnet.protocol.EntityId id = 1; + repeated .bnet.protocol.attribute.Attribute attribute = 2; +} + +message SubscribeToFollowersRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required uint64 object_id = 2; +} + +message SubscribeToFollowersResponse +{ + repeated .bnet.protocol.followers.FollowedUser followed_users = 2; +} + +message StartFollowingRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId target_id = 2; +} + +message StartFollowingResponse +{ + optional .bnet.protocol.followers.FollowedUser followed_user = 2; +} + +message StopFollowingRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId target_id = 2; +} + +message StopFollowingResponse +{ + optional .bnet.protocol.followers.FollowedUser followed_user = 2; +} + +message UpdateFollowerStateRequest +{ + optional .bnet.protocol.EntityId agent_id = 1; + required .bnet.protocol.EntityId target_id = 2; + repeated .bnet.protocol.attribute.Attribute attribute = 3; +} + +message UpdateFollowerStateResponse +{ + required .bnet.protocol.EntityId target_id = 2; + repeated .bnet.protocol.attribute.Attribute attribute = 3; +} + +message FollowerNotification +{ + required .bnet.protocol.followers.FollowedUser followed_user = 1; +} + +service FollowersService +{ + rpc SubscribeToFollowers(.bnet.protocol.followers.SubscribeToFollowersRequest) returns(.bnet.protocol.followers.SubscribeToFollowersResponse) + { + option (method_id) = 1; + } + rpc StartFollowing(.bnet.protocol.followers.StartFollowingRequest) returns(.bnet.protocol.followers.StartFollowingResponse) + { + option (method_id) = 2; + } + rpc StopFollowing(.bnet.protocol.followers.StopFollowingRequest) returns(.bnet.protocol.followers.StopFollowingResponse) + { + option (method_id) = 3; + } + rpc UpdateFollowerState(.bnet.protocol.followers.UpdateFollowerStateRequest) returns(.bnet.protocol.followers.UpdateFollowerStateResponse) + { + option (method_id) = 8; + } +} + +service FollowersNotify +{ + rpc NotifyFollowerRemoved(.bnet.protocol.followers.FollowerNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } +} + diff --git a/contrib/protocompiler/definitions/service/friends/definition/friends.proto b/contrib/protocompiler/definitions/service/friends/definition/friends.proto new file mode 100644 index 00000000..565a9462 --- /dev/null +++ b/contrib/protocompiler/definitions/service/friends/definition/friends.proto @@ -0,0 +1,173 @@ +import "lib/protocol/attribute.proto"; +import "lib/protocol/entity.proto"; +import "lib/protocol/invitation.proto"; +import "lib/rpc/rpc.proto"; +import "service/friends/definition/friends_types.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.friends.Friend friends = 4; + repeated .bnet.protocol.invitation.Invitation sent_invitations = 5; + repeated .bnet.protocol.invitation.Invitation received_invitations = 6; +} + +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 SendInvitationRequest +{ + optional string target_email = 1; + optional string display_string = 2; + extend .bnet.protocol.invitation.SendInvitationRequest + { + optional .bnet.protocol.friends.SendInvitationRequest friend_request = 103; + } +} + +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; +} + +message FriendNotification +{ + required .bnet.protocol.friends.Friend target = 1; +} + +message UpdateFriendStateNotification +{ + required .bnet.protocol.friends.Friend changed_friend = 1; +} + +message InvitationAddedNotification +{ + required .bnet.protocol.invitation.Invitation invitation = 1; +} + +message InvitationRemovedNotification +{ + required .bnet.protocol.invitation.Invitation invitation = 1; + optional uint32 reason = 2; + optional .bnet.protocol.friends.Friend added_friend = 3; +} + +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 RemoveFriend(.bnet.protocol.friends.GenericFriendRequest) returns(.bnet.protocol.friends.GenericFriendResponse) + { + option (method_id) = 7; + } + rpc ViewFriends(.bnet.protocol.friends.ViewFriendsRequest) returns(.bnet.protocol.friends.ViewFriendsResponse) + { + option (method_id) = 8; + } + rpc UpdateFriendState(.bnet.protocol.friends.UpdateFriendStateRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 9; + } + rpc UnsubscribeToFriends(.bnet.protocol.friends.UnsubscribeToFriendsRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 10; + } +} + +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.InvitationAddedNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 3; + } + rpc NotifyReceivedInvitationRemoved(.bnet.protocol.friends.InvitationRemovedNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 4; + } + rpc NotifySentInvitationAdded(.bnet.protocol.friends.InvitationAddedNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 5; + } + rpc NotifySentInvitationRemoved(.bnet.protocol.friends.InvitationRemovedNotification) 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/service/friends/definition/friends_types.proto b/contrib/protocompiler/definitions/service/friends/definition/friends_types.proto new file mode 100644 index 00000000..14bcbd6a --- /dev/null +++ b/contrib/protocompiler/definitions/service/friends/definition/friends_types.proto @@ -0,0 +1,21 @@ +import "lib/protocol/attribute.proto"; +import "lib/protocol/entity.proto"; +import "lib/protocol/invitation.proto"; + +package bnet.protocol.friends; + +message Friend +{ + required .bnet.protocol.EntityId id = 1; + repeated .bnet.protocol.attribute.Attribute attribute = 2; +} + +message FriendInvitation +{ + optional bool first_received = 1 [default = false]; + extend .bnet.protocol.invitation.Invitation + { + optional .bnet.protocol.friends.FriendInvitation friend_invitation = 103; + } +} + diff --git a/contrib/protocompiler/definitions/service/game_master/definition/game_factory.proto b/contrib/protocompiler/definitions/service/game_master/definition/game_factory.proto new file mode 100644 index 00000000..72beffcd --- /dev/null +++ b/contrib/protocompiler/definitions/service/game_master/definition/game_factory.proto @@ -0,0 +1,14 @@ +import "lib/protocol/attribute.proto"; +import "lib/protocol/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/service/game_master/definition/game_master.proto b/contrib/protocompiler/definitions/service/game_master/definition/game_master.proto new file mode 100644 index 00000000..18c4e9c7 --- /dev/null +++ b/contrib/protocompiler/definitions/service/game_master/definition/game_master.proto @@ -0,0 +1,237 @@ +import "service/game_master/definition/game_factory.proto"; +import "service/server_pool/definition/server_pool.proto"; +import "lib/protocol/attribute.proto"; +import "lib/protocol/entity.proto"; +import "lib/rpc/rpc.proto"; +import "service/game_master/definition/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 +{ + repeated .bnet.protocol.game_master.ConnectInfo connect_info = 1; +} + +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; + required uint64 object_id = 4; +} + +message FindGameResponse +{ + optional uint64 request_id = 1; + optional fixed64 factory_id = 2; +} + +message CancelFindGameRequest +{ + required fixed64 factory_id = 1; + required uint64 request_id = 2; +} + +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 toon_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 uint64 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 CancelFindGame(.bnet.protocol.game_master.CancelFindGameRequest) 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/service/game_master/definition/game_master_types.proto b/contrib/protocompiler/definitions/service/game_master/definition/game_master_types.proto new file mode 100644 index 00000000..496f39bb --- /dev/null +++ b/contrib/protocompiler/definitions/service/game_master/definition/game_master_types.proto @@ -0,0 +1,55 @@ +import "lib/protocol/attribute.proto"; +import "lib/protocol/entity.proto"; + +package bnet.protocol.game_master; + +message Player +{ + enum Type + { + TOON = 0; + COMPUTER = 1; + } + + optional .bnet.protocol.game_master.Player.Type type = 1 [default = TOON]; + optional .bnet.protocol.EntityId toon_id = 2; + optional .bnet.protocol.EntityId game_account_id = 3; + optional .bnet.protocol.EntityId bnet_account_id = 4; + repeated .bnet.protocol.attribute.Attribute attribute = 5; +} + +message ConnectInfo +{ + required .bnet.protocol.EntityId toon_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; +} + +message GameHandle +{ + required fixed64 factory_id = 1; + required .bnet.protocol.EntityId game_id = 2; +} + diff --git a/contrib/protocompiler/definitions/service/game_utilities/definition/game_utilities.proto b/contrib/protocompiler/definitions/service/game_utilities/definition/game_utilities.proto new file mode 100644 index 00000000..cb8b9fd0 --- /dev/null +++ b/contrib/protocompiler/definitions/service/game_utilities/definition/game_utilities.proto @@ -0,0 +1,160 @@ +import "service/game_master/definition/game_master.proto"; +import "service/server_pool/definition/server_pool.proto"; +import "service/toon/definition/toon.proto"; +import "lib/protocol/attribute.proto"; +import "lib/protocol/entity.proto"; +import "lib/rpc/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; + optional .bnet.protocol.EntityId toon_id = 5; +} + +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 CreateToonRequest +{ + required .bnet.protocol.EntityId bnet_account_id = 1; + required .bnet.protocol.EntityId game_account_id = 2; + required string name = 4; + repeated .bnet.protocol.attribute.Attribute attribute = 5; + optional .bnet.protocol.ProcessId host = 6; + required uint32 token = 7; + required .bnet.protocol.ProcessId sender = 8; +} + +message DeleteToonRequest +{ + optional .bnet.protocol.EntityId bnet_account_id = 1; + optional .bnet.protocol.EntityId game_account_id = 2; + required .bnet.protocol.EntityId toon_id = 3; + optional .bnet.protocol.ProcessId host = 4; +} + +message TransferToonRequest +{ + message Account + { + required .bnet.protocol.EntityId bnet_account_id = 1; + required .bnet.protocol.EntityId game_account_id = 2; + } + + required .bnet.protocol.EntityId toon_id = 1; + optional .bnet.protocol.game_utilities.TransferToonRequest.Account source = 2; + optional .bnet.protocol.game_utilities.TransferToonRequest.Account target = 3; + optional .bnet.protocol.ProcessId host = 4; +} + +message SelectToonRequest +{ + required .bnet.protocol.EntityId bnet_account_id = 1; + required .bnet.protocol.EntityId game_account_id = 2; + required .bnet.protocol.EntityId toon_id = 3; + optional .bnet.protocol.ProcessId host = 4; +} + +message PresenceChannelCreatedRequest +{ + required .bnet.protocol.EntityId id = 1; + optional .bnet.protocol.EntityId toon_id = 2; + 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; + required .bnet.protocol.EntityId toon_id = 3; + 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]; +} + +service GameUtilities +{ + rpc ProcessClientRequest(.bnet.protocol.game_utilities.ClientRequest) returns(.bnet.protocol.game_utilities.ClientResponse) + { + option (method_id) = 1; + } + rpc CreateToon(.bnet.protocol.game_utilities.CreateToonRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 2; + } + rpc DeleteToon(.bnet.protocol.game_utilities.DeleteToonRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 3; + } + rpc TransferToon(.bnet.protocol.game_utilities.TransferToonRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 4; + } + rpc SelectToon(.bnet.protocol.game_utilities.SelectToonRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 5; + } + rpc PresenceChannelCreated(.bnet.protocol.game_utilities.PresenceChannelCreatedRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 6; + } + rpc GetPlayerVariables(.bnet.protocol.game_utilities.PlayerVariablesRequest) returns(.bnet.protocol.game_utilities.VariablesResponse) + { + option (method_id) = 7; + } + rpc GetGameVariables(.bnet.protocol.game_utilities.GameVariablesRequest) returns(.bnet.protocol.game_utilities.VariablesResponse) + { + option (method_id) = 8; + } + rpc GetLoad(.bnet.protocol.server_pool.GetLoadRequest) returns(.bnet.protocol.server_pool.ServerState) + { + option (method_id) = 9; + } + rpc CreateToonEntity(.bnet.protocol.toon.CreateToonEntityRequest) returns(.bnet.protocol.toon.CreateToonEntityResponse) + { + option (method_id) = 10; + } + rpc FinalizeToonCreation(.bnet.protocol.toon.FinalizeToonCreationRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 11; + } + rpc ProcessServerRequest(.bnet.protocol.game_utilities.ServerRequest) returns(.bnet.protocol.game_utilities.ServerResponse) + { + option (method_id) = 12; + } +} + diff --git a/contrib/protocompiler/definitions/service/notification/definition/notification.proto b/contrib/protocompiler/definitions/service/notification/definition/notification.proto new file mode 100644 index 00000000..6eb96296 --- /dev/null +++ b/contrib/protocompiler/definitions/service/notification/definition/notification.proto @@ -0,0 +1,66 @@ +import "lib/protocol/attribute.proto"; +import "lib/protocol/entity.proto"; +import "lib/rpc/rpc.proto"; + +package bnet.protocol.notification; + +option cc_generic_services = false; + +message Notification +{ + optional .bnet.protocol.EntityId sender_id = 1; + optional .bnet.protocol.EntityId sender_game_account = 2; + required .bnet.protocol.EntityId target_id = 3; + required string type = 4; + repeated .bnet.protocol.attribute.Attribute attribute = 5; +} + +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; + } +} + diff --git a/contrib/protocompiler/definitions/service/presence/definition/presence.proto b/contrib/protocompiler/definitions/service/presence/definition/presence.proto new file mode 100644 index 00000000..78c575b2 --- /dev/null +++ b/contrib/protocompiler/definitions/service/presence/definition/presence.proto @@ -0,0 +1,73 @@ +import "lib/protocol/attribute.proto"; +import "lib/protocol/entity.proto"; +import "lib/rpc/rpc.proto"; +import "service/presence/definition/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 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; + } +} + diff --git a/contrib/protocompiler/definitions/service/presence/definition/presence_types.proto b/contrib/protocompiler/definitions/service/presence/definition/presence_types.proto new file mode 100644 index 00000000..25e54231 --- /dev/null +++ b/contrib/protocompiler/definitions/service/presence/definition/presence_types.proto @@ -0,0 +1,43 @@ +import "lib/protocol/attribute.proto"; +import "lib/protocol/entity.proto"; +import "service/channel/definition/channel_types.proto"; + +package bnet.protocol.presence; + +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/service/resources/definition/resources.proto b/contrib/protocompiler/definitions/service/resources/definition/resources.proto new file mode 100644 index 00000000..11b45153 --- /dev/null +++ b/contrib/protocompiler/definitions/service/resources/definition/resources.proto @@ -0,0 +1,22 @@ +import "lib/protocol/content_handle.proto"; +import "lib/rpc/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/service/search/definition/search.proto b/contrib/protocompiler/definitions/service/search/definition/search.proto new file mode 100644 index 00000000..d42d0235 --- /dev/null +++ b/contrib/protocompiler/definitions/service/search/definition/search.proto @@ -0,0 +1,64 @@ +import "lib/rpc/rpc.proto"; +import "service/search/definition/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 = 1; + repeated .bnet.protocol.search.Object objects = 2; +} + +message SetObjectRequest +{ + repeated .bnet.protocol.search.Object objects = 1; +} + +message RemoveObjectsRequest +{ + required bytes start_id = 1; + required bytes end_id = 2; +} + +message SearchConfig +{ +} + +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/service/search/definition/search_types.proto b/contrib/protocompiler/definitions/service/search/definition/search_types.proto new file mode 100644 index 00000000..12e08832 --- /dev/null +++ b/contrib/protocompiler/definitions/service/search/definition/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/service/server_pool/definition/server_pool.proto b/contrib/protocompiler/definitions/service/server_pool/definition/server_pool.proto new file mode 100644 index 00000000..bf67507c --- /dev/null +++ b/contrib/protocompiler/definitions/service/server_pool/definition/server_pool.proto @@ -0,0 +1,44 @@ +import "lib/protocol/attribute.proto"; +import "lib/rpc/rpc.proto"; + +package bnet.protocol.server_pool; + +option cc_generic_services = false; + +message GetLoadRequest +{ +} + +message ServerState +{ + optional float current_load = 1 [default = 1]; + optional int32 game_count = 2 [default = 0]; + optional int32 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/service/storage/definition/storage.proto b/contrib/protocompiler/definitions/service/storage/definition/storage.proto new file mode 100644 index 00000000..d905fc2a --- /dev/null +++ b/contrib/protocompiler/definitions/service/storage/definition/storage.proto @@ -0,0 +1,213 @@ +import "lib/protocol/descriptor.proto"; +import "lib/protocol/entity.proto"; +import "lib/rpc/rpc.proto"; + +package bnet.protocol.storage; + +option cc_generic_services = false; + +message TableId +{ + required bytes hash = 1; +} + +message ColumnId +{ + required bytes hash = 1; +} + +message RowId +{ + required bytes hash = 1; +} + +message Privilege +{ + enum Permission + { + OWNER = 1; + FRIEND = 2; + OTHER = 4; + GAME = 8; + ALL = 15; + } + + optional fixed64 bits = 1 [default = 0]; + optional fixed32 program = 2 [default = 0]; +} + +message Predicate +{ + 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; + IS_BETWEEN = 9; + NOT_BETWEEN = 10; + } + + required .bnet.protocol.storage.Predicate.Op op = 1; + required .bnet.protocol.Path field = 2; + repeated sint64 sint_data = 3 [packed=true]; + repeated uint64 uint_data = 4 [packed=true]; + repeated float float_data = 5 [packed=true]; + repeated double double_data = 6 [packed=true]; + repeated bytes bytes_data = 7; +} + +message Command +{ + 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; + COL_COPY = 21; + } + + 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; + } + + required .bnet.protocol.storage.Command.Op op = 1; + optional bytes data = 2; + repeated .bnet.protocol.Path fields = 3; + optional fixed64 min_version = 4; + optional fixed64 max_version = 5; + repeated .bnet.protocol.storage.Predicate predicate = 6; + optional uint32 limit = 7; + optional .bnet.protocol.storage.Command.Cond condition = 8; + optional string message = 11; + optional bool no_data = 12 [default = false]; + optional string using_index = 13; + optional fixed64 input_version = 14; +} + +message Operation +{ + required .bnet.protocol.storage.TableId table_id = 1; + optional .bnet.protocol.storage.ColumnId column_id = 2; + optional .bnet.protocol.storage.RowId row_id = 3; + optional bytes row_key = 4; + optional fixed64 version = 5; + repeated .bnet.protocol.storage.Command rops = 6; + optional fixed64 mutate_version = 7; + optional .bnet.protocol.storage.Privilege privilege = 8; +} + +message Cell +{ + required .bnet.protocol.storage.ColumnId column_id = 1; + required .bnet.protocol.storage.RowId row_id = 2; + optional bytes row_key = 3; + optional fixed64 version = 4; + optional bytes data = 5; +} + +message OperationResult +{ + optional uint32 error_code = 1 [default = 0]; + required .bnet.protocol.storage.TableId table_id = 2; + repeated .bnet.protocol.storage.Cell data = 3; +} + +message OpenTableRequest +{ + optional string schema = 1 [default = "DEFAULT"]; + optional .bnet.protocol.storage.Privilege privilege = 2; + required .bnet.protocol.storage.TableId table_id = 3; + optional .bnet.protocol.EntityId agent_id = 4; + optional string process_name = 5; +} + +message OpenTableResponse +{ +} + +message OpenColumnRequest +{ + optional string schema = 1 [default = "DEFAULT"]; + optional .bnet.protocol.storage.Privilege privilege = 2; + required .bnet.protocol.storage.TableId table_id = 4; + required .bnet.protocol.storage.ColumnId column_id = 5; + optional string proto_type = 6; + optional .bnet.protocol.EntityId agent_id = 7; + optional string process_name = 8; +} + +message OpenColumnResponse +{ + optional bool server_field_ops = 2 [default = false]; +} + +message ExecuteRequest +{ + optional string schema = 1 [default = "DEFAULT"]; + optional .bnet.protocol.storage.Privilege privilege = 2; + optional bool read_only = 3 [default = false]; + optional bool wants_row_key = 4 [default = false]; + optional bool wants_column_name = 5 [default = false]; + optional uint32 max_data_size = 6 [default = 16777215]; + repeated .bnet.protocol.storage.Operation operations = 7; + optional uint32 timeout = 12; + optional .bnet.protocol.EntityId agent_id = 9; + optional string query_name = 10 [default = "NoName"]; + optional string process_name = 11; +} + +message ExecuteResponse +{ + optional uint32 error_code = 1 [default = 0]; + repeated .bnet.protocol.storage.OperationResult results = 2; + optional string error_message = 3; +} + +service StorageService +{ + rpc Execute(.bnet.protocol.storage.ExecuteRequest) returns(.bnet.protocol.storage.ExecuteResponse) + { + option (method_id) = 1; + option (timeout) = 30; + } + rpc OpenTable(.bnet.protocol.storage.OpenTableRequest) returns(.bnet.protocol.storage.OpenTableResponse) + { + option (method_id) = 2; + } + rpc OpenColumn(.bnet.protocol.storage.OpenColumnRequest) returns(.bnet.protocol.storage.OpenColumnResponse) + { + option (method_id) = 3; + } +} + diff --git a/contrib/protocompiler/definitions/service/toon/definition/toon.proto b/contrib/protocompiler/definitions/service/toon/definition/toon.proto new file mode 100644 index 00000000..3d2c19b1 --- /dev/null +++ b/contrib/protocompiler/definitions/service/toon/definition/toon.proto @@ -0,0 +1,47 @@ +import "lib/rpc/rpc.proto"; +import "lib/protocol/entity.proto"; + +package bnet.protocol.toon; + +option cc_generic_services = false; + +message ToonHandle +{ + required fixed64 id = 1; + required fixed32 program = 2; + required uint32 region = 3; + required uint32 realm = 4; +} + +message ToonName +{ + required string full_name = 1; +} + +message ToonInfo +{ + required .bnet.protocol.toon.ToonName name = 1; +} + +message CreateToonEntityRequest +{ + required uint32 realm = 1; + required .bnet.protocol.EntityId game_account_id = 2; + required uint32 token = 3; + required .bnet.protocol.ProcessId original_sender = 4; +} + +message CreateToonEntityResponse +{ + required .bnet.protocol.EntityId toon_id = 1; +} + +message FinalizeToonCreationRequest +{ + required string name = 1; + required .bnet.protocol.EntityId game_account_id = 2; + required .bnet.protocol.EntityId toon_id = 3; + required uint32 token = 4; + required .bnet.protocol.ProcessId original_sender = 5; +} + diff --git a/contrib/protocompiler/definitions/service/toon/definition/toon_external.proto b/contrib/protocompiler/definitions/service/toon/definition/toon_external.proto new file mode 100644 index 00000000..5e3a37a7 --- /dev/null +++ b/contrib/protocompiler/definitions/service/toon/definition/toon_external.proto @@ -0,0 +1,82 @@ +import "lib/rpc/rpc.proto"; +import "lib/protocol/entity.proto"; +import "lib/protocol/attribute.proto"; +import "service/toon/definition/toon.proto"; + +package bnet.protocol.toon.external; + +option cc_generic_services = false; + +message ToonListRequest +{ +} + +message ToonListResponse +{ + repeated .bnet.protocol.EntityId toons = 2; +} + +message SelectToonRequest +{ + required .bnet.protocol.EntityId toon = 1; +} + +message SelectToonResponse +{ +} + +message CreateToonRequest +{ + optional string name = 1; + repeated .bnet.protocol.attribute.Attribute attribute = 2; +} + +message CreateToonResponse +{ + required uint32 token = 1; +} + +message ToonCreatedNotification +{ + optional .bnet.protocol.EntityId toon = 1; + required uint32 token = 2; + required uint32 error_code = 3; +} + +message DeleteToonRequest +{ + required .bnet.protocol.EntityId toon = 1; +} + +message DeleteToonResponse +{ +} + +service ToonServiceExternal +{ + rpc ToonList(.bnet.protocol.toon.external.ToonListRequest) returns(.bnet.protocol.toon.external.ToonListResponse) + { + option (method_id) = 1; + } + rpc SelectToon(.bnet.protocol.toon.external.SelectToonRequest) returns(.bnet.protocol.toon.external.SelectToonResponse) + { + option (method_id) = 2; + } + rpc CreateToon(.bnet.protocol.toon.external.CreateToonRequest) returns(.bnet.protocol.toon.external.CreateToonResponse) + { + option (method_id) = 3; + } + rpc DeleteToon(.bnet.protocol.toon.external.DeleteToonRequest) returns(.bnet.protocol.toon.external.DeleteToonResponse) + { + option (method_id) = 4; + } +} + +service ToonNotifyExternal +{ + rpc NotifyToonCreated(.bnet.protocol.toon.external.ToonCreatedNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 1; + } +} + diff --git a/contrib/protocompiler/definitions/service/user_manager/definition/user_manager.proto b/contrib/protocompiler/definitions/service/user_manager/definition/user_manager.proto new file mode 100644 index 00000000..798aa082 --- /dev/null +++ b/contrib/protocompiler/definitions/service/user_manager/definition/user_manager.proto @@ -0,0 +1,179 @@ +import "lib/protocol/attribute.proto"; +import "lib/protocol/entity.proto"; +import "lib/rpc/rpc.proto"; + +package bnet.protocol.user_manager; + +option cc_generic_services = false; + +message PlayerReport +{ + 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; + } + + required .bnet.protocol.user_manager.PlayerReport.UserComplaintCode complaint_code = 1; + required string complaint_note = 2; +} + +message RecentPlayer +{ + required .bnet.protocol.EntityId player = 1; + optional fixed64 timestamp_played = 2; + repeated .bnet.protocol.attribute.Attribute attributes = 3; +} + +message SubscribeToUserManagerRequest +{ + required uint64 object_id = 1; +} + +message SubscribeToUserManagerResponse +{ + repeated .bnet.protocol.user_manager.RecentPlayer recent_players = 2; + repeated .bnet.protocol.EntityId blocked_toons = 3; + repeated .bnet.protocol.EntityId ignored_inviters = 4; +} + +message ReportToonRequest +{ + enum BlockAction + { + SESSION_BLOCK_GAME_ACCOUNT = 1; + } + + required .bnet.protocol.EntityId target_id = 1; + required .bnet.protocol.user_manager.PlayerReport report = 2; + optional .bnet.protocol.user_manager.ReportToonRequest.BlockAction blocking_action = 3; +} + +message ReportToonResponse +{ + optional .bnet.protocol.EntityId reported_toon = 1; +} + +message AddRecentPlayersRequest +{ + repeated .bnet.protocol.user_manager.RecentPlayer players = 1; +} + +message AddRecentPlayersResponse +{ + repeated .bnet.protocol.user_manager.RecentPlayer players_added = 1; + repeated .bnet.protocol.user_manager.RecentPlayer players_removed = 3; +} + +message RemoveRecentPlayersRequest +{ + repeated .bnet.protocol.user_manager.RecentPlayer players = 2; +} + +message RemoveRecentPlayersResponse +{ + repeated .bnet.protocol.user_manager.RecentPlayer players_removed = 1; +} + +message ReportAccountRequest +{ + required .bnet.protocol.EntityId target_account = 1; + required .bnet.protocol.user_manager.PlayerReport report = 2; +} + +message ReportAccountResponse +{ + optional .bnet.protocol.EntityId reported_account = 1; +} + +message IgnoreInviterRequest +{ + required .bnet.protocol.EntityId target_id = 1; +} + +message UnignoreInvitersRequest +{ + repeated .bnet.protocol.EntityId target_id = 1; +} + +message BlockToonRequest +{ + required .bnet.protocol.EntityId target_id = 1; +} + +message UnblockToonsRequest +{ + repeated .bnet.protocol.EntityId target_id = 1; +} + +message UnblockToonsResponse +{ + repeated .bnet.protocol.EntityId unblocked_toon = 1; +} + +message UnignoreInvitersResponse +{ + repeated .bnet.protocol.EntityId unignored_inviter = 1; +} + +message InviterIgnoredNotification +{ + repeated .bnet.protocol.EntityId 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) = 5; + } + rpc RemoveRecentPlayers(.bnet.protocol.user_manager.RemoveRecentPlayersRequest) returns(.bnet.protocol.user_manager.RemoveRecentPlayersResponse) + { + option (method_id) = 6; + } + rpc ReportToon(.bnet.protocol.user_manager.ReportToonRequest) returns(.bnet.protocol.user_manager.ReportToonResponse) + { + option (method_id) = 7; + } + rpc BlockToon(.bnet.protocol.user_manager.BlockToonRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 8; + } + rpc UnblockToons(.bnet.protocol.user_manager.UnblockToonsRequest) returns(.bnet.protocol.user_manager.UnblockToonsResponse) + { + option (method_id) = 13; + } + rpc ReportAccount(.bnet.protocol.user_manager.ReportAccountRequest) returns(.bnet.protocol.user_manager.ReportAccountResponse) + { + option (method_id) = 10; + } + rpc IgnoreInviter(.bnet.protocol.user_manager.IgnoreInviterRequest) returns(.bnet.protocol.NoData) + { + option (method_id) = 11; + } + rpc UnignoreInviters(.bnet.protocol.user_manager.UnignoreInvitersRequest) returns(.bnet.protocol.user_manager.UnignoreInvitersResponse) + { + option (method_id) = 14; + } +} + +service UserManagerNotify +{ + rpc NotifyInviterIgnored(.bnet.protocol.user_manager.InviterIgnoredNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 3; + } + rpc NotifyInviterUnignored(.bnet.protocol.user_manager.InviterIgnoredNotification) returns(.bnet.protocol.NO_RESPONSE) + { + option (method_id) = 4; + } +} + diff --git a/contrib/protocompiler/generate.bat b/contrib/protocompiler/generate.bat new file mode 100644 index 00000000..b96fb6c4 --- /dev/null +++ b/contrib/protocompiler/generate.bat @@ -0,0 +1,67 @@ +@CHOICE /C:YN /M:"Have you made sure field 'item' in QuestProto.QuestReward has been renamed to 'item_granted'" +@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/ lib\config\process_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/ lib\profanity\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/ lib\protocol\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/ lib\protocol\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/ lib\protocol\descriptor.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/ lib\protocol\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/ lib\protocol\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/ lib\protocol\exchange_object_provider.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/ lib\protocol\exchange_risk.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/ service\exchange\definition\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/ lib\protocol\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/ lib\protocol\resource.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/ lib\rpc\connection.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/ lib\rpc\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/ service\achievements\definition\achievements.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/ service\achievements\definition\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/ service\authentication\definition\authentication.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/ service\challenge\definition\challenge.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/ service\channel\definition\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/ service\channel\definition\channel.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/ service\channel\definition\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/ service\channel_invitation\definition\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/ service\channel_invitation\definition\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/ service\friends\definition\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/ service\friends\definition\friends.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/ service\game_master\definition\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/ service\game_master\definition\game_master.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/ service\game_master\definition\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/ service\game_utilities\definition\game_utilities.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/ service\notification\definition\notification.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/ service\presence\definition\presence.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/ service\presence\definition\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/ service\resources\definition\resources.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/ service\search\definition\search.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/ service\search\definition\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/ service\server_pool\definition\server_pool.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/ service\storage\definition\storage.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/ service\toon\definition\toon.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/ service\toon\definition\toon_external.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/ service\user_manager\definition\user_manager.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/ service\followers\definition\followers.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/ service\chat\definition\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/ 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/ 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 +"../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/ Stats.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/ service\exchange\definition\exchange.proto + +pause + +:end \ No newline at end of file diff --git a/contrib/web/lib/LibMooege.php b/contrib/web/lib/LibMooege.php new file mode 100644 index 00000000..fea97a9f --- /dev/null +++ b/contrib/web/lib/LibMooege.php @@ -0,0 +1,319 @@ +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) + { + if(!$this->connected) + return false; + + try { + $response=$this->accounts->CreateAccount(array('email' => $email, 'password' => $password)); + } + catch(Exception $e) { + return false; + } + + return $response->CreateAccountResult; + } + + /** + * 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..4e40f056 --- /dev/null +++ b/contrib/web/register.php @@ -0,0 +1,74 @@ +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); + + if($created) + echo "Account created successfully!"; + else + echo "Error creating account!"; +} +?> + + +
+ mooege login +
+ E-mail:     
+ Password:
+
+

+
+
+
+ \ 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.Utility + + + + 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. + + + Gets the collection of . + Archives should be added to this list for being searched. + The archive list. + + + Represents an archive in a World of Warcraft installation. + + + Gets the filename of the archive represented by this entry. + + + Gets the kind of archive represented by this entry. + + + Gets the patch number associated with this entry, or zero if there is none. + + + Represents an archive in a World of Warcraft installation. + + + Gets the associated with this entry. + + + Gets the kind of archive represented by this entry. + + + Represents a WoW installation on the machine. + + + Format of the default archive filename. + + + Format of the filename for supplementary archives. + + + Format of the filename for expansion archives. + + + Number of digits for patch MPQ version number. + + + Format of the filename for cataclysm patch archives. + + + Start index of the version number for global patches. + + + Format of the filename for cataclysm patch archives. + + + Start index of the version number for base patches. + + + Array of expected archive names. + + Those names are highly related with the version of WoW supported. + Archives listed here are for the old WoW instalaltion type. (Pre-Cataclysm) + + + + Array of expected archive names. + + Those names are highly related with the version of WoW supported. + Archives listes here are the new cataclysm archives. + + + + + Path to the instalaltion. + + + Path to the data associated with the instalaltion. + + + Array of archives associated with the instalaltion. + The archives are detected based on their filename, during the instantiation of the class. + + + Collection of archives associated with the instalaltion. + This is a wrapper around . + + + Array of associated with the installation. + + + Collection of associated with the installation. + This is a wrapper around . + + + Value representing the instllation kind. + + + Initializes a new instance of the class. + The installation path. + does not exist, or does not contain a directory named Data. + At least one of the required archives has not been found in the specified directory. + + + Tries to locate the standard WoW installation. + A instance representing the standard WoW installation, if found. + + + Finds the archives associated with this . + This implementation will find archives for the new Cataclysm instlaltions, not the old ones. + + + Finds the archives associated with this . + This implementation will find archives for the old pre-Cataclysm WoW installations. + + + Finds the s associated with this . + Each itself contains another list of archives. + + + Creates a MpqFileSystem using the specified language pack. + The language pack. + if set to true the list files will be parsed. + The newly created MpqFileSystem. + + + Creates a MpqFileSystem using the specified language pack. + The language pack. + if set to true the culture checks will be enforced. + if set to true the list files will be parsed. + The newly created MpqFileSystem. + + + Gets the path of this WoW installation. + + + Gets the path to the data associated with the installation. + + + Gets a collection of language packs associated with the installation. + + + Gets a collection of string containing the names of the archives detected as part of the installation. + + + Gets a value representing the installation kind. + This value is useful to differenciate classic installations from newer installations (Cataclysm or newer). + The kind of the installation. + + + Represents a collection of associated with a . + + + Determines the index of a specific item in the . + The object to locate in the . + The index of if found in the list; otherwise, -1. + + + Determines whether the contains a specific value. + The object to locate in the . + true if is found in the ; otherwise, false. + + + Copies the elements of the to an , starting at a particular index. + The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. + The zero-based index in at which copying begins. + + is null. + + + is less than 0. + + + is multidimensional. + -or- + is equal to or greater than the length of . + -or- + The number of elements in the source is greater than the available space from to the end of the destination . + + + + Returns an enumerator that iterates through the collection. + A that can be used to iterate through the collection. + + + Gets or sets the at the specified index. + + + + Gets the number of elements contained in the . + The number of elements contained in the . + + + Gets a value indicating whether this instance is read only. + will always be read-only. + true if this instance is read only; otherwise, false. + + + 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. + + + Gets the collection of . + The archive list. + + + + Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. + + + + + Retourne l'instance ResourceManager mise en cache utilisée par cette classe. + + + + + Remplace la propriété CurrentUICulture du thread actuel pour toutes + les recherches de ressources à l'aide de cette classe de ressource fortement typée. + + + + + Recherche une chaîne localisée semblable à The culture {0}({1}) is currently not supported.. + + + + Represents a language pack in a . + + + Format of the filename for cataclysm patch archives. + + + Start index of the version number for patches. + + + Number of digits for patch MPQ version number. + + + Returns a that represents this instance. + A that represents this instance. + + + Gets the containing this language pack. + The containing this instance. + + + Gets the culture associated with this language pack. + The culture associated with this instance. + + + Gets the path of this language pack. + The path of this language pack. + + + Gets the collection of archives for this language pack. + The collection of archives for this language pack. + + + Gets the index of the localized database field. + + In first versions of World of Warcraft, the client databases contained special localized strings spanning multiple fields. + One index was assigned to each of the supported cultures, allowing to fetch the localized string. + Usually, all localization fields were blank excepted for the one corresponding to the language pack culture. + + The index of the localized database field. + + + Represents the kind of installation. + + + The installation is a classic World of Warcraft installation. + + + The installation is a World of Warcraft installation from Cataclysm or newer. + + + This exception is thrown when a culture is not supported. + Refer to the field for information on the unsupported culture. + + + Initializes a new instance of the class. + The unsupported culture. + + + Initializes a new instance of the class. + The unsupported culture. + The inner exception. + + + Gets the unsupported culture. + The unsupported culture. + + + diff --git a/dep/crystalmpq/CrystalMpq.dll b/dep/crystalmpq/CrystalMpq.dll new file mode 100644 index 00000000..eb9178d6 Binary files /dev/null and b/dep/crystalmpq/CrystalMpq.dll differ diff --git a/dep/crystalmpq/CrystalMpq.xml b/dep/crystalmpq/CrystalMpq.xml new file mode 100644 index 00000000..6e072a24 --- /dev/null +++ b/dep/crystalmpq/CrystalMpq.xml @@ -0,0 +1,483 @@ + + + + CrystalMpq + + + + Exposes with the data contained in an . + + + + Thrown when the seed for a file is unknown. + + + The seed is needed for reading encrypted files. + + + + + Base class for CrystalMpq specific exceptions + + + + + Creates a new instance of the MPQException class. + + + + + + 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. + + + + Thrown when a compression is not handled by the library. + + + + Exception thrown when a non-existant block is referenced. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class BitBuffer + + Array of bit containing the data + Position of data in the array + Size of data in the array + + + + This class represents a file in a MPQArchive + + + + 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. + + + 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 unknown. + + + 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 the LCID associated with this file. + + + Gets the index of the file in the collection. + In the current impelmentation, this index is also the index of the file in the archive's block table. + + + Gets a value indicating whether this file is compressed. + + + 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. + + + + Thrown when the archive appears to be corrupt. + + + It might happen that this error is thrown on a perfectly valid archive. + If that's the case, please inform the author of this. + + + + + Initializes a new instance of the class. + + + + + 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. + + + + Thrown when the provided stream does not contain a valid MPQ archive + + + + 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. + + + + Exception thrown when the MPQ version is not recognized by the library. + + + + + Initializes a new instance of the class. + + + + 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. + + + + 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 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 listfile will be parsed if present. + The MPQ archive's filename. + + + Initializes a new instance of the class. + The MPQ archive's filename. + Determines if the listfile will be parsed. + + + Initializes a new instance of the class. + The listfile will be parsed if present. + A containing the MPQ archive. + + + Initializes a new instance of the class. + A containing the MPQ archive. + Determines if the listfile will be parsed. + + + 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 + + + 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. + 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. + + + 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. + + + 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. + + + 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. + + + + 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 a flag indicating the format of the archive. + + + 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. + + + 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/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..187cadba --- /dev/null +++ b/dep/openssl/ManagedOpenSsl.XML @@ -0,0 +1,4882 @@ + + + + ManagedOpenSsl + + + + + Encapsulates the X509_NAME_* functions + + + + + Helper base class that handles the AddRef() method by using a _dup() method. + + + + + 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. + + + + + Derived classes must use a _dup() method to make a copy of the underlying native data structure. + + + + + + The Stack class can only contain objects marked with this interface. + + + + + 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 + + + + + + + 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 + + + + + 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 + + + + + Override to implement client/server specific handshake processing + + + + + + Renegotiate session keys - calls SSL_renegotiate + + + + + Calls SSL_new() + + + + + + Calls SSL_free() + + + + + 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 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 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. + + + + + Contains the set of elements that make up a Version. + + + + + 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() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SSL_FILETYPE_PEM + + + + + SSL_FILETYPE_ASN1 + + + + + Options enumeration for Options property + + + + + 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 X509 object + + + + + Implements the CopyRef() method + + + + + + 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 + + + + + + + + + + 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 + + + + + Wraps PKCS7 + + + + + Calls d2i_PKCS7_bio() + + + + + + + Calls PEM_read_bio_PKCS7() + + + + + + + Calls PKCS7_free() + + + + + Extracts the X509Chain of certifcates from the internal PKCS7 structure + + + + + 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 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 + + + + + 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 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + 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() + + + + + 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. + + + + + 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. + + + + + 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. + + + + + 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 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 + + + + + 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 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() + + + + + 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() + + + + + 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 + + + + + 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 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() + + + + + 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 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() + + + + + 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 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 + + + + diff --git a/dep/openssl/ManagedOpenSsl.dll b/dep/openssl/ManagedOpenSsl.dll new file mode 100644 index 00000000..06ca569c 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..35a9448d 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/.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..1d54da9d --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/Native.cs @@ -0,0 +1,2247 @@ +// 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); + + #endregion + + #region Initialization + static Native() + { + Version lib = Version.Library; + Version wrapper = Version.Wrapper; + uint mmf = lib.Raw & 0xfffff000; + 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)] + public extern static string SSLeay_version(int type); + + [DllImport(DLLNAME)] + public extern static uint SSLeay(); + + [DllImport(DLLNAME)] + public extern static string BN_options(); + + [DllImport(DLLNAME)] + public extern static string MD2_options(); + + [DllImport(DLLNAME)] + public extern static string RC4_options(); + + [DllImport(DLLNAME)] + public extern static string DES_options(); + + [DllImport(DLLNAME)] + public extern static string idea_options(); + + [DllImport(DLLNAME)] + 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)] + public extern static void CRYPTO_set_id_callback(CRYPTO_id_callback cb); + + [DllImport(DLLNAME)] + public extern static void CRYPTO_set_locking_callback(CRYPTO_locking_callback cb); + + [DllImport(DLLNAME)] + public extern static int CRYPTO_num_locks(); + + [DllImport(DLLNAME)] + 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)] + public extern static void OPENSSL_add_all_algorithms_noconf(); + + [DllImport(DLLNAME)] + 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)] + public extern static void CRYPTO_free(IntPtr p); + + [DllImport(DLLNAME)] + public extern static IntPtr CRYPTO_malloc(int num, string file, int line); + + [DllImport(DLLNAME)] + 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)] + public extern static void CRYPTO_dbg_malloc(IntPtr addr, int num, IntPtr file, int line, int before_p); + + [DllImport(DLLNAME)] + public extern static void CRYPTO_dbg_realloc(IntPtr addr1, IntPtr addr2, int num, IntPtr file, int line, int before_p); + + [DllImport(DLLNAME)] + public extern static void CRYPTO_dbg_free(IntPtr addr, int before_p); + + [DllImport(DLLNAME)] + public extern static void CRYPTO_dbg_set_options(int bits); + + [DllImport(DLLNAME)] + public extern static int CRYPTO_dbg_get_options(); + + [DllImport(DLLNAME)] + public extern static int CRYPTO_set_mem_debug_functions( + MallocFunctionPtr m, + ReallocFunctionPtr r, + FreeFunctionPtr f, + SetOptionsFunctionPtr so, + GetOptionsFunctionPtr go); + + [DllImport(DLLNAME)] + public extern static int CRYPTO_mem_ctrl(int mode); + + [DllImport(DLLNAME)] + public extern static void CRYPTO_cleanup_all_ex_data(); + + [DllImport(DLLNAME)] + public extern static void CRYPTO_mem_leaks(IntPtr bio); + + [DllImport(DLLNAME)] + 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)] + public extern static void OBJ_NAME_do_all(int type, ObjectNameHandler fn, IntPtr arg); + + [DllImport(DLLNAME)] + public extern static void OBJ_NAME_do_all_sorted(int type, ObjectNameHandler fn, IntPtr arg); + + [DllImport(DLLNAME)] + public extern static int OBJ_txt2nid(string s); + + [DllImport(DLLNAME)] + public extern static IntPtr OBJ_nid2obj(int n); + + [DllImport(DLLNAME)] + public extern static IntPtr OBJ_nid2ln(int n); + + [DllImport(DLLNAME)] + public extern static IntPtr OBJ_nid2sn(int n); + + [DllImport(DLLNAME)] + public extern static int OBJ_obj2nid(IntPtr o); + + [DllImport(DLLNAME)] + public extern static IntPtr OBJ_txt2obj(byte[] s, int no_name); + + [DllImport(DLLNAME)] + public extern static int OBJ_ln2nid(byte[] s); + + [DllImport(DLLNAME)] + public extern static int OBJ_sn2nid(byte[] s); + #endregion + + #region stack + [DllImport(DLLNAME)] + public extern static IntPtr sk_new_null(); + + [DllImport(DLLNAME)] + public extern static int sk_num(IntPtr stack); + + [DllImport(DLLNAME)] + public extern static int sk_find(IntPtr stack, IntPtr data); + + [DllImport(DLLNAME)] + public extern static int sk_insert(IntPtr stack, IntPtr data, int where); + + [DllImport(DLLNAME)] + public extern static IntPtr sk_shift(IntPtr stack); + + [DllImport(DLLNAME)] + public extern static int sk_unshift(IntPtr stack, IntPtr data); + + [DllImport(DLLNAME)] + public extern static int sk_push(IntPtr stack, IntPtr data); + + [DllImport(DLLNAME)] + public extern static IntPtr sk_pop(IntPtr stack); + + [DllImport(DLLNAME)] + public extern static IntPtr sk_delete(IntPtr stack, int loc); + + [DllImport(DLLNAME)] + public extern static IntPtr sk_delete_ptr(IntPtr stack, IntPtr p); + + [DllImport(DLLNAME)] + public extern static IntPtr sk_value(IntPtr stack, int index); + + [DllImport(DLLNAME)] + public extern static IntPtr sk_set(IntPtr stack, int index, IntPtr data); + + [DllImport(DLLNAME)] + public extern static IntPtr sk_dup(IntPtr stack); + + [DllImport(DLLNAME)] + public extern static void sk_zero(IntPtr stack); + + [DllImport(DLLNAME)] + public extern static void sk_free(IntPtr stack); + + #endregion + + #region SHA + public const int SHA_DIGEST_LENGTH = 20; + #endregion + + #region ASN1 + [DllImport(DLLNAME)] + public extern static IntPtr ASN1_INTEGER_new(); + + [DllImport(DLLNAME)] + public extern static void ASN1_INTEGER_free(IntPtr x); + + [DllImport(DLLNAME)] + public extern static int ASN1_INTEGER_set(IntPtr a, int v); + + [DllImport(DLLNAME)] + public extern static int ASN1_INTEGER_get(IntPtr a); + + [DllImport(DLLNAME)] + public extern static IntPtr ASN1_TIME_set(IntPtr s, long t); + + [DllImport(DLLNAME)] + public extern static int ASN1_UTCTIME_print(IntPtr bp, IntPtr a); + + [DllImport(DLLNAME)] + public extern static IntPtr ASN1_TIME_new(); + + [DllImport(DLLNAME)] + public extern static void ASN1_TIME_free(IntPtr x); + + public const int V_ASN1_OCTET_STRING = 4; + + [DllImport(DLLNAME)] + public extern static IntPtr ASN1_STRING_type_new(int type); + + [DllImport(DLLNAME)] + public extern static IntPtr ASN1_STRING_dup(IntPtr a); + + [DllImport(DLLNAME)] + public extern static void ASN1_STRING_free(IntPtr a); + + [DllImport(DLLNAME)] + public extern static int ASN1_STRING_cmp(IntPtr a, IntPtr b); + + [DllImport(DLLNAME)] + public extern static int ASN1_STRING_set(IntPtr str, byte[] data, int len); + + [DllImport(DLLNAME)] + public extern static IntPtr ASN1_STRING_data(IntPtr x); + + [DllImport(DLLNAME)] + public extern static int ASN1_STRING_length(IntPtr x); + + [DllImport(DLLNAME)] + public extern static void ASN1_OBJECT_free(IntPtr obj); + + #endregion + + #region X509_REQ + [DllImport(DLLNAME)] + public extern static IntPtr X509_REQ_new(); + + [DllImport(DLLNAME)] + public extern static int X509_REQ_set_version(IntPtr x, int version); + + [DllImport(DLLNAME)] + public extern static int X509_REQ_set_pubkey(IntPtr x, IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_REQ_get_pubkey(IntPtr req); + + [DllImport(DLLNAME)] + public extern static int X509_REQ_set_subject_name(IntPtr x, IntPtr name); + + [DllImport(DLLNAME)] + public extern static int X509_REQ_sign(IntPtr x, IntPtr pkey, IntPtr md); + + [DllImport(DLLNAME)] + public extern static int X509_REQ_verify(IntPtr x, IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static int X509_REQ_digest(IntPtr data, IntPtr type, byte[] md, ref uint len); + + [DllImport(DLLNAME)] + public extern static void X509_REQ_free(IntPtr a); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_REQ_to_X509(IntPtr r, int days, IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static int X509_REQ_print_ex(IntPtr bp, IntPtr x, uint nmflag, uint cflag); + + [DllImport(DLLNAME)] + public extern static int X509_REQ_print(IntPtr bp, IntPtr x); + #endregion + + #region X509 + [DllImport(DLLNAME)] + public extern static IntPtr X509_new(); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_dup(IntPtr x509); + + [DllImport(DLLNAME)] + public extern static int X509_cmp(IntPtr a, IntPtr b); + + [DllImport(DLLNAME)] + public extern static int X509_sign(IntPtr x, IntPtr pkey, IntPtr md); + + [DllImport(DLLNAME)] + public extern static int X509_check_private_key(IntPtr x509, IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static int X509_verify(IntPtr x, IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static int X509_pubkey_digest(IntPtr data, IntPtr type, byte[] md, ref uint len); + + [DllImport(DLLNAME)] + public extern static int X509_digest(IntPtr data, IntPtr type, byte[] md, ref uint len); + + [DllImport(DLLNAME)] + public extern static int X509_set_version(IntPtr x, int version); + + [DllImport(DLLNAME)] + public extern static int X509_set_serialNumber(IntPtr x, IntPtr serial); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_get_serialNumber(IntPtr x); + + [DllImport(DLLNAME)] + public extern static int X509_set_issuer_name(IntPtr x, IntPtr name); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_get_issuer_name(IntPtr a); + + [DllImport(DLLNAME)] + public extern static int X509_set_subject_name(IntPtr x, IntPtr name); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_get_subject_name(IntPtr a); + + [DllImport(DLLNAME)] + public extern static int X509_set_notBefore(IntPtr x, IntPtr tm); + + [DllImport(DLLNAME)] + public extern static int X509_set_notAfter(IntPtr x, IntPtr tm); + + [DllImport(DLLNAME)] + public extern static int X509_set_pubkey(IntPtr x, IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_get_pubkey(IntPtr x); + + [DllImport(DLLNAME)] + public extern static void X509_free(IntPtr x); + + [DllImport(DLLNAME)] + public extern static int X509_verify_cert(IntPtr ctx); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_verify_cert_error_string(int n); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_to_X509_REQ(IntPtr x, IntPtr pkey, IntPtr md); + + [DllImport(DLLNAME)] + public extern static int X509_print_ex(IntPtr bp, IntPtr x, uint nmflag, uint cflag); + + [DllImport(DLLNAME)] + public extern static int X509_print(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_find_by_issuer_and_serial(IntPtr sk, IntPtr name, IntPtr serial); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_find_by_subject(IntPtr sk, IntPtr name); + + [DllImport(DLLNAME)] + public extern static int X509_check_trust(IntPtr x, int id, int flags); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_time_adj(IntPtr s, int adj, ref long t); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_gmtime_adj(IntPtr s, int adj); + + [DllImport(DLLNAME)] + public extern static IntPtr d2i_X509_bio(IntPtr bp, ref IntPtr x509); + + [DllImport(DLLNAME)] + public extern static int i2d_X509_bio(IntPtr bp, IntPtr x509); + + [DllImport(DLLNAME)] + public extern static void X509_PUBKEY_free(IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static void X509_OBJECT_up_ref_count(IntPtr a); + + [DllImport(DLLNAME)] + public extern static void X509_OBJECT_free_contents(IntPtr a); + + #endregion + + #region X509_EXTENSION + [DllImport(DLLNAME)] + public extern static IntPtr X509_EXTENSION_new(); + + [DllImport(DLLNAME)] + public extern static void X509_EXTENSION_free(IntPtr x); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_EXTENSION_dup(IntPtr ex); + + [DllImport(DLLNAME)] + public extern static int X509V3_EXT_print(IntPtr bio, IntPtr ext, uint flag, int indent); + + [DllImport(DLLNAME)] + public extern static IntPtr X509V3_EXT_get_nid(int nid); + + [DllImport(DLLNAME)] + public extern static int X509_add_ext(IntPtr x, IntPtr ex, int loc); + + [DllImport(DLLNAME)] + 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)] + 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)] + 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)] + 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)] + public extern static int X509_EXTENSION_set_data(IntPtr ex, IntPtr data); + + //ASN1_OBJECT* X509_EXTENSION_get_object(X509_EXTENSION* ex); + [DllImport(DLLNAME)] + public extern static IntPtr X509_EXTENSION_get_object(IntPtr ex); + + //ASN1_OCTET_STRING* X509_EXTENSION_get_data(X509_EXTENSION* ne); + [DllImport(DLLNAME)] + public extern static IntPtr X509_EXTENSION_get_data(IntPtr ne); + + //int X509_EXTENSION_get_critical(X509_EXTENSION* ex); + [DllImport(DLLNAME)] + public extern static int X509_EXTENSION_get_critical(IntPtr ex); + + #endregion + + #region X509_STORE + [DllImport(DLLNAME)] + public extern static IntPtr X509_STORE_new(); + + [DllImport(DLLNAME)] + public extern static int X509_STORE_add_cert(IntPtr ctx, IntPtr x); + + //[DllImport(DLLNAME)] + //void X509_STORE_set_flags(); + + [DllImport(DLLNAME)] + public extern static void X509_STORE_free(IntPtr x); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_STORE_CTX_new(); + + [DllImport(DLLNAME)] + public extern static int X509_STORE_CTX_init(IntPtr ctx, IntPtr store, IntPtr x509, IntPtr chain); + + [DllImport(DLLNAME)] + public extern static void X509_STORE_CTX_free(IntPtr x); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_STORE_CTX_get_current_cert(IntPtr x509_store_ctx); + + [DllImport(DLLNAME)] + public extern static int X509_STORE_CTX_get_error_depth(IntPtr x509_store_ctx); + + [DllImport(DLLNAME)] + public extern static int X509_STORE_CTX_get_error(IntPtr x509_store_ctx); + + [DllImport(DLLNAME)] + public extern static void X509_STORE_CTX_set_error(IntPtr x509_store_ctx, int error); + + #endregion + + #region X509_INFO + [DllImport(DLLNAME)] + 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)] + public extern static IntPtr X509_NAME_new(); + + [DllImport(DLLNAME)] + public extern static void X509_NAME_free(IntPtr a); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_NAME_dup(IntPtr xn); + + [DllImport(DLLNAME)] + public extern static int X509_NAME_cmp(IntPtr a, IntPtr b); + + [DllImport(DLLNAME)] + public extern static int X509_NAME_entry_count(IntPtr name); + + [DllImport(DLLNAME)] + 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)] + 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)] + public extern static int X509_NAME_get_text_by_NID(IntPtr name, int nid, byte[] buf, int len); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_NAME_get_entry(IntPtr name, int loc); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_NAME_delete_entry(IntPtr name, int loc); + + [DllImport(DLLNAME)] + public extern static int X509_NAME_get_index_by_NID(IntPtr name, int nid, int lastpos); + + [DllImport(DLLNAME)] + public extern static int X509_NAME_digest(IntPtr data, IntPtr type, byte[] md, ref uint len); + + [DllImport(DLLNAME)] + public extern static IntPtr X509_NAME_oneline(IntPtr a, byte[] buf, int size); + + [DllImport(DLLNAME)] + public extern static int X509_NAME_print(IntPtr bp, IntPtr name, int obase); + + [DllImport(DLLNAME)] + public extern static int X509_NAME_print_ex(IntPtr bp, IntPtr nm, int indent, uint flags); + #endregion + + #region RAND + + [DllImport(DLLNAME)] + public extern static void RAND_cleanup(); + + [DllImport(DLLNAME)] + public extern static void RAND_seed(byte[] buf, int len); + + [DllImport(DLLNAME)] + public extern static int RAND_pseudo_bytes(byte[] buf, int len); + + [DllImport(DLLNAME)] + public extern static int RAND_bytes(byte[] buf, int num); + + [DllImport(DLLNAME)] + public extern static void RAND_add(byte[] buf, int num, double entropy); + + [DllImport(DLLNAME)] + public extern static int RAND_load_file(string file, int max_bytes); + + [DllImport(DLLNAME)] + public extern static int RAND_write_file(string file); + + [DllImport(DLLNAME)] + public extern static string RAND_file_name(byte[] buf, uint num); + + [DllImport(DLLNAME)] + public extern static int RAND_status(); + + [DllImport(DLLNAME)] + public extern static int RAND_query_egd_bytes(string path, byte[] buf, int bytes); + + [DllImport(DLLNAME)] + public extern static int RAND_egd(string path); + + [DllImport(DLLNAME)] + public extern static int RAND_egd_bytes(string path, int bytes); + + [DllImport(DLLNAME)] + public extern static int RAND_poll(); + + [DllImport(DLLNAME)] + public extern static int BN_rand(IntPtr rnd, int bits, int top, int bottom); + + [DllImport(DLLNAME)] + public extern static int BN_pseudo_rand(IntPtr rnd, int bits, int top, int bottom); + + [DllImport(DLLNAME)] + public extern static int BN_rand_range(IntPtr rnd, IntPtr range); + + [DllImport(DLLNAME)] + public extern static int BN_pseudo_rand_range(IntPtr rnd, IntPtr range); + #endregion + + #region DSA + //[DllImport(DLLNAME)] + //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)] + 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)] + public extern static int DSA_generate_key(IntPtr dsa); + + [DllImport(DLLNAME)] + public extern static IntPtr DSA_new(); + + [DllImport(DLLNAME)] + public extern static void DSA_free(IntPtr dsa); + + [DllImport(DLLNAME)] + public extern static int DSA_size(IntPtr dsa); + + [DllImport(DLLNAME)] + public extern static int DSAparams_print(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME)] + public extern static int DSA_print(IntPtr bp, IntPtr x, int off); + + [DllImport(DLLNAME)] + public extern static int DSA_sign(int type, byte[] dgst, int dlen, byte[] sig, out uint siglen, IntPtr dsa); + + [DllImport(DLLNAME)] + public extern static int DSA_verify(int type, byte[] dgst, int dgst_len, byte[] sigbuf, int siglen, IntPtr dsa); + #endregion + + #region RSA + [DllImport(DLLNAME)] + public extern static IntPtr RSA_new(); + + [DllImport(DLLNAME)] + public extern static void RSA_free(IntPtr rsa); + + [DllImport(DLLNAME)] + public extern static int RSA_size(IntPtr rsa); + + [DllImport(DLLNAME)] + public extern static int RSA_generate_key_ex(IntPtr rsa, int bits, IntPtr e, bn_gencb_st cb); + + [DllImport(DLLNAME)] + public extern static int RSA_check_key(IntPtr rsa); + + [DllImport(DLLNAME)] + public extern static int RSA_public_encrypt(int flen, byte[] from, byte[] to, IntPtr rsa, int padding); + + [DllImport(DLLNAME)] + public extern static int RSA_private_encrypt(int flen, byte[] from, byte[] to, IntPtr rsa, int padding); + + [DllImport(DLLNAME)] + public extern static int RSA_public_decrypt(int flen, byte[] from, byte[] to, IntPtr rsa, int padding); + + [DllImport(DLLNAME)] + public extern static int RSA_private_decrypt(int flen, byte[] from, byte[] to, IntPtr rsa, int padding); + + [DllImport(DLLNAME)] + public extern static int RSA_sign(int type, byte[] m, uint m_length, byte[] sigret, out uint siglen, IntPtr rsa); + + [DllImport(DLLNAME)] + public extern static int RSA_verify(int type, byte[] m, uint m_length, byte[] sigbuf, uint siglen, IntPtr rsa); + + [DllImport(DLLNAME)] + public extern static int RSA_print(IntPtr bp, IntPtr r, int offset); + #endregion + + #region DH + [DllImport(DLLNAME)] + public extern static IntPtr DH_generate_parameters(int prime_len, int generator, IntPtr callback, IntPtr cb_arg); + + [DllImport(DLLNAME)] + public extern static int DH_generate_parameters_ex(IntPtr dh, int prime_len, int generator, bn_gencb_st cb); + + [DllImport(DLLNAME)] + public extern static int DH_generate_key(IntPtr dh); + + [DllImport(DLLNAME)] + public extern static int DH_compute_key(byte[] key, IntPtr pub_key, IntPtr dh); + + [DllImport(DLLNAME)] + public extern static IntPtr DH_new(); + + [DllImport(DLLNAME)] + public extern static void DH_free(IntPtr dh); + + [DllImport(DLLNAME)] + public extern static int DH_check(IntPtr dh, out int codes); + + [DllImport(DLLNAME)] + public extern static int DHparams_print(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME)] + public extern static int DH_size(IntPtr dh); + + #endregion + + #region BIGNUM + [DllImport(DLLNAME)] + public extern static IntPtr BN_value_one(); + [DllImport(DLLNAME)] + public extern static IntPtr BN_new(); + [DllImport(DLLNAME)] + public extern static void BN_free(IntPtr a); + [DllImport(DLLNAME)] + public extern static void BN_init(IntPtr a); + [DllImport(DLLNAME)] + public extern static IntPtr BN_bin2bn(byte[] s, int len, IntPtr ret); + [DllImport(DLLNAME)] + public extern static int BN_bn2bin(IntPtr a, byte[] to); + [DllImport(DLLNAME)] + public extern static void BN_clear_free(IntPtr a); + [DllImport(DLLNAME)] + public extern static void BN_clear(IntPtr a); + [DllImport(DLLNAME)] + public extern static IntPtr BN_dup(IntPtr a); + [DllImport(DLLNAME)] + public extern static IntPtr BN_copy(IntPtr a, IntPtr b); + [DllImport(DLLNAME)] + public extern static void BN_swap(IntPtr a, IntPtr b); + [DllImport(DLLNAME)] + public extern static int BN_cmp(IntPtr a, IntPtr b); + [DllImport(DLLNAME)] + public extern static int BN_sub(IntPtr r, IntPtr a, IntPtr b); + [DllImport(DLLNAME)] + public extern static int BN_add(IntPtr r, IntPtr a, IntPtr b); + [DllImport(DLLNAME)] + public extern static int BN_mul(IntPtr r, IntPtr a, IntPtr b, IntPtr ctx); + [DllImport(DLLNAME)] + public extern static int BN_num_bits(IntPtr a); + [DllImport(DLLNAME)] + public extern static int BN_sqr(IntPtr r, IntPtr a, IntPtr ctx); + [DllImport(DLLNAME)] + public extern static int BN_div(IntPtr dv, IntPtr rem, IntPtr m, IntPtr d, IntPtr ctx); + [DllImport(DLLNAME)] + public extern static int BN_print(IntPtr fp, IntPtr a); + [DllImport(DLLNAME)] + public extern static IntPtr BN_bn2hex(IntPtr a); + [DllImport(DLLNAME)] + public extern static IntPtr BN_bn2dec(IntPtr a); + [DllImport(DLLNAME)] + public extern static int BN_hex2bn(out IntPtr a, byte[] str); + [DllImport(DLLNAME)] + public extern static int BN_dec2bn(out IntPtr a, byte[] str); + [DllImport(DLLNAME)] + public extern static uint BN_mod_word(IntPtr a, uint w); + [DllImport(DLLNAME)] + public extern static uint BN_div_word(IntPtr a, uint w); + [DllImport(DLLNAME)] + public extern static int BN_mul_word(IntPtr a, uint w); + [DllImport(DLLNAME)] + public extern static int BN_add_word(IntPtr a, uint w); + [DllImport(DLLNAME)] + public extern static int BN_sub_word(IntPtr a, uint w); + [DllImport(DLLNAME)] + public extern static int BN_set_word(IntPtr a, uint w); + [DllImport(DLLNAME)] + 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)] + public static extern IntPtr d2i_DHparams(out IntPtr a, IntPtr pp, int length); + + //int i2d_DHparams(const DH *a,unsigned char **pp); + [DllImport(DLLNAME)] + 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)] + 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)] + public extern static int ASN1_i2d_bio(IntPtr i2d, IntPtr bp, IntPtr x); + #endregion + + #region PEM + + #region X509 + [DllImport(DLLNAME)] + public extern static int PEM_write_bio_X509(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME)] + public extern static IntPtr PEM_read_bio_X509(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + + [DllImport(DLLNAME)] + public extern static IntPtr PEM_read_bio_PKCS7(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + + [DllImport(DLLNAME)] + public extern static IntPtr d2i_PKCS7_bio(IntPtr bp, IntPtr p7); + + [DllImport(DLLNAME)] + public extern static void PKCS7_free(IntPtr p7); + + [DllImport(DLLNAME)] + public extern static IntPtr d2i_PKCS12_bio(IntPtr bp, IntPtr p12); + + [DllImport(DLLNAME)] + public extern static int i2d_PKCS12_bio(IntPtr bp, IntPtr p12); + + [DllImport(DLLNAME)] + //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)] + //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)] + public extern static void PKCS12_free(IntPtr p12); + + [DllImport(DLLNAME)] + //!!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)] + public extern static int PEM_write_bio_X509_INFO(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME)] + 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)] + public extern static int PEM_write_bio_X509_AUX(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME)] + 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)] + public extern static int PEM_write_bio_X509_REQ(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME)] + 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)] + public extern static int PEM_write_bio_X509_REQ_NEW(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME)] + 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)] + public extern static int PEM_write_bio_X509_CRL(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME)] + public extern static IntPtr PEM_read_bio_X509_CRL(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region X509Chain + [DllImport(DLLNAME)] + public extern static IntPtr PEM_X509_INFO_read_bio(IntPtr bp, IntPtr sk, pem_password_cb cb, IntPtr u); + + [DllImport(DLLNAME)] + 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)] + 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)] + public extern static IntPtr PEM_read_bio_DSAPrivateKey(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + + [DllImport(DLLNAME)] + public extern static int PEM_write_bio_DSA_PUBKEY(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME)] + public extern static IntPtr PEM_read_bio_DSA_PUBKEY(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region DSAparams + [DllImport(DLLNAME)] + public extern static int PEM_write_bio_DSAparams(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME)] + public extern static IntPtr PEM_read_bio_DSAparams(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region RSA + [DllImport(DLLNAME)] + public extern static int PEM_write_bio_RSA_PUBKEY(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME)] + public extern static IntPtr PEM_read_bio_RSA_PUBKEY(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + + [DllImport(DLLNAME)] + 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)] + public extern static IntPtr PEM_read_bio_RSAPrivateKey(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region DHparams + [DllImport(DLLNAME)] + public extern static int PEM_write_bio_DHparams(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME)] + public extern static IntPtr PEM_read_bio_DHparams(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region PrivateKey + [DllImport(DLLNAME)] + 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)] + public extern static IntPtr PEM_read_bio_PrivateKey(IntPtr bp, IntPtr x, pem_password_cb cb, IntPtr u); + #endregion + + #region PUBKEY + [DllImport(DLLNAME)] + public extern static int PEM_write_bio_PUBKEY(IntPtr bp, IntPtr x); + + [DllImport(DLLNAME)] + 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)] + public extern static IntPtr EVP_md_null(); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_md2(); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_md4(); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_md5(); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_sha(); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_sha1(); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_sha224(); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_sha256(); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_sha384(); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_sha512(); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_dss(); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_dss1(); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_mdc2(); + + [DllImport(DLLNAME)] + 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)] + public extern static void HMAC_CTX_init(IntPtr ctx); + [DllImport(DLLNAME)] + public extern static void HMAC_CTX_set_flags(IntPtr ctx, uint flags); + [DllImport(DLLNAME)] + public extern static void HMAC_CTX_cleanup(IntPtr ctx); + [DllImport(DLLNAME)] + 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)] + public extern static void HMAC_Init_ex(IntPtr ctx, byte[] key, int len, IntPtr md, IntPtr engine_impl); + [DllImport(DLLNAME)] + public extern static void HMAC_Update(IntPtr ctx, byte[] data, int len); + [DllImport(DLLNAME)] + public extern static void HMAC_Final(IntPtr ctx, byte[] md, ref uint len); + [DllImport(DLLNAME)] + 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)] + public extern static IntPtr EVP_get_cipherbyname(byte[] name); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_enc_null(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_ecb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_ede(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_ede3(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_ede_ecb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_ede3_ecb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_cfb64(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_cfb1(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_cfb8(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_ede_cfb64(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_ede3_cfb64(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_ede3_cfb1(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_ede3_cfb8(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_ofb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_ede_ofb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_ede3_ofb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_cbc(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_ede_cbc(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_des_ede3_cbc(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_desx_cbc(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_rc4(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_rc4_40(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_idea_ecb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_idea_cfb64(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_idea_ofb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_idea_cbc(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_rc2_ecb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_rc2_cbc(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_rc2_40_cbc(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_rc2_64_cbc(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_rc2_cfb64(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_rc2_ofb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_bf_ecb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_bf_cbc(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_bf_cfb64(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_bf_ofb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_cast5_ecb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_cast5_cbc(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_cast5_cfb64(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_cast5_ofb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_rc5_32_12_16_cbc(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_rc5_32_12_16_ecb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_rc5_32_12_16_cfb64(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_rc5_32_12_16_ofb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_128_ecb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_128_cbc(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_128_cfb1(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_128_cfb8(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_128_cfb128(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_128_ofb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_192_ecb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_192_cbc(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_192_cfb1(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_192_cfb8(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_192_cfb128(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_192_ofb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_256_ecb(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_256_cbc(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_256_cfb1(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_256_cfb8(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_256_cfb128(); + [DllImport(DLLNAME)] + public extern static IntPtr EVP_aes_256_ofb(); + + #endregion + + #region EVP_PKEY + [DllImport(DLLNAME)] + public extern static IntPtr EVP_PKEY_new(); + + [DllImport(DLLNAME)] + public extern static void EVP_PKEY_free(IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static int EVP_PKEY_cmp(IntPtr a, IntPtr b); + + [DllImport(DLLNAME)] + public extern static int EVP_PKEY_decrypt(byte[] dec_key, byte[] enc_key, int enc_key_len, IntPtr private_key); + + [DllImport(DLLNAME)] + public extern static int EVP_PKEY_encrypt(byte[] enc_key, byte[] key, int key_len, IntPtr pub_key); + + [DllImport(DLLNAME)] + public extern static int EVP_PKEY_type(int type); + + [DllImport(DLLNAME)] + public extern static int EVP_PKEY_bits(IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static int EVP_PKEY_size(IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static int EVP_PKEY_assign(IntPtr pkey, int type, byte[] key); + + [DllImport(DLLNAME)] + public extern static int EVP_PKEY_set1_DSA(IntPtr pkey, IntPtr key); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_PKEY_get1_DSA(IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static int EVP_PKEY_set1_RSA(IntPtr pkey, IntPtr key); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_PKEY_get1_RSA(IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static int EVP_PKEY_set1_DH(IntPtr pkey, IntPtr key); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_PKEY_get1_DH(IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static int EVP_PKEY_copy_parameters(IntPtr to, IntPtr from); + + [DllImport(DLLNAME)] + public extern static int EVP_PKEY_missing_parameters(IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static int EVP_PKEY_save_parameters(IntPtr pkey, int mode); + + [DllImport(DLLNAME)] + public extern static int EVP_PKEY_cmp_parameters(IntPtr a, IntPtr b); + + #endregion + + #region EVP_CIPHER + + [DllImport(DLLNAME)] + public extern static void EVP_CIPHER_CTX_init(IntPtr a); + + [DllImport(DLLNAME)] + public extern static int EVP_CIPHER_CTX_set_padding(IntPtr x, int padding); + + [DllImport(DLLNAME)] + public extern static int EVP_CIPHER_CTX_set_key_length(IntPtr x, int keylen); + + [DllImport(DLLNAME)] + public extern static int EVP_CIPHER_CTX_ctrl(IntPtr ctx, int type, int arg, IntPtr ptr); + + [DllImport(DLLNAME)] + public extern static int EVP_CIPHER_CTX_cleanup(IntPtr a); + + [DllImport(DLLNAME)] + public extern static int EVP_CIPHER_type(IntPtr ctx); + + [DllImport(DLLNAME)] + public extern static int EVP_CipherInit_ex(IntPtr ctx, IntPtr type, IntPtr impl, byte[] key, byte[] iv, int enc); + + [DllImport(DLLNAME)] + public extern static int EVP_CipherUpdate(IntPtr ctx, byte[] outb, out int outl, byte[] inb, int inl); + + [DllImport(DLLNAME)] + public extern static int EVP_CipherFinal_ex(IntPtr ctx, byte[] outm, ref int outl); + + [DllImport(DLLNAME)] + public extern static int EVP_OpenInit(IntPtr ctx, IntPtr type, byte[] ek, int ekl, byte[] iv, IntPtr priv); + + [DllImport(DLLNAME)] + public extern static int EVP_OpenFinal(IntPtr ctx, byte[] outb, out int outl); + + [DllImport(DLLNAME)] + public extern static int EVP_SealInit(IntPtr ctx, IntPtr type, byte[][] ek, int[] ekl, byte[] iv, IntPtr[] pubk, int npubk); + + [DllImport(DLLNAME)] + public extern static int EVP_SealFinal(IntPtr ctx, byte[] outb, out int outl); + + [DllImport(DLLNAME)] + public extern static int EVP_DecryptUpdate(IntPtr ctx, byte[] output, out int outl, byte[] input, int inl); + + [DllImport(DLLNAME)] + public extern static int EVP_EncryptUpdate(IntPtr ctx, byte[] output, out int outl, byte[] input, int inl); + + [DllImport(DLLNAME)] + 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)] + public extern static IntPtr EVP_get_digestbyname(byte[] name); + + [DllImport(DLLNAME)] + public extern static void EVP_MD_CTX_init(IntPtr ctx); + + [DllImport(DLLNAME)] + public extern static int EVP_MD_CTX_cleanup(IntPtr ctx); + + [DllImport(DLLNAME)] + public extern static IntPtr EVP_MD_CTX_create(); + + [DllImport(DLLNAME)] + public extern static void EVP_MD_CTX_destroy(IntPtr ctx); + + [DllImport(DLLNAME)] + public extern static int EVP_DigestInit_ex(IntPtr ctx, IntPtr type, IntPtr impl); + + [DllImport(DLLNAME)] + public extern static int EVP_DigestUpdate(IntPtr ctx, byte[] d, uint cnt); + + [DllImport(DLLNAME)] + public extern static int EVP_DigestFinal_ex(IntPtr ctx, byte[] md, ref uint s); + + [DllImport(DLLNAME)] + public extern static int EVP_Digest(byte[] data, uint count, byte[] md, ref uint size, IntPtr type, IntPtr impl); + + [DllImport(DLLNAME)] + public extern static int EVP_SignFinal(IntPtr ctx, byte[] md, ref uint s, IntPtr pkey); + + [DllImport(DLLNAME)] + public extern static int EVP_VerifyFinal(IntPtr ctx, byte[] sigbuf, uint siglen, IntPtr pkey); + + #endregion + + #endregion EVP + + #region BIO + [DllImport(DLLNAME)] + //!!public extern static IntPtr BIO_new_file(byte[] filename, byte[] mode); + public extern static IntPtr BIO_new_file(string filename, string mode); + + [DllImport(DLLNAME)] + public extern static IntPtr BIO_new_mem_buf(byte[] buf, int len); + + [DllImport(DLLNAME)] + public extern static IntPtr BIO_s_mem(); + + // Unsupported! + //[DllImport(DLLNAME)] + //public extern static IntPtr BIO_s_fd(); + + [DllImport(DLLNAME)] + public extern static IntPtr BIO_f_md(); + + [DllImport(DLLNAME)] + 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)] + public extern static IntPtr BIO_push(IntPtr bp, IntPtr append); + + [DllImport(DLLNAME)] + public extern static int BIO_ctrl(IntPtr bp, int cmd, int larg, IntPtr parg); + + [DllImport(DLLNAME)] + public extern static int BIO_int_ctrl(IntPtr bp, int cmd, int larg, int parg); + + [DllImport(DLLNAME)] + public extern static IntPtr BIO_new(IntPtr type); + + [DllImport(DLLNAME)] + public extern static int BIO_read(IntPtr b, byte[] buf, int len); + + [DllImport(DLLNAME)] + public extern static int BIO_write(IntPtr b, byte[] buf, int len); + + [DllImport(DLLNAME)] + public extern static int BIO_puts(IntPtr b, byte[] buf); + + [DllImport(DLLNAME)] + public extern static int BIO_gets(IntPtr b, byte[] buf, int len); + + [DllImport(DLLNAME)] + public extern static void BIO_free(IntPtr bio); + + [DllImport(DLLNAME)] + public extern static uint BIO_number_read(IntPtr bio); + + [DllImport(DLLNAME)] + public extern static uint BIO_number_written(IntPtr bio); + + [DllImport(DLLNAME)] + public extern static uint BIO_ctrl_pending(IntPtr bio); + + #endregion + + #region ERR + [DllImport(DLLNAME)] + public extern static void ERR_load_crypto_strings(); + + [DllImport(DLLNAME)] + public extern static uint ERR_get_error(); + + [DllImport(DLLNAME)] + public extern static uint ERR_error_string_n(uint e, byte[] buf, int len); + + [DllImport(DLLNAME)] + public extern static IntPtr ERR_lib_error_string(uint e); + + [DllImport(DLLNAME)] + public extern static IntPtr ERR_func_error_string(uint e); + + [DllImport(DLLNAME)] + public extern static IntPtr ERR_reason_error_string(uint e); + + [DllImport(DLLNAME)] + public extern static void ERR_remove_state(uint pid); + + [DllImport(DLLNAME)] + public extern static void ERR_clear_error(); + + #endregion ERR + + #region NCONF + + [DllImport(DLLNAME)] + public extern static IntPtr NCONF_new(IntPtr meth); + + [DllImport(DLLNAME)] + public extern static void NCONF_free(IntPtr conf); + + [DllImport(DLLNAME)] + //!!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)] + public extern static IntPtr NCONF_get_string(IntPtr conf, byte[] group, byte[] name); + + [DllImport(DLLNAME)] + public extern static void X509V3_set_ctx(IntPtr ctx, IntPtr issuer, IntPtr subject, IntPtr req, IntPtr crl, int flags); + + [DllImport(DLLNAME)] + public extern static void X509V3_set_nconf(IntPtr ctx, IntPtr conf); + + [DllImport(DLLNAME)] + public extern static int X509V3_EXT_add_nconf(IntPtr conf, IntPtr ctx, byte[] section, IntPtr cert); + + #endregion + + #region FIPS + [DllImport(DLLNAME)] + public extern static int FIPS_mode_set(int onoff); + + #endregion + + #region SSL Routines + #region Initialization + [DllImport(SSLDLLNAME)] + public extern static void SSL_load_error_strings(); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_library_init(); + + [DllImport(SSLDLLNAME)] + 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)] + //public extern static IntPtr SSLv2_method(); + + //[DllImport(SSLDLLNAME)] + //public extern static IntPtr SSLv2_server_method(); + + //[DllImport(SSLDLLNAME)] + //public extern static IntPtr SSLv2_client_method(); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSLv3_method(); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSLv3_server_method(); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSLv3_client_method(); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSLv23_method(); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSLv23_server_method(); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSLv23_client_method(); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr TLSv1_method(); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr TLSv1_client_method(); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr TLSv1_server_method(); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr DTLSv1_method(); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr DTLSv1_client_method(); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr DTLSv1_server_method(); + + #endregion + + #region SSL_CTX + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSL_CTX_new(IntPtr sslMethod); + + [DllImport(SSLDLLNAME)] + public extern static void SSL_CTX_free(IntPtr ctx); + + [DllImport(SSLDLLNAME)] + 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)] + 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)] + public extern static void SSL_CTX_set_verify(IntPtr ctx, int mode, VerifyCertCallback callback); + + [DllImport(SSLDLLNAME)] + public extern static void SSL_CTX_set_verify_depth(IntPtr ctx, int depth); + + [DllImport(SSLDLLNAME)] + public extern static void SSL_CTX_set_client_CA_list(IntPtr ctx, IntPtr name_list); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSL_CTX_get_client_CA_list(IntPtr ctx); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_CTX_load_verify_locations(IntPtr ctx, string file, string path); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_CTX_set_default_verify_paths(IntPtr ctx); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_CTX_set_cipher_list(IntPtr ctx, string cipher_string); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_CTX_use_certificate_chain_file(IntPtr ctx, string file); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_CTX_use_certificate(IntPtr ctx, IntPtr cert); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_CTX_use_PrivateKey(IntPtr ctx, IntPtr pkey); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_CTX_use_PrivateKey_file(IntPtr ctx, string file, int type); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_CTX_check_private_key(IntPtr ctx); + + public const int SSL_MAX_SID_CTX_LENGTH = 32; + + [DllImport(SSLDLLNAME)] + public extern static int SSL_CTX_set_session_id_context(IntPtr ctx, byte[] sid_ctx, uint sid_ctx_len); + + [DllImport(SSLDLLNAME)] + public extern static void SSL_CTX_set_default_passwd_cb_userdata(IntPtr ssl, IntPtr data); + + [DllImport(SSLDLLNAME)] + public extern static void SSL_CTX_set_default_passwd_cb(IntPtr ssl, pem_password_cb callback); + + [DllImport(SSLDLLNAME)] + public extern static void SSL_CTX_set_client_cert_cb(IntPtr ssl_ctx, client_cert_cb callback); + + #endregion + + #region SSL functions + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSL_CIPHER_description(IntPtr ssl_cipher, byte[] buf, int buf_len); + + [DllImport(SSLDLLNAME)] + public extern static string SSL_CIPHER_name(IntPtr ssl_cipher); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_CIPHER_get_bits(IntPtr ssl_cipher, out int alg_bits); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSL_get_current_cipher(IntPtr ssl); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_get_verify_result(IntPtr ssl); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_set_verify_result(IntPtr ssl, int v); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSL_get_peer_certificate(IntPtr ssl); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_get_error(IntPtr ssl, int ret_code); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_accept(IntPtr ssl); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_shutdown(IntPtr ssl); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_write(IntPtr ssl, byte[] buf, int len); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_read(IntPtr ssl, byte[] buf, int len); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_renegotiate(IntPtr ssl); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_set_session_id_context(IntPtr ssl, byte[] sid_ctx, uint sid_ctx_len); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_do_handshake(IntPtr ssl); + + [DllImport(SSLDLLNAME)] + public extern static void SSL_set_connect_state(IntPtr ssl); + + [DllImport(SSLDLLNAME)] + public extern static void SSL_set_accept_state(IntPtr ssl); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_connect(IntPtr ssl); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSL_new(IntPtr ctx); + + [DllImport(SSLDLLNAME)] + public extern static void SSL_free(IntPtr ssl); + + [DllImport(SSLDLLNAME)] + public extern static void SSL_set_bio(IntPtr ssl, IntPtr read_bio, IntPtr write_bio); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_use_certificate_file(IntPtr ssl, string file, int type); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_use_PrivateKey_file(IntPtr ssl, string file, int type); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_clear(IntPtr ssl); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSL_load_client_CA_file(string file); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSL_get_client_CA_list(IntPtr ssl); + + [DllImport(SSLDLLNAME)] + public extern static void SSL_set_client_CA_list(IntPtr ssl, IntPtr name_list); + + [DllImport(SSLDLLNAME)] + public extern static IntPtr SSL_get_certificate(IntPtr ssl); + + [DllImport(SSLDLLNAME)] + public extern static int SSL_use_certificate(IntPtr ssl, IntPtr x509); + + [DllImport(SSLDLLNAME)] + 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..59887502 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/OpenSslException.cs @@ -0,0 +1,157 @@ +// 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]; + uint len = Native.ERR_error_string_n(err, buf, buf.Length); + return Encoding.ASCII.GetString(buf, 0, (int)len); + } + } + } + + /// + /// 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..bd9cf99d --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Core/Version.cs @@ -0,0 +1,208 @@ +// 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. + /// + 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 & 0xf0000000) >> 28; } + } + + /// + /// Minor portion of the Version. + /// + public uint Minor + { + get { return (this.raw & 0x0ff00000) >> 20; } + } + + /// + /// Fix portion of the Version. + /// + public uint Fix + { + get { return (this.raw & 0x000ff000) >> 12; } + } + + /// + /// Patch portion of the Version. These should start at 'a' and continue to 'z'. + /// + public char Patch + { + get + { + uint patch = (this.raw & 0x00000ff0) >> 4; + + 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..2c6daaeb --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/Enums.cs @@ -0,0 +1,310 @@ +// 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 + } + + /// + /// + /// + public enum HashAlgorithmType + { + /// + /// + /// + None, + /// + /// + /// + Md5, + /// + /// + /// + Sha1 + } + + /// + /// + /// + public enum ExchangeAlgorithmType + { + /// + /// + /// + None, + /// + /// + /// + RsaSign, + /// + /// + /// + RsaKeyX, + /// + /// + /// + DiffieHellman, + /// + /// + /// + Kerberos, + /// + /// + /// + Fortezza, + /// + /// + /// + ECDiffieHellman + } + + /// + /// + /// + 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 + } + + 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..1405b47b --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/SslCipher.cs @@ -0,0 +1,450 @@ +// 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 algorithms; // what ciphers are used + 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; + } + + private int ExportKeyLength(uint algorithms, uint algo_strength) + { + if ((algo_strength & SSL_EXP40) > 0) + { + return 5; + } + else + { + if ((algorithms & SSL_ENC_MASK) == SSL_DES) + { + return 8; + } + return 7; + } + } + + public const int SSL_MKEY_MASK = 0x000000FF; + public const int SSL_kRSA = 0x00000001; /* RSA key exchange */ + public const int SSL_kDHr = 0x00000002; /* DH cert RSA CA cert */ + public const int SSL_kDHd = 0x00000004; /* DH cert DSA CA cert */ + public const int SSL_kFZA = 0x00000008; + public const int SSL_kEDH = 0x00000010; /* tmp DH key no DH cert */ + public const int SSL_kKRB5 = 0x00000020; /* Kerberos5 key exchange */ + public const int SSL_kECDH = 0x00000040; /* ECDH w/ long-term keys */ + public const int SSL_kECDHE = 0x00000080; /* ephemeral ECDH */ + public const int SSL_EDH = (SSL_kEDH | (SSL_AUTH_MASK ^ SSL_aNULL)); + + public const int SSL_AUTH_MASK = 0x00007F00; + public const int SSL_aRSA = 0x00000100; /* Authenticate with RSA */ + public const int SSL_aDSS = 0x00000200; /* Authenticate with DSS */ + public const int SSL_DSS = SSL_aDSS; + public const int SSL_aFZA = 0x00000400; + public const int SSL_aNULL = 0x00000800; /* no Authenticate, ADH */ + public const int SSL_aDH = 0x00001000; /* no Authenticate, ADH */ + public const int SSL_aKRB5 = 0x00002000; /* Authenticate with KRB5 */ + public const int SSL_aECDSA = 0x00004000; /* Authenticate with ECDSA */ + + 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); + + public const int SSL_ENC_MASK = 0x1C3F8000; + public const int SSL_DES = 0x00008000; + public const int SSL_3DES = 0x00010000; + public const int SSL_RC4 = 0x00020000; + public const int SSL_RC2 = 0x00040000; + public const int SSL_IDEA = 0x00080000; + public const int SSL_eFZA = 0x00100000; + public const int SSL_eNULL = 0x00200000; + public const int SSL_AES = 0x04000000; + public const int SSL_CAMELLIA = 0x08000000; + public const int SSL_SEED = 0x10000000; + + public const int SSL_MAC_MASK = 0x00c00000; + public const int SSL_MD5 = 0x00400000; + public const int SSL_SHA1 = 0x00800000; + public const int SSL_SHA = (SSL_SHA1); + + public const int SSL_SSL_MASK = 0x03000000; + public const int SSL_SSLV2 = 0x01000000; + public const int SSL_SSLV3 = 0x02000000; + public const int SSL_TLSV1 = SSL_SSLV3; /* for now */ + + /* 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.algorithms, raw.algo_strength); + + // Get the SSL Protocol version + if ((raw.algorithms & SSL_SSLV2) == SSL_SSLV2) + { + sslProtocol = SslProtocols.Ssl2; + } + else if ((raw.algorithms & SSL_SSLV3) == SSL_SSLV3) + { + sslProtocol = SslProtocols.Tls; // SSL3 & TLS are the same here... + } + + // set the keyExchange strength + keyExchangeStrength = privateKeyLength; + + // Get the Key Exchange cipher and strength + switch (raw.algorithms & SSL_MKEY_MASK) + { + case SSL_kRSA: + keyExchangeAlgorithm = ExchangeAlgorithmType.RsaKeyX; + break; + case SSL_kDHr: + case SSL_kDHd: + case SSL_kEDH: + keyExchangeAlgorithm = ExchangeAlgorithmType.DiffieHellman; + break; + case SSL_kKRB5: /* VRS */ + case SSL_KRB5: /* VRS */ + keyExchangeAlgorithm = ExchangeAlgorithmType.Kerberos; + break; + case SSL_kFZA: + keyExchangeAlgorithm = ExchangeAlgorithmType.Fortezza; + break; + case SSL_kECDH: + case SSL_kECDHE: + keyExchangeAlgorithm = ExchangeAlgorithmType.ECDiffieHellman; + break; + } + + // Get the authentication method + switch (raw.algorithms & SSL_AUTH_MASK) + { + 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 */ + case SSL_KRB5: /* VRS */ + authMethod = AuthenticationMethod.Kerberos; + break; + case SSL_aFZA: + case SSL_aNULL: + authMethod = AuthenticationMethod.None; + break; + case SSL_aECDSA: + authMethod = AuthenticationMethod.ECDsa; + break; + } + // Get the symmetric encryption cipher info + switch (raw.algorithms & SSL_ENC_MASK) + { + 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_eFZA: + cipherAlgorithm = CipherAlgorithmType.Fortezza; + break; + case SSL_eNULL: + cipherAlgorithm = CipherAlgorithmType.None; + break; + case SSL_AES: + switch (raw.strength_bits) + { + case 128: cipherAlgorithm = CipherAlgorithmType.Aes128; break; + case 192: cipherAlgorithm = CipherAlgorithmType.Aes192; break; + case 256: cipherAlgorithm = CipherAlgorithmType.Aes256; break; + } + break; + case SSL_CAMELLIA: + switch (raw.strength_bits) + { + case 128: cipherAlgorithm = CipherAlgorithmType.Camellia128; break; + case 256: cipherAlgorithm = CipherAlgorithmType.Camellia256; break; + } + break; + case SSL_SEED: + cipherAlgorithm = CipherAlgorithmType.Seed; + cipherStrength = 128; + break; + } + // Get the MAC info + switch (raw.algorithms & SSL_MAC_MASK) + { + case SSL_MD5: + hashAlgorithm = HashAlgorithmType.Md5; + break; + case SSL_SHA1: + hashAlgorithm = HashAlgorithmType.Sha1; + 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..3aa8c2f0 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/SslContext.cs @@ -0,0 +1,442 @@ +// 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); + + /// + /// 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; + //#endif + } + #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 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..7bb0589c --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/SslStream.cs @@ -0,0 +1,741 @@ +// 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; } + } + + #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); + } + + /// + /// + /// + /// + 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); + } + + /// + /// + /// + /// + 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..e405708e --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/SslStreamBase.cs @@ -0,0 +1,1191 @@ +// 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; + + /// + /// 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(); } + } + + #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 + return String.Format("{0}:!ADH:!aNULL:!eNULL:@STRENGTH", str); + } + + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/SslStreamClient.cs b/dep/openssl/src/ManagedOpenSsl/SslStreamClient.cs new file mode 100644 index 00000000..32ebea05 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/SslStreamClient.cs @@ -0,0 +1,205 @@ +// 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; + + 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(); + } + + 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; + } + } +} diff --git a/dep/openssl/src/ManagedOpenSsl/SslStreamServer.cs b/dep/openssl/src/ManagedOpenSsl/SslStreamServer.cs new file mode 100644 index 00000000..d6617a50 --- /dev/null +++ b/dep/openssl/src/ManagedOpenSsl/SslStreamServer.cs @@ -0,0 +1,211 @@ +// 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 + { + 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); + + // 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)); + } + } +} 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..edf3e533 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/dep/sharpziplib/ICSharpCode.SharpZipLib.License b/dep/sharpziplib/ICSharpCode.SharpZipLib.License new file mode 100644 index 00000000..e69de29b 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..90ed708f Binary files /dev/null and b/dep/sqlite/sqlite-mixed/System.Data.SQLite.dll differ 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/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/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/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/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/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/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/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/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/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/.gitignore b/src/.gitignore new file mode 100644 index 00000000..61edb75e --- /dev/null +++ b/src/.gitignore @@ -0,0 +1,5 @@ +/*.6.0.ReSharper.user +/*.suo +/*.userprefs +/*.user + diff --git a/src/LibMooNet/.gitignore b/src/LibMooNet/.gitignore new file mode 100644 index 00000000..34250869 --- /dev/null +++ b/src/LibMooNet/.gitignore @@ -0,0 +1,4 @@ +bin/ +obj/ +/*.ReSharper +/*.pidb diff --git a/source/D3Proto/D3/Account/Account.cs b/src/LibMooNet/D3/Account/Account.cs similarity index 55% rename from source/D3Proto/D3/Account/Account.cs rename to src/LibMooNet/D3/Account/Account.cs index b41c31c1..279eb058 100644 --- a/source/D3Proto/D3/Account/Account.cs +++ b/src/LibMooNet/D3/Account/Account.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.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 @@ -30,30 +35,35 @@ 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=="); + "SXRlbUNyYWZ0aW5nLnByb3RvIpcCChNCYW5uZXJDb25maWd1cmF0aW9uEhcK" + + "DGJhbm5lcl9zaGFwZRgBIAIoDToBMBIVCgpzaWdpbF9tYWluGAIgAigNOgEw" + + "EhcKDHNpZ2lsX2FjY2VudBgDIAIoDToBMBIYCg1wYXR0ZXJuX2NvbG9yGAQg" + + "AigNOgEwEhsKEGJhY2tncm91bmRfY29sb3IYBSACKA06ATASFgoLc2lnaWxf" + + "Y29sb3IYBiACKA06ATASGgoPc2lnaWxfcGxhY2VtZW50GAcgAigNOgEwEhIK" + + "B3BhdHRlcm4YCCACKA06ATASIAoRdXNlX3NpZ2lsX3ZhcmlhbnQYCSACKAg6" + + "BWZhbHNlEhYKC2VwaWNfYmFubmVyGAogASgNOgEwIsgBCgZEaWdlc3QSDwoH" + + "dmVyc2lvbhgBIAIoDRI3ChNsYXN0X3BsYXllZF9oZXJvX2lkGAIgAigLMhou" + + "RDMuT25saW5lU2VydmljZS5FbnRpdHlJZBI9ChRiYW5uZXJfY29uZmlndXJh" + + "dGlvbhgDIAIoCzIfLkQzLkFjY291bnQuQmFubmVyQ29uZmlndXJhdGlvbhIQ" + + "CgVmbGFncxgEIAIoDToBMCIjCgVGbGFncxIaChZIQVJEQ09SRV9IRVJPX1VO" + + "TE9DS0VEEAEihAQKD1NhdmVkRGVmaW5pdGlvbhIPCgd2ZXJzaW9uGAEgAigN" + + "EiIKBmRpZ2VzdBgCIAEoCzISLkQzLkFjY291bnQuRGlnZXN0EkEKEHNhdmVk" + + "X2F0dHJpYnV0ZXMYAyACKAsyJy5EMy5BdHRyaWJ1dGVTZXJpYWxpemVyLlNh" + + "dmVkQXR0cmlidXRlcxI1Chlub3JtYWxfc2hhcmVkX3NhdmVkX2l0ZW1zGAQg" + + "ASgLMhIuRDMuSXRlbXMuSXRlbUxpc3QSNwobaGFyZGNvcmVfc2hhcmVkX3Nh" + + "dmVkX2l0ZW1zGAUgASgLMhIuRDMuSXRlbXMuSXRlbUxpc3QSPQoSY3JhZnRl" + + "cl9zYXZlZF9kYXRhGAYgASgLMiEuRDMuSXRlbUNyYWZ0aW5nLkNyYWZ0ZXJT" + + "YXZlZERhdGESFgoOc2Vlbl90dXRvcmlhbHMYByADKA8SJgoebnVtX3ZvdGVf" + + "a2lja3NfcGFydGljaXBhdGVkX2luGAggASgQEiAKGG51bV92b3RlX2tpY2tz" + + "X2luaXRpYXRlZBgJIAEoEBIgChhudW1fcHVibGljX2dhbWVzX25vX2tpY2sY" + + "CiABKBASGQoRdGltZXNfdm90ZV9raWNrZWQYCyABKBASKwoHZ29sZF9pZBgM" + + "IAEoCzIaLkQzLk9ubGluZVNlcnZpY2UuRW50aXR5SWQ="); 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", }); + 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, @@ -61,7 +71,7 @@ static Account() { 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", }); + new string[] { "Version", "Digest", "SavedAttributes", "NormalSharedSavedItems", "HardcoreSharedSavedItems", "CrafterSavedData", "SeenTutorials", "NumVoteKicksParticipatedIn", "NumVoteKicksInitiated", "NumPublicGamesNoKick", "TimesVoteKicked", "GoldId", }); return null; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, @@ -76,14 +86,20 @@ static Account() { } #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 static readonly BannerConfiguration defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override BannerConfiguration ThisMessage { @@ -98,89 +114,89 @@ protected override BannerConfiguration ThisMessage { 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 const int BannerShapeFieldNumber = 1; + private bool hasBannerShape; + private uint bannerShape_; + public bool HasBannerShape { + get { return hasBannerShape; } } - public uint BannerIndex { - get { return bannerIndex_; } + public uint BannerShape { + get { return bannerShape_; } } public const int SigilMainFieldNumber = 2; private bool hasSigilMain; - private int sigilMain_ = 0; + private uint sigilMain_; public bool HasSigilMain { get { return hasSigilMain; } } - public int SigilMain { + public uint SigilMain { get { return sigilMain_; } } public const int SigilAccentFieldNumber = 3; private bool hasSigilAccent; - private int sigilAccent_ = 0; + private uint sigilAccent_; public bool HasSigilAccent { get { return hasSigilAccent; } } - public int SigilAccent { + public uint SigilAccent { get { return sigilAccent_; } } - public const int PatternColorIndexFieldNumber = 4; - private bool hasPatternColorIndex; - private int patternColorIndex_ = 0; - public bool HasPatternColorIndex { - get { return hasPatternColorIndex; } + public const int PatternColorFieldNumber = 4; + private bool hasPatternColor; + private uint patternColor_; + public bool HasPatternColor { + get { return hasPatternColor; } } - public int PatternColorIndex { - get { return patternColorIndex_; } + public uint PatternColor { + get { return patternColor_; } } - public const int BackgroundColorIndexFieldNumber = 5; - private bool hasBackgroundColorIndex; - private int backgroundColorIndex_ = 0; - public bool HasBackgroundColorIndex { - get { return hasBackgroundColorIndex; } + public const int BackgroundColorFieldNumber = 5; + private bool hasBackgroundColor; + private uint backgroundColor_; + public bool HasBackgroundColor { + get { return hasBackgroundColor; } } - public int BackgroundColorIndex { - get { return backgroundColorIndex_; } + public uint BackgroundColor { + get { return backgroundColor_; } } - public const int SigilColorIndexFieldNumber = 6; - private bool hasSigilColorIndex; - private int sigilColorIndex_ = 0; - public bool HasSigilColorIndex { - get { return hasSigilColorIndex; } + public const int SigilColorFieldNumber = 6; + private bool hasSigilColor; + private uint sigilColor_; + public bool HasSigilColor { + get { return hasSigilColor; } } - public int SigilColorIndex { - get { return sigilColorIndex_; } + public uint SigilColor { + get { return sigilColor_; } } - public const int PlacementIndexFieldNumber = 7; - private bool hasPlacementIndex; - private int placementIndex_ = 0; - public bool HasPlacementIndex { - get { return hasPlacementIndex; } + public const int SigilPlacementFieldNumber = 7; + private bool hasSigilPlacement; + private uint sigilPlacement_; + public bool HasSigilPlacement { + get { return hasSigilPlacement; } } - public int PlacementIndex { - get { return placementIndex_; } + public uint SigilPlacement { + get { return sigilPlacement_; } } public const int PatternFieldNumber = 8; private bool hasPattern; - private int pattern_ = 0; + private uint pattern_; public bool HasPattern { get { return hasPattern; } } - public int Pattern { + public uint Pattern { get { return pattern_; } } public const int UseSigilVariantFieldNumber = 9; private bool hasUseSigilVariant; - private bool useSigilVariant_ = false; + private bool useSigilVariant_; public bool HasUseSigilVariant { get { return hasUseSigilVariant; } } @@ -188,49 +204,63 @@ 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 (!hasBannerIndex) return false; + if (!hasBannerShape) 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 (!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::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasBannerIndex) { - output.WriteUInt32(1, BannerIndex); + string[] field_names = _bannerConfigurationFieldNames; + if (hasBannerShape) { + output.WriteUInt32(1, field_names[1], BannerShape); + } + if (hasSigilMain) { + output.WriteUInt32(2, field_names[7], SigilMain); } - if (HasSigilMain) { - output.WriteInt32(2, SigilMain); + if (hasSigilAccent) { + output.WriteUInt32(3, field_names[5], SigilAccent); } - if (HasSigilAccent) { - output.WriteInt32(3, SigilAccent); + if (hasPatternColor) { + output.WriteUInt32(4, field_names[4], PatternColor); } - if (HasPatternColorIndex) { - output.WriteInt32(4, PatternColorIndex); + if (hasBackgroundColor) { + output.WriteUInt32(5, field_names[0], BackgroundColor); } - if (HasBackgroundColorIndex) { - output.WriteInt32(5, BackgroundColorIndex); + if (hasSigilColor) { + output.WriteUInt32(6, field_names[6], SigilColor); } - if (HasSigilColorIndex) { - output.WriteInt32(6, SigilColorIndex); + if (hasSigilPlacement) { + output.WriteUInt32(7, field_names[8], SigilPlacement); } - if (HasPlacementIndex) { - output.WriteInt32(7, PlacementIndex); + if (hasPattern) { + output.WriteUInt32(8, field_names[3], Pattern); } - if (HasPattern) { - output.WriteInt32(8, Pattern); + if (hasUseSigilVariant) { + output.WriteBool(9, field_names[9], UseSigilVariant); } - if (HasUseSigilVariant) { - output.WriteBool(9, UseSigilVariant); + if (hasEpicBanner) { + output.WriteUInt32(10, field_names[2], EpicBanner); } UnknownFields.WriteTo(output); } @@ -242,33 +272,36 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasBannerIndex) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, BannerIndex); + if (hasBannerShape) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, BannerShape); } - if (HasSigilMain) { - size += pb::CodedOutputStream.ComputeInt32Size(2, SigilMain); + if (hasSigilMain) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, SigilMain); } - if (HasSigilAccent) { - size += pb::CodedOutputStream.ComputeInt32Size(3, SigilAccent); + if (hasSigilAccent) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, SigilAccent); } - if (HasPatternColorIndex) { - size += pb::CodedOutputStream.ComputeInt32Size(4, PatternColorIndex); + if (hasPatternColor) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, PatternColor); } - if (HasBackgroundColorIndex) { - size += pb::CodedOutputStream.ComputeInt32Size(5, BackgroundColorIndex); + if (hasBackgroundColor) { + size += pb::CodedOutputStream.ComputeUInt32Size(5, BackgroundColor); } - if (HasSigilColorIndex) { - size += pb::CodedOutputStream.ComputeInt32Size(6, SigilColorIndex); + if (hasSigilColor) { + size += pb::CodedOutputStream.ComputeUInt32Size(6, SigilColor); } - if (HasPlacementIndex) { - size += pb::CodedOutputStream.ComputeInt32Size(7, PlacementIndex); + if (hasSigilPlacement) { + size += pb::CodedOutputStream.ComputeUInt32Size(7, SigilPlacement); } - if (HasPattern) { - size += pb::CodedOutputStream.ComputeInt32Size(8, Pattern); + if (hasPattern) { + size += pb::CodedOutputStream.ComputeUInt32Size(8, Pattern); } - if (HasUseSigilVariant) { + if (hasUseSigilVariant) { size += pb::CodedOutputStream.ComputeBoolSize(9, UseSigilVariant); } + if (hasEpicBanner) { + size += pb::CodedOutputStream.ComputeUInt32Size(10, EpicBanner); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -299,38 +332,72 @@ public static BannerConfiguration ParseDelimitedFrom(global::System.IO.Stream in 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) { + public static BannerConfiguration ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static BannerConfiguration ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - BannerConfiguration result = new BannerConfiguration(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override BannerConfiguration MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new BannerConfiguration(); + 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 { @@ -342,12 +409,11 @@ public override BannerConfiguration DefaultInstanceForType { } public override BannerConfiguration BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - BannerConfiguration returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -361,8 +427,9 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(BannerConfiguration other) { if (other == global::D3.Account.BannerConfiguration.DefaultInstance) return this; - if (other.HasBannerIndex) { - BannerIndex = other.BannerIndex; + PrepareBuilder(); + if (other.HasBannerShape) { + BannerShape = other.BannerShape; } if (other.HasSigilMain) { SigilMain = other.SigilMain; @@ -370,17 +437,17 @@ public override Builder MergeFrom(BannerConfiguration other) { if (other.HasSigilAccent) { SigilAccent = other.SigilAccent; } - if (other.HasPatternColorIndex) { - PatternColorIndex = other.PatternColorIndex; + if (other.HasPatternColor) { + PatternColor = other.PatternColor; } - if (other.HasBackgroundColorIndex) { - BackgroundColorIndex = other.BackgroundColorIndex; + if (other.HasBackgroundColor) { + BackgroundColor = other.BackgroundColor; } - if (other.HasSigilColorIndex) { - SigilColorIndex = other.SigilColorIndex; + if (other.HasSigilColor) { + SigilColor = other.SigilColor; } - if (other.HasPlacementIndex) { - PlacementIndex = other.PlacementIndex; + if (other.HasSigilPlacement) { + SigilPlacement = other.SigilPlacement; } if (other.HasPattern) { Pattern = other.Pattern; @@ -388,24 +455,38 @@ public override Builder MergeFrom(BannerConfiguration other) { if (other.HasUseSigilVariant) { UseSigilVariant = other.UseSigilVariant; } + if (other.HasEpicBanner) { + EpicBanner = other.EpicBanner; + } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -417,225 +498,278 @@ 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: { - BannerIndex = input.ReadUInt32(); + result.hasBannerShape = input.ReadUInt32(ref result.bannerShape_); break; } case 16: { - SigilMain = input.ReadInt32(); + result.hasSigilMain = input.ReadUInt32(ref result.sigilMain_); break; } case 24: { - SigilAccent = input.ReadInt32(); + result.hasSigilAccent = input.ReadUInt32(ref result.sigilAccent_); break; } case 32: { - PatternColorIndex = input.ReadInt32(); + result.hasPatternColor = input.ReadUInt32(ref result.patternColor_); break; } case 40: { - BackgroundColorIndex = input.ReadInt32(); + result.hasBackgroundColor = input.ReadUInt32(ref result.backgroundColor_); break; } case 48: { - SigilColorIndex = input.ReadInt32(); + result.hasSigilColor = input.ReadUInt32(ref result.sigilColor_); break; } case 56: { - PlacementIndex = input.ReadInt32(); + result.hasSigilPlacement = input.ReadUInt32(ref result.sigilPlacement_); break; } case 64: { - Pattern = input.ReadInt32(); + result.hasPattern = input.ReadUInt32(ref result.pattern_); break; } case 72: { - UseSigilVariant = input.ReadBool(); + 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 HasBannerIndex { - get { return result.HasBannerIndex; } + public bool HasBannerShape { + get { return result.hasBannerShape; } } - public uint BannerIndex { - get { return result.BannerIndex; } - set { SetBannerIndex(value); } + public uint BannerShape { + get { return result.BannerShape; } + set { SetBannerShape(value); } } - public Builder SetBannerIndex(uint value) { - result.hasBannerIndex = true; - result.bannerIndex_ = value; + public Builder SetBannerShape(uint value) { + PrepareBuilder(); + result.hasBannerShape = true; + result.bannerShape_ = value; return this; } - public Builder ClearBannerIndex() { - result.hasBannerIndex = false; - result.bannerIndex_ = 0; + public Builder ClearBannerShape() { + PrepareBuilder(); + result.hasBannerShape = false; + result.bannerShape_ = 0; return this; } public bool HasSigilMain { - get { return result.HasSigilMain; } + get { return result.hasSigilMain; } } - public int SigilMain { + public uint SigilMain { get { return result.SigilMain; } set { SetSigilMain(value); } } - public Builder SetSigilMain(int 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; } + get { return result.hasSigilAccent; } } - public int SigilAccent { + public uint SigilAccent { get { return result.SigilAccent; } set { SetSigilAccent(value); } } - public Builder SetSigilAccent(int 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 HasPatternColorIndex { - get { return result.HasPatternColorIndex; } + public bool HasPatternColor { + get { return result.hasPatternColor; } } - public int PatternColorIndex { - get { return result.PatternColorIndex; } - set { SetPatternColorIndex(value); } + public uint PatternColor { + get { return result.PatternColor; } + set { SetPatternColor(value); } } - public Builder SetPatternColorIndex(int value) { - result.hasPatternColorIndex = true; - result.patternColorIndex_ = value; + public Builder SetPatternColor(uint value) { + PrepareBuilder(); + result.hasPatternColor = true; + result.patternColor_ = value; return this; } - public Builder ClearPatternColorIndex() { - result.hasPatternColorIndex = false; - result.patternColorIndex_ = 0; + public Builder ClearPatternColor() { + PrepareBuilder(); + result.hasPatternColor = false; + result.patternColor_ = 0; return this; } - public bool HasBackgroundColorIndex { - get { return result.HasBackgroundColorIndex; } + public bool HasBackgroundColor { + get { return result.hasBackgroundColor; } } - public int BackgroundColorIndex { - get { return result.BackgroundColorIndex; } - set { SetBackgroundColorIndex(value); } + public uint BackgroundColor { + get { return result.BackgroundColor; } + set { SetBackgroundColor(value); } } - public Builder SetBackgroundColorIndex(int value) { - result.hasBackgroundColorIndex = true; - result.backgroundColorIndex_ = value; + public Builder SetBackgroundColor(uint value) { + PrepareBuilder(); + result.hasBackgroundColor = true; + result.backgroundColor_ = value; return this; } - public Builder ClearBackgroundColorIndex() { - result.hasBackgroundColorIndex = false; - result.backgroundColorIndex_ = 0; + public Builder ClearBackgroundColor() { + PrepareBuilder(); + result.hasBackgroundColor = false; + result.backgroundColor_ = 0; return this; } - public bool HasSigilColorIndex { - get { return result.HasSigilColorIndex; } + public bool HasSigilColor { + get { return result.hasSigilColor; } } - public int SigilColorIndex { - get { return result.SigilColorIndex; } - set { SetSigilColorIndex(value); } + public uint SigilColor { + get { return result.SigilColor; } + set { SetSigilColor(value); } } - public Builder SetSigilColorIndex(int value) { - result.hasSigilColorIndex = true; - result.sigilColorIndex_ = value; + public Builder SetSigilColor(uint value) { + PrepareBuilder(); + result.hasSigilColor = true; + result.sigilColor_ = value; return this; } - public Builder ClearSigilColorIndex() { - result.hasSigilColorIndex = false; - result.sigilColorIndex_ = 0; + public Builder ClearSigilColor() { + PrepareBuilder(); + result.hasSigilColor = false; + result.sigilColor_ = 0; return this; } - public bool HasPlacementIndex { - get { return result.HasPlacementIndex; } + public bool HasSigilPlacement { + get { return result.hasSigilPlacement; } } - public int PlacementIndex { - get { return result.PlacementIndex; } - set { SetPlacementIndex(value); } + public uint SigilPlacement { + get { return result.SigilPlacement; } + set { SetSigilPlacement(value); } } - public Builder SetPlacementIndex(int value) { - result.hasPlacementIndex = true; - result.placementIndex_ = value; + public Builder SetSigilPlacement(uint value) { + PrepareBuilder(); + result.hasSigilPlacement = true; + result.sigilPlacement_ = value; return this; } - public Builder ClearPlacementIndex() { - result.hasPlacementIndex = false; - result.placementIndex_ = 0; + public Builder ClearSigilPlacement() { + PrepareBuilder(); + result.hasSigilPlacement = false; + result.sigilPlacement_ = 0; return this; } public bool HasPattern { - get { return result.HasPattern; } + get { return result.hasPattern; } } - public int Pattern { + public uint Pattern { get { return result.Pattern; } set { SetPattern(value); } } - public Builder SetPattern(int 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; } + 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 static readonly Digest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override Digest ThisMessage { @@ -651,7 +785,12 @@ protected override Digest 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 Flags { HARDCORE_HERO_UNLOCKED = 1, } @@ -661,7 +800,7 @@ public enum Flags { public const int VersionFieldNumber = 1; private bool hasVersion; - private uint version_ = 0; + private uint version_; public bool HasVersion { get { return hasVersion; } } @@ -671,27 +810,27 @@ public uint Version { public const int LastPlayedHeroIdFieldNumber = 2; private bool hasLastPlayedHeroId; - private global::D3.OnlineService.EntityId lastPlayedHeroId_ = global::D3.OnlineService.EntityId.DefaultInstance; + private global::D3.OnlineService.EntityId lastPlayedHeroId_; public bool HasLastPlayedHeroId { get { return hasLastPlayedHeroId; } } public global::D3.OnlineService.EntityId LastPlayedHeroId { - get { return lastPlayedHeroId_; } + get { return lastPlayedHeroId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } } public const int BannerConfigurationFieldNumber = 3; private bool hasBannerConfiguration; - private global::D3.Account.BannerConfiguration bannerConfiguration_ = global::D3.Account.BannerConfiguration.DefaultInstance; + private global::D3.Account.BannerConfiguration bannerConfiguration_; public bool HasBannerConfiguration { get { return hasBannerConfiguration; } } public global::D3.Account.BannerConfiguration BannerConfiguration { - get { return bannerConfiguration_; } + get { return bannerConfiguration_ ?? global::D3.Account.BannerConfiguration.DefaultInstance; } } public const int FlagsFieldNumber = 4; private bool hasFlags; - private uint flags_ = 0; + private uint flags_; public bool HasFlags { get { return hasFlags; } } @@ -711,19 +850,20 @@ 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[3], Version); } - if (HasLastPlayedHeroId) { - output.WriteMessage(2, LastPlayedHeroId); + if (hasLastPlayedHeroId) { + output.WriteMessage(2, field_names[2], LastPlayedHeroId); } - if (HasBannerConfiguration) { - output.WriteMessage(3, BannerConfiguration); + if (hasBannerConfiguration) { + output.WriteMessage(3, field_names[0], BannerConfiguration); } - if (HasFlags) { - output.WriteUInt32(4, Flags); + if (hasFlags) { + output.WriteUInt32(4, field_names[1], Flags); } UnknownFields.WriteTo(output); } @@ -735,16 +875,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasVersion) { + if (hasVersion) { size += pb::CodedOutputStream.ComputeUInt32Size(1, Version); } - if (HasLastPlayedHeroId) { + if (hasLastPlayedHeroId) { size += pb::CodedOutputStream.ComputeMessageSize(2, LastPlayedHeroId); } - if (HasBannerConfiguration) { + if (hasBannerConfiguration) { size += pb::CodedOutputStream.ComputeMessageSize(3, BannerConfiguration); } - if (HasFlags) { + if (hasFlags) { size += pb::CodedOutputStream.ComputeUInt32Size(4, Flags); } size += UnknownFields.SerializedSize; @@ -777,38 +917,72 @@ 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() { + return this; + } + public 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 { @@ -820,12 +994,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; } - Digest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -839,6 +1012,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Digest other) { if (other == global::D3.Account.Digest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasVersion) { Version = other.Version; } @@ -855,20 +1029,31 @@ public override Builder MergeFrom(Digest 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(_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)) { @@ -880,16 +1065,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 (HasLastPlayedHeroId) { + if (result.hasLastPlayedHeroId) { subBuilder.MergeFrom(LastPlayedHeroId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -898,7 +1083,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::D3.Account.BannerConfiguration.Builder subBuilder = global::D3.Account.BannerConfiguration.CreateBuilder(); - if (HasBannerConfiguration) { + if (result.hasBannerConfiguration) { subBuilder.MergeFrom(BannerConfiguration); } input.ReadMessage(subBuilder, extensionRegistry); @@ -906,34 +1091,41 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 32: { - Flags = input.ReadUInt32(); + result.hasFlags = input.ReadUInt32(ref result.flags_); 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 HasLastPlayedHeroId { - get { return result.HasLastPlayedHeroId; } + get { return result.hasLastPlayedHeroId; } } public global::D3.OnlineService.EntityId LastPlayedHeroId { get { return result.LastPlayedHeroId; } @@ -941,19 +1133,22 @@ public bool HasLastPlayedHeroId { } 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"); - if (result.HasLastPlayedHeroId && + PrepareBuilder(); + if (result.hasLastPlayedHeroId && result.lastPlayedHeroId_ != global::D3.OnlineService.EntityId.DefaultInstance) { result.lastPlayedHeroId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.lastPlayedHeroId_).MergeFrom(value).BuildPartial(); } else { @@ -963,13 +1158,14 @@ public Builder MergeLastPlayedHeroId(global::D3.OnlineService.EntityId value) { return this; } public Builder ClearLastPlayedHeroId() { + PrepareBuilder(); result.hasLastPlayedHeroId = false; - result.lastPlayedHeroId_ = global::D3.OnlineService.EntityId.DefaultInstance; + result.lastPlayedHeroId_ = null; return this; } public bool HasBannerConfiguration { - get { return result.HasBannerConfiguration; } + get { return result.hasBannerConfiguration; } } public global::D3.Account.BannerConfiguration BannerConfiguration { get { return result.BannerConfiguration; } @@ -977,19 +1173,22 @@ public bool HasBannerConfiguration { } 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"); - if (result.HasBannerConfiguration && + PrepareBuilder(); + if (result.hasBannerConfiguration && result.bannerConfiguration_ != global::D3.Account.BannerConfiguration.DefaultInstance) { result.bannerConfiguration_ = global::D3.Account.BannerConfiguration.CreateBuilder(result.bannerConfiguration_).MergeFrom(value).BuildPartial(); } else { @@ -999,24 +1198,27 @@ public Builder MergeBannerConfiguration(global::D3.Account.BannerConfiguration v return this; } public Builder ClearBannerConfiguration() { + PrepareBuilder(); result.hasBannerConfiguration = false; - result.bannerConfiguration_ = global::D3.Account.BannerConfiguration.DefaultInstance; + result.bannerConfiguration_ = null; 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; @@ -1027,14 +1229,20 @@ static Digest() { } } + [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[] { "crafter_saved_data", "digest", "gold_id", "hardcore_shared_saved_items", "normal_shared_saved_items", "num_public_games_no_kick", "num_vote_kicks_initiated", "num_vote_kicks_participated_in", "saved_attributes", "seen_tutorials", "times_vote_kicked", "version" }; + private static readonly uint[] _savedDefinitionFieldTags = new uint[] { 50, 18, 98, 42, 34, 81, 73, 65, 26, 61, 89, 8 }; public static SavedDefinition DefaultInstance { get { return defaultInstance; } } public override SavedDefinition DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SavedDefinition ThisMessage { @@ -1051,7 +1259,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; } } @@ -1061,52 +1269,52 @@ public uint Version { public const int DigestFieldNumber = 2; private bool hasDigest; - private global::D3.Account.Digest digest_ = global::D3.Account.Digest.DefaultInstance; + private global::D3.Account.Digest digest_; public bool HasDigest { get { return hasDigest; } } public global::D3.Account.Digest Digest { - get { return digest_; } + get { return digest_ ?? global::D3.Account.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 NormalSharedSavedItemsFieldNumber = 4; private bool hasNormalSharedSavedItems; - private global::D3.Items.ItemList normalSharedSavedItems_ = global::D3.Items.ItemList.DefaultInstance; + private global::D3.Items.ItemList normalSharedSavedItems_; public bool HasNormalSharedSavedItems { get { return hasNormalSharedSavedItems; } } public global::D3.Items.ItemList NormalSharedSavedItems { - get { return normalSharedSavedItems_; } + get { return normalSharedSavedItems_ ?? global::D3.Items.ItemList.DefaultInstance; } } public const int HardcoreSharedSavedItemsFieldNumber = 5; private bool hasHardcoreSharedSavedItems; - private global::D3.Items.ItemList hardcoreSharedSavedItems_ = global::D3.Items.ItemList.DefaultInstance; + private global::D3.Items.ItemList hardcoreSharedSavedItems_; public bool HasHardcoreSharedSavedItems { get { return hasHardcoreSharedSavedItems; } } public global::D3.Items.ItemList HardcoreSharedSavedItems { - get { return hardcoreSharedSavedItems_; } + get { return hardcoreSharedSavedItems_ ?? global::D3.Items.ItemList.DefaultInstance; } } public const int CrafterSavedDataFieldNumber = 6; private bool hasCrafterSavedData; - private global::D3.ItemCrafting.CrafterSavedData crafterSavedData_ = global::D3.ItemCrafting.CrafterSavedData.DefaultInstance; + private global::D3.ItemCrafting.CrafterSavedData crafterSavedData_; public bool HasCrafterSavedData { get { return hasCrafterSavedData; } } public global::D3.ItemCrafting.CrafterSavedData CrafterSavedData { - get { return crafterSavedData_; } + get { return crafterSavedData_ ?? global::D3.ItemCrafting.CrafterSavedData.DefaultInstance; } } public const int SeenTutorialsFieldNumber = 7; @@ -1121,6 +1329,56 @@ public int GetSeenTutorials(int index) { return seenTutorials_[index]; } + public const int NumVoteKicksParticipatedInFieldNumber = 8; + private bool hasNumVoteKicksParticipatedIn; + private long numVoteKicksParticipatedIn_; + public bool HasNumVoteKicksParticipatedIn { + get { return hasNumVoteKicksParticipatedIn; } + } + public long NumVoteKicksParticipatedIn { + get { return numVoteKicksParticipatedIn_; } + } + + public const int NumVoteKicksInitiatedFieldNumber = 9; + private bool hasNumVoteKicksInitiated; + private long numVoteKicksInitiated_; + public bool HasNumVoteKicksInitiated { + get { return hasNumVoteKicksInitiated; } + } + public long NumVoteKicksInitiated { + get { return numVoteKicksInitiated_; } + } + + public const int NumPublicGamesNoKickFieldNumber = 10; + private bool hasNumPublicGamesNoKick; + private long numPublicGamesNoKick_; + public bool HasNumPublicGamesNoKick { + get { return hasNumPublicGamesNoKick; } + } + public long NumPublicGamesNoKick { + get { return numPublicGamesNoKick_; } + } + + public const int TimesVoteKickedFieldNumber = 11; + private bool hasTimesVoteKicked; + private long timesVoteKicked_; + public bool HasTimesVoteKicked { + get { return hasTimesVoteKicked; } + } + public long TimesVoteKicked { + get { return timesVoteKicked_; } + } + + public const int GoldIdFieldNumber = 12; + private bool hasGoldId; + private global::D3.OnlineService.EntityId goldId_; + public bool HasGoldId { + get { return hasGoldId; } + } + public global::D3.OnlineService.EntityId GoldId { + get { return goldId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } + } + public override bool IsInitialized { get { if (!hasVersion) return false; @@ -1138,34 +1396,51 @@ public override bool IsInitialized { if (HasCrafterSavedData) { if (!CrafterSavedData.IsInitialized) return false; } + if (HasGoldId) { + if (!GoldId.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); + string[] field_names = _savedDefinitionFieldNames; + if (hasVersion) { + output.WriteUInt32(1, field_names[11], Version); } - if (HasDigest) { - output.WriteMessage(2, Digest); + if (hasDigest) { + output.WriteMessage(2, field_names[1], Digest); } - if (HasSavedAttributes) { - output.WriteMessage(3, SavedAttributes); + if (hasSavedAttributes) { + output.WriteMessage(3, field_names[8], SavedAttributes); } - if (HasNormalSharedSavedItems) { - output.WriteMessage(4, NormalSharedSavedItems); + if (hasNormalSharedSavedItems) { + output.WriteMessage(4, field_names[4], NormalSharedSavedItems); } - if (HasHardcoreSharedSavedItems) { - output.WriteMessage(5, HardcoreSharedSavedItems); + if (hasHardcoreSharedSavedItems) { + output.WriteMessage(5, field_names[3], HardcoreSharedSavedItems); } - if (HasCrafterSavedData) { - output.WriteMessage(6, CrafterSavedData); + if (hasCrafterSavedData) { + output.WriteMessage(6, field_names[0], CrafterSavedData); } if (seenTutorials_.Count > 0) { - foreach (int element in seenTutorials_) { - output.WriteSFixed32(7, element); - } + output.WriteSFixed32Array(7, field_names[9], seenTutorials_); + } + if (hasNumVoteKicksParticipatedIn) { + output.WriteSFixed64(8, field_names[7], NumVoteKicksParticipatedIn); + } + if (hasNumVoteKicksInitiated) { + output.WriteSFixed64(9, field_names[6], NumVoteKicksInitiated); + } + if (hasNumPublicGamesNoKick) { + output.WriteSFixed64(10, field_names[5], NumPublicGamesNoKick); + } + if (hasTimesVoteKicked) { + output.WriteSFixed64(11, field_names[10], TimesVoteKicked); + } + if (hasGoldId) { + output.WriteMessage(12, field_names[2], GoldId); } UnknownFields.WriteTo(output); } @@ -1177,22 +1452,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 (HasNormalSharedSavedItems) { + if (hasNormalSharedSavedItems) { size += pb::CodedOutputStream.ComputeMessageSize(4, NormalSharedSavedItems); } - if (HasHardcoreSharedSavedItems) { + if (hasHardcoreSharedSavedItems) { size += pb::CodedOutputStream.ComputeMessageSize(5, HardcoreSharedSavedItems); } - if (HasCrafterSavedData) { + if (hasCrafterSavedData) { size += pb::CodedOutputStream.ComputeMessageSize(6, CrafterSavedData); } { @@ -1201,6 +1476,21 @@ public override int SerializedSize { size += dataSize; size += 1 * seenTutorials_.Count; } + if (hasNumVoteKicksParticipatedIn) { + size += pb::CodedOutputStream.ComputeSFixed64Size(8, NumVoteKicksParticipatedIn); + } + if (hasNumVoteKicksInitiated) { + size += pb::CodedOutputStream.ComputeSFixed64Size(9, NumVoteKicksInitiated); + } + if (hasNumPublicGamesNoKick) { + size += pb::CodedOutputStream.ComputeSFixed64Size(10, NumPublicGamesNoKick); + } + if (hasTimesVoteKicked) { + size += pb::CodedOutputStream.ComputeSFixed64Size(11, TimesVoteKicked); + } + if (hasGoldId) { + size += pb::CodedOutputStream.ComputeMessageSize(12, GoldId); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -1231,38 +1521,73 @@ 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() { + seenTutorials_.MakeReadOnly(); + return this; + } + public 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 { @@ -1274,13 +1599,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.seenTutorials_.MakeReadOnly(); - SavedDefinition returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1294,6 +1617,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SavedDefinition other) { if (other == global::D3.Account.SavedDefinition.DefaultInstance) return this; + PrepareBuilder(); if (other.HasVersion) { Version = other.Version; } @@ -1313,26 +1637,52 @@ public override Builder MergeFrom(SavedDefinition other) { MergeCrafterSavedData(other.CrafterSavedData); } if (other.seenTutorials_.Count != 0) { - base.AddRange(other.seenTutorials_, result.seenTutorials_); + result.seenTutorials_.Add(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.HasGoldId) { + MergeGoldId(other.GoldId); } 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)) { @@ -1344,16 +1694,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.Account.Digest.Builder subBuilder = global::D3.Account.Digest.CreateBuilder(); - if (HasDigest) { + if (result.hasDigest) { subBuilder.MergeFrom(Digest); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1362,7 +1712,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); @@ -1371,7 +1721,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 34: { global::D3.Items.ItemList.Builder subBuilder = global::D3.Items.ItemList.CreateBuilder(); - if (HasNormalSharedSavedItems) { + if (result.hasNormalSharedSavedItems) { subBuilder.MergeFrom(NormalSharedSavedItems); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1380,7 +1730,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 42: { global::D3.Items.ItemList.Builder subBuilder = global::D3.Items.ItemList.CreateBuilder(); - if (HasHardcoreSharedSavedItems) { + if (result.hasHardcoreSharedSavedItems) { subBuilder.MergeFrom(HardcoreSharedSavedItems); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1389,42 +1739,75 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 50: { global::D3.ItemCrafting.CrafterSavedData.Builder subBuilder = global::D3.ItemCrafting.CrafterSavedData.CreateBuilder(); - if (HasCrafterSavedData) { + if (result.hasCrafterSavedData) { subBuilder.MergeFrom(CrafterSavedData); } input.ReadMessage(subBuilder, extensionRegistry); CrafterSavedData = subBuilder.BuildPartial(); break; } + case 58: case 61: { - AddSeenTutorials(input.ReadSFixed32()); + input.ReadSFixed32Array(tag, field_name, result.seenTutorials_); + break; + } + case 65: { + result.hasNumVoteKicksParticipatedIn = input.ReadSFixed64(ref result.numVoteKicksParticipatedIn_); + break; + } + case 73: { + result.hasNumVoteKicksInitiated = input.ReadSFixed64(ref result.numVoteKicksInitiated_); + break; + } + case 81: { + result.hasNumPublicGamesNoKick = input.ReadSFixed64(ref result.numPublicGamesNoKick_); + break; + } + case 89: { + result.hasTimesVoteKicked = input.ReadSFixed64(ref result.timesVoteKicked_); + break; + } + case 98: { + global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); + if (result.hasGoldId) { + subBuilder.MergeFrom(GoldId); + } + input.ReadMessage(subBuilder, extensionRegistry); + GoldId = subBuilder.BuildPartial(); 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.Account.Digest Digest { get { return result.Digest; } @@ -1432,19 +1815,22 @@ public bool HasDigest { } 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"); - if (result.HasDigest && + PrepareBuilder(); + if (result.hasDigest && result.digest_ != global::D3.Account.Digest.DefaultInstance) { result.digest_ = global::D3.Account.Digest.CreateBuilder(result.digest_).MergeFrom(value).BuildPartial(); } else { @@ -1454,13 +1840,14 @@ public Builder MergeDigest(global::D3.Account.Digest value) { return this; } public Builder ClearDigest() { + PrepareBuilder(); result.hasDigest = false; - result.digest_ = global::D3.Account.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; } @@ -1468,19 +1855,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 { @@ -1490,13 +1880,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 HasNormalSharedSavedItems { - get { return result.HasNormalSharedSavedItems; } + get { return result.hasNormalSharedSavedItems; } } public global::D3.Items.ItemList NormalSharedSavedItems { get { return result.NormalSharedSavedItems; } @@ -1504,19 +1895,22 @@ public bool HasNormalSharedSavedItems { } 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"); - if (result.HasNormalSharedSavedItems && + PrepareBuilder(); + if (result.hasNormalSharedSavedItems && result.normalSharedSavedItems_ != global::D3.Items.ItemList.DefaultInstance) { result.normalSharedSavedItems_ = global::D3.Items.ItemList.CreateBuilder(result.normalSharedSavedItems_).MergeFrom(value).BuildPartial(); } else { @@ -1526,13 +1920,14 @@ public Builder MergeNormalSharedSavedItems(global::D3.Items.ItemList value) { return this; } public Builder ClearNormalSharedSavedItems() { + PrepareBuilder(); result.hasNormalSharedSavedItems = false; - result.normalSharedSavedItems_ = global::D3.Items.ItemList.DefaultInstance; + result.normalSharedSavedItems_ = null; return this; } public bool HasHardcoreSharedSavedItems { - get { return result.HasHardcoreSharedSavedItems; } + get { return result.hasHardcoreSharedSavedItems; } } public global::D3.Items.ItemList HardcoreSharedSavedItems { get { return result.HardcoreSharedSavedItems; } @@ -1540,19 +1935,22 @@ public bool HasHardcoreSharedSavedItems { } 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"); - if (result.HasHardcoreSharedSavedItems && + PrepareBuilder(); + if (result.hasHardcoreSharedSavedItems && result.hardcoreSharedSavedItems_ != global::D3.Items.ItemList.DefaultInstance) { result.hardcoreSharedSavedItems_ = global::D3.Items.ItemList.CreateBuilder(result.hardcoreSharedSavedItems_).MergeFrom(value).BuildPartial(); } else { @@ -1562,13 +1960,14 @@ public Builder MergeHardcoreSharedSavedItems(global::D3.Items.ItemList value) { return this; } public Builder ClearHardcoreSharedSavedItems() { + PrepareBuilder(); result.hasHardcoreSharedSavedItems = false; - result.hardcoreSharedSavedItems_ = global::D3.Items.ItemList.DefaultInstance; + result.hardcoreSharedSavedItems_ = null; return this; } public bool HasCrafterSavedData { - get { return result.HasCrafterSavedData; } + get { return result.hasCrafterSavedData; } } public global::D3.ItemCrafting.CrafterSavedData CrafterSavedData { get { return result.CrafterSavedData; } @@ -1576,19 +1975,22 @@ public bool HasCrafterSavedData { } public Builder SetCrafterSavedData(global::D3.ItemCrafting.CrafterSavedData value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasCrafterSavedData = true; result.crafterSavedData_ = value; return this; } public Builder SetCrafterSavedData(global::D3.ItemCrafting.CrafterSavedData.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasCrafterSavedData && result.crafterSavedData_ != global::D3.ItemCrafting.CrafterSavedData.DefaultInstance) { result.crafterSavedData_ = global::D3.ItemCrafting.CrafterSavedData.CreateBuilder(result.crafterSavedData_).MergeFrom(value).BuildPartial(); } else { @@ -1598,13 +2000,14 @@ public Builder MergeCrafterSavedData(global::D3.ItemCrafting.CrafterSavedData va return this; } public Builder ClearCrafterSavedData() { + PrepareBuilder(); result.hasCrafterSavedData = false; - result.crafterSavedData_ = global::D3.ItemCrafting.CrafterSavedData.DefaultInstance; + result.crafterSavedData_ = null; return this; } public pbc::IPopsicleList SeenTutorialsList { - get { return result.seenTutorials_; } + get { return PrepareBuilder().seenTutorials_; } } public int SeenTutorialsCount { get { return result.SeenTutorialsCount; } @@ -1613,21 +2016,145 @@ public int GetSeenTutorials(int index) { return result.GetSeenTutorials(index); } public Builder SetSeenTutorials(int index, int value) { + PrepareBuilder(); result.seenTutorials_[index] = value; return this; } public Builder AddSeenTutorials(int value) { + PrepareBuilder(); result.seenTutorials_.Add(value); return this; } public Builder AddRangeSeenTutorials(scg::IEnumerable values) { - base.AddRange(values, result.seenTutorials_); + PrepareBuilder(); + result.seenTutorials_.Add(values); return this; } public Builder ClearSeenTutorials() { + PrepareBuilder(); result.seenTutorials_.Clear(); 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 HasGoldId { + get { return result.hasGoldId; } + } + public global::D3.OnlineService.EntityId GoldId { + get { return result.GoldId; } + set { SetGoldId(value); } + } + public Builder SetGoldId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGoldId = true; + result.goldId_ = value; + return this; + } + public Builder SetGoldId(global::D3.OnlineService.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGoldId = true; + result.goldId_ = builderForValue.Build(); + return this; + } + public Builder MergeGoldId(global::D3.OnlineService.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGoldId && + result.goldId_ != global::D3.OnlineService.EntityId.DefaultInstance) { + result.goldId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.goldId_).MergeFrom(value).BuildPartial(); + } else { + result.goldId_ = value; + } + result.hasGoldId = true; + return this; + } + public Builder ClearGoldId() { + PrepareBuilder(); + result.hasGoldId = false; + result.goldId_ = null; + return this; + } } static SavedDefinition() { object.ReferenceEquals(global::D3.Account.Account.Descriptor, null); @@ -1637,3 +2164,5 @@ static SavedDefinition() { #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/Client/Settings.cs b/src/LibMooNet/D3/Client/Settings.cs new file mode 100644 index 00000000..c13b4061 --- /dev/null +++ b/src/LibMooNet/D3/Client/Settings.cs @@ -0,0 +1,1108 @@ +// 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_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" + + "Cgh1aV9mbGFncxgBIAEoDToBMCJuChNHYW1lQWNjb3VudFNldHRpbmdzEhgK" + + "DXVzZV9sYXN0X2hlcm8YASABKAU6ATASHQoSc2hvd19vZmZsaW5lX3RvYXN0" + + "GAIgASgFOgEwEh4KFnJtdF9sYXN0X3VzZWRfY3VycmVuY3kYAyABKAkiSQoL" + + "UHJlZmVyZW5jZXMSDQoFa2V5XzEYASABKAUSDQoFa2V5XzIYAiABKAUSDQoF" + + "a2V5XzMYAyABKAUSDQoFa2V5XzQYBCABKAU="); + 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", "RmtLastUsedCurrency", }); + internal__static_D3_Client_Preferences__Descriptor = Descriptor.MessageTypes[2]; + internal__static_D3_Client_Preferences__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Client_Preferences__Descriptor, + new string[] { "Key1", "Key2", "Key3", "Key4", }); + 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 GameAccountSettings : pb::GeneratedMessage { + private GameAccountSettings() { } + private static readonly GameAccountSettings defaultInstance = new GameAccountSettings().MakeReadOnly(); + private static readonly string[] _gameAccountSettingsFieldNames = new string[] { "rmt_last_used_currency", "show_offline_toast", "use_last_hero" }; + private static readonly uint[] _gameAccountSettingsFieldTags = new uint[] { 26, 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 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[2], UseLastHero); + } + if (hasShowOfflineToast) { + output.WriteInt32(2, field_names[1], ShowOfflineToast); + } + if (hasRmtLastUsedCurrency) { + output.WriteString(3, field_names[0], RmtLastUsedCurrency); + } + 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); + } + 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() { + return this; + } + + public 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; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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; + } + } + 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[] { "key_1", "key_2", "key_3", "key_4" }; + private static readonly uint[] _preferencesFieldTags = new uint[] { 8, 16, 24, 32 }; + 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; } + } + + public const int Key1FieldNumber = 1; + private bool hasKey1; + private int key1_; + public bool HasKey1 { + get { return hasKey1; } + } + public int Key1 { + get { return key1_; } + } + + public const int Key2FieldNumber = 2; + private bool hasKey2; + private int key2_; + public bool HasKey2 { + get { return hasKey2; } + } + public int Key2 { + get { return key2_; } + } + + public const int Key3FieldNumber = 3; + private bool hasKey3; + private int key3_; + public bool HasKey3 { + get { return hasKey3; } + } + public int Key3 { + get { return key3_; } + } + + public const int Key4FieldNumber = 4; + private bool hasKey4; + private int key4_; + public bool HasKey4 { + get { return hasKey4; } + } + public int Key4 { + get { return key4_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _preferencesFieldNames; + if (hasKey1) { + output.WriteInt32(1, field_names[0], Key1); + } + if (hasKey2) { + output.WriteInt32(2, field_names[1], Key2); + } + if (hasKey3) { + output.WriteInt32(3, field_names[2], Key3); + } + if (hasKey4) { + output.WriteInt32(4, field_names[3], Key4); + } + 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 (hasKey2) { + size += pb::CodedOutputStream.ComputeInt32Size(2, Key2); + } + if (hasKey3) { + size += pb::CodedOutputStream.ComputeInt32Size(3, Key3); + } + if (hasKey4) { + size += pb::CodedOutputStream.ComputeInt32Size(4, Key4); + } + 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.HasKey1) { + Key1 = other.Key1; + } + if (other.HasKey2) { + Key2 = other.Key2; + } + if (other.HasKey3) { + Key3 = other.Key3; + } + if (other.HasKey4) { + Key4 = other.Key4; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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.hasKey1 = input.ReadInt32(ref result.key1_); + break; + } + case 16: { + result.hasKey2 = input.ReadInt32(ref result.key2_); + break; + } + case 24: { + result.hasKey3 = input.ReadInt32(ref result.key3_); + break; + } + case 32: { + result.hasKey4 = input.ReadInt32(ref result.key4_); + 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_ = 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_ = 0; + return this; + } + + public bool HasKey3 { + get { return result.hasKey3; } + } + public int Key3 { + get { return result.Key3; } + set { SetKey3(value); } + } + public Builder SetKey3(int value) { + PrepareBuilder(); + result.hasKey3 = true; + result.key3_ = value; + return this; + } + public Builder ClearKey3() { + PrepareBuilder(); + result.hasKey3 = false; + result.key3_ = 0; + return this; + } + + public bool HasKey4 { + get { return result.hasKey4; } + } + public int Key4 { + get { return result.Key4; } + set { SetKey4(value); } + } + public Builder SetKey4(int value) { + PrepareBuilder(); + result.hasKey4 = true; + result.key4_ = value; + return this; + } + public Builder ClearKey4() { + PrepareBuilder(); + result.hasKey4 = false; + result.key4_ = 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..989a772d --- /dev/null +++ b/src/LibMooNet/D3/GameMessage/GameMessage.cs @@ -0,0 +1,5325 @@ +// 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_SetAchievementShowcase__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_D3_GameMessage_SetAchievementShowcase__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" + + "dW50LnByb3RvGgtJdGVtcy5wcm90byJmCg5IZXJvRGlnZXN0TGlzdBIuCgph" + + "Y2NvdW50X2lkGAEgAigLMhouRDMuT25saW5lU2VydmljZS5FbnRpdHlJZBIk" + + "CgtkaWdlc3RfbGlzdBgCIAMoCzIPLkQzLkhlcm8uRGlnZXN0IngKEkNsaWVu" + + "dFRvb25TZXR0aW5ncxIrCgd0b29uX2lkGAEgAigLMhouRDMuT25saW5lU2Vy" + + "dmljZS5FbnRpdHlJZBI1ChRjbGllbnRfdG9vbl9zZXR0aW5ncxgCIAIoCzIX" + + "LkQzLkNsaWVudC5Ub29uU2V0dGluZ3MiRAoVSGVyb0RpZ2VzdExpc3RSZXF1" + + "ZXN0EisKB3Rvb25faWQYASADKAsyGi5EMy5PbmxpbmVTZXJ2aWNlLkVudGl0" + + "eUlkIngKEkhlcm9EaWdlc3RSZXNwb25zZRIrCgd0b29uX2lkGAEgAigLMhou" + + "RDMuT25saW5lU2VydmljZS5FbnRpdHlJZBIPCgdzdWNjZXNzGAIgAigIEiQK" + + "C2hlcm9fZGlnZXN0GAMgASgLMg8uRDMuSGVyby5EaWdlc3QiUQoWSGVyb0Rp" + + "Z2VzdExpc3RSZXNwb25zZRI3CgtkaWdlc3RfbGlzdBgBIAMoCzIiLkQzLkdh" + + "bWVNZXNzYWdlLkhlcm9EaWdlc3RSZXNwb25zZSJVCgxQbGF5ZXJCYW5uZXIS" + + "FAoMcGxheWVyX2luZGV4GAEgAigNEi8KBmJhbm5lchgCIAIoCzIfLkQzLkFj" + + "Y291bnQuQmFubmVyQ29uZmlndXJhdGlvbiJ8ChdTYXZlQmFubmVyQ29uZmln" + + "dXJhdGlvbhIvCgZiYW5uZXIYASACKAsyHy5EMy5BY2NvdW50LkJhbm5lckNv" + + "bmZpZ3VyYXRpb24SFQoKc2xvdF9pbmRleBgCIAEoDToBMBIZCgttYWtlX2Fj" + + "dGl2ZRgDIAEoCDoEdHJ1ZSJpChBIZXJvRGlnZXN0QmFubmVyEiQKC2hlcm9f" + + "ZGlnZXN0GAEgAigLMg8uRDMuSGVyby5EaWdlc3QSLwoGYmFubmVyGAIgAigL" + + "Mh8uRDMuQWNjb3VudC5CYW5uZXJDb25maWd1cmF0aW9uIkcKEkdhbWVDdXJy" + + "ZW50UGxheWVycxIxCgdwbGF5ZXJzGAEgAygLMiAuRDMuR2FtZU1lc3NhZ2Uu" + + "SGVyb0RpZ2VzdEJhbm5lciJEChJBY2NvdW50VmVyc2lvbkxpc3QSLgoKYWNj" + + "b3VudF9pZBgBIAIoCzIaLkQzLk9ubGluZVNlcnZpY2UuRW50aXR5SWQiVQoS" + + "QWNjb3VudFZlcnNpb25TeW5jEi4KCmFjY291bnRfaWQYASACKAsyGi5EMy5P" + + "bmxpbmVTZXJ2aWNlLkVudGl0eUlkEg8KB3ZlcnNpb24YAiACKAQiQwoKVG9v" + + "bHRpcElkcxIOCgZsb2NhbGUYASACKA0SJQoDaWRzGAIgAygLMhguRDMuT25s" + + "aW5lU2VydmljZS5JdGVtSWQiRgoRVG9vbHRpcEdlbmVyYXRvcnMSDgoGbG9j" + + "YWxlGAEgAigNEiEKBWl0ZW1zGAIgAigLMhIuRDMuSXRlbXMuSXRlbUxpc3Qi" + + "PwoPVHV0b3JpYWxNZXNzYWdlEhQKDHR1dG9yaWFsX3NubxgBIAIoDRIWCg51" + + "aV9hbmNob3JfbmFtZRgCIAEoCSI+ChZTZXRBY2hpZXZlbWVudFNob3djYXNl" + + "EhYKDmFjaGlldmVtZW50X2lkGAEgAigEEgwKBHNsb3QYAiACKA0="); + 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", }); + 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", }); + 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_SetAchievementShowcase__Descriptor = Descriptor.MessageTypes[14]; + internal__static_D3_GameMessage_SetAchievementShowcase__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_GameMessage_SetAchievementShowcase__Descriptor, + new string[] { "AchievementId", "Slot", }); + 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, + }, 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[] { "toon_id" }; + private static readonly uint[] _heroDigestListRequestFieldTags = new uint[] { 10 }; + 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::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _heroDigestListRequestFieldNames; + if (toonId_.Count > 0) { + output.WriteMessageArray(1, field_names[0], 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::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::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.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: { + input.ReadMessageArray(tag, field_name, result.toonId_, global::D3.OnlineService.EntityId.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + 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" }; + private static readonly uint[] _accountVersionListFieldTags = new uint[] { 10 }; + 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 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); + } + 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 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); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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 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 SetAchievementShowcase : pb::GeneratedMessage { + private SetAchievementShowcase() { } + private static readonly SetAchievementShowcase defaultInstance = new SetAchievementShowcase().MakeReadOnly(); + private static readonly string[] _setAchievementShowcaseFieldNames = new string[] { "achievement_id", "slot" }; + private static readonly uint[] _setAchievementShowcaseFieldTags = new uint[] { 8, 16 }; + public static SetAchievementShowcase DefaultInstance { + get { return defaultInstance; } + } + + public override SetAchievementShowcase DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SetAchievementShowcase ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_SetAchievementShowcase__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::D3.GameMessage.GameMessage.internal__static_D3_GameMessage_SetAchievementShowcase__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 SlotFieldNumber = 2; + private bool hasSlot; + private uint slot_; + public bool HasSlot { + get { return hasSlot; } + } + public uint Slot { + get { return slot_; } + } + + public override bool IsInitialized { + get { + if (!hasAchievementId) return false; + if (!hasSlot) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _setAchievementShowcaseFieldNames; + if (hasAchievementId) { + output.WriteUInt64(1, field_names[0], AchievementId); + } + if (hasSlot) { + output.WriteUInt32(2, field_names[1], Slot); + } + 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 (hasSlot) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Slot); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static SetAchievementShowcase ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SetAchievementShowcase ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SetAchievementShowcase ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SetAchievementShowcase ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SetAchievementShowcase ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SetAchievementShowcase ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SetAchievementShowcase ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SetAchievementShowcase ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SetAchievementShowcase ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SetAchievementShowcase ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SetAchievementShowcase MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SetAchievementShowcase prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SetAchievementShowcase cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SetAchievementShowcase result; + + private SetAchievementShowcase PrepareBuilder() { + if (resultIsReadOnly) { + SetAchievementShowcase original = result; + result = new SetAchievementShowcase(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SetAchievementShowcase MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.SetAchievementShowcase.Descriptor; } + } + + public override SetAchievementShowcase DefaultInstanceForType { + get { return global::D3.GameMessage.SetAchievementShowcase.DefaultInstance; } + } + + public override SetAchievementShowcase BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SetAchievementShowcase) { + return MergeFrom((SetAchievementShowcase) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SetAchievementShowcase other) { + if (other == global::D3.GameMessage.SetAchievementShowcase.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAchievementId) { + AchievementId = other.AchievementId; + } + if (other.HasSlot) { + Slot = other.Slot; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_setAchievementShowcaseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _setAchievementShowcaseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.hasSlot = input.ReadUInt32(ref result.slot_); + 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 HasSlot { + get { return result.hasSlot; } + } + public uint Slot { + get { return result.Slot; } + set { SetSlot(value); } + } + public Builder SetSlot(uint value) { + PrepareBuilder(); + result.hasSlot = true; + result.slot_ = value; + return this; + } + public Builder ClearSlot() { + PrepareBuilder(); + result.hasSlot = false; + result.slot_ = 0; + return this; + } + } + static SetAchievementShowcase() { + 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 65% rename from source/D3Proto/D3/Hero/Hero.cs rename to src/LibMooNet/D3/Hero/Hero.cs index bc90c6f7..8fdc4b3e 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 @@ -47,6 +52,8 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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; #endregion #region Descriptor public static pbd::FileDescriptor Descriptor { @@ -58,58 +65,62 @@ 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" + + "Y2UucHJvdG8iagoKVmlzdWFsSXRlbRIQCgRnYmlkGAEgASgPOgItMRITCghk" + + "eWVfdHlwZRgCIAEoEToBMBIbChBpdGVtX2VmZmVjdF90eXBlGAMgASgROgEw" + + "EhgKDGVmZmVjdF9sZXZlbBgEIAEoEToCLTEiOwoPVmlzdWFsRXF1aXBtZW50" + + "EigKC3Zpc3VhbF9pdGVtGAEgAygLMhMuRDMuSGVyby5WaXN1YWxJdGVtIkEK" + + "EVF1ZXN0SGlzdG9yeUVudHJ5EhUKCXNub19xdWVzdBgBIAIoDzoCLTESFQoK" + + "ZGlmZmljdWx0eRgCIAIoEToBMCJdChdRdWVzdFJld2FyZEhpc3RvcnlFbnRy" + + "eRIVCglzbm9fcXVlc3QYASACKA86Ai0xEhQKCHN0ZXBfdWlkGAIgAigROgIt" + + "MRIVCgpkaWZmaWN1bHR5GAMgAigROgEwIsgDCgZEaWdlc3QSDwoHdmVyc2lv" + + "bhgBIAIoDRIrCgdoZXJvX2lkGAIgAigLMhouRDMuT25saW5lU2VydmljZS5F" + + "bnRpdHlJZBIRCgloZXJvX25hbWUYAyABKAkSEgoKZ2JpZF9jbGFzcxgEIAIo" + + "DxINCgVsZXZlbBgFIAIoERIUCgxwbGF5ZXJfZmxhZ3MYBiACKA0SMgoQdmlz" + + "dWFsX2VxdWlwbWVudBgHIAIoCzIYLkQzLkhlcm8uVmlzdWFsRXF1aXBtZW50" + + "EjEKDXF1ZXN0X2hpc3RvcnkYCCADKAsyGi5EMy5IZXJvLlF1ZXN0SGlzdG9y" + + "eUVudHJ5EhcKD2xhc3RfcGxheWVkX2FjdBgKIAIoERIcChRoaWdoZXN0X3Vu" + + "bG9ja2VkX2FjdBgLIAIoERIeChZsYXN0X3BsYXllZF9kaWZmaWN1bHR5GAwg" + + "AigREiMKG2hpZ2hlc3RfdW5sb2NrZWRfZGlmZmljdWx0eRgNIAIoERIZChFs" + + "YXN0X3BsYXllZF9xdWVzdBgOIAIoDxIeChZsYXN0X3BsYXllZF9xdWVzdF9z" + + "dGVwGA8gAigREhYKC3RpbWVfcGxheWVkGBAgAigNOgEwIkAKEEhvdGJhckJ1" + + "dHRvbkRhdGESFQoJc25vX3Bvd2VyGAEgAigPOgItMRIVCglnYmlkX2l0ZW0Y" + + "AiACKA86Ai0xIlgKD1NraWxsS2V5TWFwcGluZxIVCglzbm9fcG93ZXIYASAC" + + "KA86Ai0xEhUKCWlkX2hvdGtleRgCIAIoEToCLTESFwoMc2tpbGxfYnV0dG9u" + + "GAMgAigROgEwIpoBCgpTYXZlZFF1ZXN0EhUKCXNub19xdWVzdBgBIAIoDzoC" + + "LTESFQoKZGlmZmljdWx0eRgCIAIoEToBMBIcChBjdXJyZW50X3N0ZXBfdWlk" + + "GAMgAigROgItMRIbCg9vYmplY3RpdmVfc3RhdGUYBCADKBFCAhABEiMKF2Zh" + + "aWx1cmVfY29uZGl0aW9uX3N0YXRlGAUgAygRQgIQASInCgtMZWFybmVkTG9y" + + "ZRIYChBzbm9fbG9yZV9sZWFybmVkGAEgAygPIlwKElNhdmVkQ29udmVyc2F0" + + "aW9ucxIlCh1wbGF5ZWRfY29udmVyc2F0aW9uc19iaXRmaWVsZBgBIAIoDBIf" + + "Chdzbm9fc2F2ZWRfY29udmVyc2F0aW9ucxgCIAMoDyJlChNTYXZlUG9pbnRE" + + "YXRhX1Byb3RvEhUKCXNub193b3JsZBgBIAIoDzoCLTESHAoQc2F2ZXBvaW50" + + "X251bWJlchgCIAIoEToCLTESGQoOY3JlYXRlc19wb3J0YWwYAyACKA06ATAi" + + "4gMKCVNhdmVkRGF0YRI8Chlob3RiYXJfYnV0dG9uX2Fzc2lnbm1lbnRzGAEg" + + "AygLMhkuRDMuSGVyby5Ib3RiYXJCdXR0b25EYXRhEi8KDXNraWxsX2tleV9t" + + "YXAYAiADKAsyGC5EMy5IZXJvLlNraWxsS2V5TWFwcGluZxIWCgt0aW1lX3Bs" + + "YXllZBgDIAIoDToBMBIeChNhY3RpdmF0ZWRfd2F5cG9pbnRzGAQgAigNOgEw" + "EjMKE2hpcmVsaW5nX3NhdmVkX2RhdGEYBSACKAsyFi5EMy5IaXJlbGluZy5T" + - "YXZlZERhdGESFwoPbGFzdF9sZXZlbF90aW1lGAYgAigNEioKDGxlYXJuZWRf" + - "bG9yZRgHIAIoCzIULkQzLkhlcm8uTGVhcm5lZExvcmUSOAoTc2F2ZWRfY29u" + - "dmVyc2F0aW9ucxgIIAIoCzIbLkQzLkhlcm8uU2F2ZWRDb252ZXJzYXRpb25z" + - "EhkKEXNub19hY3RpdmVfc2tpbGxzGAkgAygPEhIKCnNub190cmFpdHMYCiAD" + - "KA8SFgoOc2Vlbl90dXRvcmlhbHMYCyADKA8SMAoKc2F2ZV9wb2ludBgMIAIo" + - "CzIcLkQzLkhlcm8uU2F2ZVBvaW50RGF0YV9Qcm90byI2CgpUaW1lc3RhbXBz" + - "EhMKC2NyZWF0ZV90aW1lGAEgAigSEhMKC2RlbGV0ZV90aW1lGAIgASgSIrsC" + - "Cg9TYXZlZERlZmluaXRpb24SDwoHdmVyc2lvbhgBIAIoDRIfCgZkaWdlc3QY" + - "AiABKAsyDy5EMy5IZXJvLkRpZ2VzdBJBChBzYXZlZF9hdHRyaWJ1dGVzGAMg" + - "AigLMicuRDMuQXR0cmlidXRlU2VyaWFsaXplci5TYXZlZEF0dHJpYnV0ZXMS" + - "JgoKc2F2ZWRfZGF0YRgEIAEoCzISLkQzLkhlcm8uU2F2ZWREYXRhEigKC3Nh" + - "dmVkX3F1ZXN0GAUgAygLMhMuRDMuSGVyby5TYXZlZFF1ZXN0EiEKBWl0ZW1z" + - "GAYgASgLMhIuRDMuSXRlbXMuSXRlbUxpc3QSPgoUcXVlc3RfcmV3YXJkX2hp" + - "c3RvcnkYByADKAsyIC5EMy5IZXJvLlF1ZXN0UmV3YXJkSGlzdG9yeUVudHJ5" + - "IiAKDE5hbWVTZXF1ZW5jZRIQCghzZXF1ZW5jZRgBIAEoAyIYCghOYW1lVGV4" + - "dBIMCgRuYW1lGAEgAigJIncKBkVzY3JvdxIPCgd2ZXJzaW9uGAEgAigNEiYK" + - "CWdlbmVyYXRvchgCIAEoCzITLkQzLkl0ZW1zLkdlbmVyYXRvchIlCgloZXJv" + - "X2RhdGEYAyABKAsyEi5EMy5IZXJvLlNhdmVkRGF0YRINCgVzdGF0ZRgEIAEo" + - "DQ=="); + "YXZlZERhdGESGgoPbGFzdF9sZXZlbF90aW1lGAYgAigNOgEwEioKDGxlYXJu" + + "ZWRfbG9yZRgHIAIoCzIULkQzLkhlcm8uTGVhcm5lZExvcmUSOAoTc2F2ZWRf" + + "Y29udmVyc2F0aW9ucxgIIAIoCzIbLkQzLkhlcm8uU2F2ZWRDb252ZXJzYXRp" + + "b25zEhkKEXNub19hY3RpdmVfc2tpbGxzGAkgAygPEhIKCnNub190cmFpdHMY" + + "CiADKA8SFgoOc2Vlbl90dXRvcmlhbHMYCyADKA8SMAoKc2F2ZV9wb2ludBgM" + + "IAIoCzIcLkQzLkhlcm8uU2F2ZVBvaW50RGF0YV9Qcm90byI2CgpUaW1lc3Rh" + + "bXBzEhMKC2NyZWF0ZV90aW1lGAEgAigSEhMKC2RlbGV0ZV90aW1lGAIgASgS" + + "IrsCCg9TYXZlZERlZmluaXRpb24SDwoHdmVyc2lvbhgBIAIoDRIfCgZkaWdl" + + "c3QYAiABKAsyDy5EMy5IZXJvLkRpZ2VzdBJBChBzYXZlZF9hdHRyaWJ1dGVz" + + "GAMgAigLMicuRDMuQXR0cmlidXRlU2VyaWFsaXplci5TYXZlZEF0dHJpYnV0" + + "ZXMSJgoKc2F2ZWRfZGF0YRgEIAEoCzISLkQzLkhlcm8uU2F2ZWREYXRhEigK" + + "C3NhdmVkX3F1ZXN0GAUgAygLMhMuRDMuSGVyby5TYXZlZFF1ZXN0EiEKBWl0" + + "ZW1zGAYgASgLMhIuRDMuSXRlbXMuSXRlbUxpc3QSPgoUcXVlc3RfcmV3YXJk" + + "X2hpc3RvcnkYByADKAsyIC5EMy5IZXJvLlF1ZXN0UmV3YXJkSGlzdG9yeUVu" + + "dHJ5IiMKDE5hbWVTZXF1ZW5jZRITCghzZXF1ZW5jZRgBIAEoAzoBMCIYCghO" + + "YW1lVGV4dBIMCgRuYW1lGAEgAigJIqoBCgZFc2Nyb3cSDwoHdmVyc2lvbhgB" + + "IAIoDRImCglnZW5lcmF0b3IYAiABKAsyEy5EMy5JdGVtcy5HZW5lcmF0b3IS" + + "JQoJaGVyb19kYXRhGAMgASgLMhIuRDMuSGVyby5TYXZlZERhdGESDQoFc3Rh" + + "dGUYBCABKA0SMQoPc2VydmljZWRfdG9rZW5zGAUgAygLMhguRDMuT25saW5l" + + "U2VydmljZS5JdGVtSWQiOAoISGVyb0xpc3QSLAoIaGVyb19pZHMYASADKAsy" + + "Gi5EMy5PbmxpbmVTZXJ2aWNlLkVudGl0eUlk"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_D3_Hero_VisualItem__Descriptor = Descriptor.MessageTypes[0]; @@ -179,7 +190,11 @@ static Hero() { 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", }); + new string[] { "Version", "Generator", "HeroData", "State", "ServicedTokens", }); + internal__static_D3_Hero_HeroList__Descriptor = Descriptor.MessageTypes[17]; + internal__static_D3_Hero_HeroList__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_D3_Hero_HeroList__Descriptor, + new string[] { "HeroIds", }); return null; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, @@ -194,14 +209,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 +239,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 +249,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 +259,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 +269,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 +283,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 +308,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 +350,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 +427,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 +445,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 +462,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 +498,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 +612,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 +658,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 +707,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 +785,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 +803,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 +847,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 +875,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 +913,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", "sno_quest" }; + private static readonly uint[] _questHistoryEntryFieldTags = new uint[] { 16, 13 }; public static QuestHistoryEntry DefaultInstance { get { return defaultInstance; } } public override QuestHistoryEntry DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override QuestHistoryEntry ThisMessage { @@ -796,7 +943,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 +953,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; } } @@ -822,13 +969,14 @@ 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[1], SnoQuest); } - if (HasDifficulty) { - output.WriteSInt32(2, Difficulty); + if (hasDifficulty) { + output.WriteSInt32(2, field_names[0], Difficulty); } UnknownFields.WriteTo(output); } @@ -840,10 +988,10 @@ 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); } size += UnknownFields.SerializedSize; @@ -876,38 +1024,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; + } - QuestHistoryEntry result = new QuestHistoryEntry(); + private bool resultIsReadOnly; + private QuestHistoryEntry result; + + private QuestHistoryEntry PrepareBuilder() { + if (resultIsReadOnly) { + QuestHistoryEntry original = result; + result = new QuestHistoryEntry(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +1101,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,6 +1119,7 @@ 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; } @@ -948,20 +1130,31 @@ public override Builder MergeFrom(QuestHistoryEntry 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(_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,53 +1166,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 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; } } } + + 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; @@ -1030,14 +1232,20 @@ static QuestHistoryEntry() { } } + [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 +1262,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 +1272,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 +1282,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 +1299,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 +1321,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 +1360,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 +1437,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 +1455,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 +1469,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 +1505,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 +1595,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[] { "gbid_class", "hero_id", "hero_name", "highest_unlocked_act", "highest_unlocked_difficulty", "last_played_act", "last_played_difficulty", "last_played_quest", "last_played_quest_step", "level", "player_flags", "quest_history", "time_played", "version", "visual_equipment" }; + private static readonly uint[] _digestFieldTags = new uint[] { 37, 18, 26, 88, 104, 80, 96, 117, 120, 40, 48, 66, 128, 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 +1625,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 +1635,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 +1655,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 +1665,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 +1675,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 +1685,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; @@ -1436,7 +1707,7 @@ public int QuestHistoryCount { public const int LastPlayedActFieldNumber = 10; private bool hasLastPlayedAct; - private int lastPlayedAct_ = 0; + private int lastPlayedAct_; public bool HasLastPlayedAct { get { return hasLastPlayedAct; } } @@ -1446,7 +1717,7 @@ public int LastPlayedAct { public const int HighestUnlockedActFieldNumber = 11; private bool hasHighestUnlockedAct; - private int highestUnlockedAct_ = 0; + private int highestUnlockedAct_; public bool HasHighestUnlockedAct { get { return hasHighestUnlockedAct; } } @@ -1456,7 +1727,7 @@ public int HighestUnlockedAct { public const int LastPlayedDifficultyFieldNumber = 12; private bool hasLastPlayedDifficulty; - private int lastPlayedDifficulty_ = 0; + private int lastPlayedDifficulty_; public bool HasLastPlayedDifficulty { get { return hasLastPlayedDifficulty; } } @@ -1466,7 +1737,7 @@ public int LastPlayedDifficulty { public const int HighestUnlockedDifficultyFieldNumber = 13; private bool hasHighestUnlockedDifficulty; - private int highestUnlockedDifficulty_ = 0; + private int highestUnlockedDifficulty_; public bool HasHighestUnlockedDifficulty { get { return hasHighestUnlockedDifficulty; } } @@ -1476,7 +1747,7 @@ public int HighestUnlockedDifficulty { public const int LastPlayedQuestFieldNumber = 14; private bool hasLastPlayedQuest; - private int lastPlayedQuest_ = 0; + private int lastPlayedQuest_; public bool HasLastPlayedQuest { get { return hasLastPlayedQuest; } } @@ -1486,7 +1757,7 @@ public int LastPlayedQuest { public const int LastPlayedQuestStepFieldNumber = 15; private bool hasLastPlayedQuestStep; - private int lastPlayedQuestStep_ = 0; + private int lastPlayedQuestStep_; public bool HasLastPlayedQuestStep { get { return hasLastPlayedQuestStep; } } @@ -1496,7 +1767,7 @@ public int LastPlayedQuestStep { public const int TimePlayedFieldNumber = 16; private bool hasTimePlayed; - private uint timePlayed_ = 0; + private uint timePlayed_; public bool HasTimePlayed { get { return hasTimePlayed; } } @@ -1508,7 +1779,6 @@ 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 +1798,53 @@ 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[13], Version); } - if (HasHeroId) { - output.WriteMessage(2, HeroId); + if (hasHeroId) { + output.WriteMessage(2, field_names[1], HeroId); } - if (HasHeroName) { - output.WriteString(3, HeroName); + if (hasHeroName) { + output.WriteString(3, field_names[2], HeroName); } - if (HasGbidClass) { - output.WriteSFixed32(4, GbidClass); + if (hasGbidClass) { + output.WriteSFixed32(4, field_names[0], GbidClass); } - if (HasLevel) { - output.WriteSInt32(5, Level); + if (hasLevel) { + output.WriteSInt32(5, field_names[9], Level); } - if (HasPlayerFlags) { - output.WriteUInt32(6, PlayerFlags); + if (hasPlayerFlags) { + output.WriteUInt32(6, field_names[10], PlayerFlags); } - if (HasVisualEquipment) { - output.WriteMessage(7, VisualEquipment); + if (hasVisualEquipment) { + output.WriteMessage(7, field_names[14], VisualEquipment); } - foreach (global::D3.Hero.QuestHistoryEntry element in QuestHistoryList) { - output.WriteMessage(8, element); + if (questHistory_.Count > 0) { + output.WriteMessageArray(8, field_names[11], questHistory_); } - if (HasLastPlayedAct) { - output.WriteSInt32(10, LastPlayedAct); + if (hasLastPlayedAct) { + output.WriteSInt32(10, field_names[5], LastPlayedAct); } - if (HasHighestUnlockedAct) { - output.WriteSInt32(11, HighestUnlockedAct); + if (hasHighestUnlockedAct) { + output.WriteSInt32(11, field_names[3], HighestUnlockedAct); } - if (HasLastPlayedDifficulty) { - output.WriteSInt32(12, LastPlayedDifficulty); + if (hasLastPlayedDifficulty) { + output.WriteSInt32(12, field_names[6], LastPlayedDifficulty); } - if (HasHighestUnlockedDifficulty) { - output.WriteSInt32(13, HighestUnlockedDifficulty); + if (hasHighestUnlockedDifficulty) { + output.WriteSInt32(13, field_names[4], HighestUnlockedDifficulty); } - if (HasLastPlayedQuest) { - output.WriteSFixed32(14, LastPlayedQuest); + if (hasLastPlayedQuest) { + output.WriteSFixed32(14, field_names[7], LastPlayedQuest); } - if (HasLastPlayedQuestStep) { - output.WriteSInt32(15, LastPlayedQuestStep); + if (hasLastPlayedQuestStep) { + output.WriteSInt32(15, field_names[8], LastPlayedQuestStep); } - if (HasTimePlayed) { - output.WriteUInt32(16, TimePlayed); + if (hasTimePlayed) { + output.WriteUInt32(16, field_names[12], TimePlayed); } UnknownFields.WriteTo(output); } @@ -1585,49 +1856,49 @@ 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) { + if (hasLastPlayedAct) { size += pb::CodedOutputStream.ComputeSInt32Size(10, LastPlayedAct); } - if (HasHighestUnlockedAct) { + if (hasHighestUnlockedAct) { size += pb::CodedOutputStream.ComputeSInt32Size(11, HighestUnlockedAct); } - if (HasLastPlayedDifficulty) { + if (hasLastPlayedDifficulty) { size += pb::CodedOutputStream.ComputeSInt32Size(12, LastPlayedDifficulty); } - if (HasHighestUnlockedDifficulty) { + if (hasHighestUnlockedDifficulty) { size += pb::CodedOutputStream.ComputeSInt32Size(13, HighestUnlockedDifficulty); } - if (HasLastPlayedQuest) { + if (hasLastPlayedQuest) { size += pb::CodedOutputStream.ComputeSFixed32Size(14, LastPlayedQuest); } - if (HasLastPlayedQuestStep) { + if (hasLastPlayedQuestStep) { size += pb::CodedOutputStream.ComputeSInt32Size(15, LastPlayedQuestStep); } - if (HasTimePlayed) { + if (hasTimePlayed) { size += pb::CodedOutputStream.ComputeUInt32Size(16, TimePlayed); } size += UnknownFields.SerializedSize; @@ -1660,38 +1931,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 +2009,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 +2027,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 +2050,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; @@ -1772,20 +2077,31 @@ public override Builder MergeFrom(Digest 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(_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 +2113,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 +2130,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 +2155,69 @@ 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 80: { - LastPlayedAct = input.ReadSInt32(); + result.hasLastPlayedAct = input.ReadSInt32(ref result.lastPlayedAct_); break; } case 88: { - HighestUnlockedAct = input.ReadSInt32(); + result.hasHighestUnlockedAct = input.ReadSInt32(ref result.highestUnlockedAct_); break; } case 96: { - LastPlayedDifficulty = input.ReadSInt32(); + result.hasLastPlayedDifficulty = input.ReadSInt32(ref result.lastPlayedDifficulty_); break; } case 104: { - HighestUnlockedDifficulty = input.ReadSInt32(); + result.hasHighestUnlockedDifficulty = input.ReadSInt32(ref result.highestUnlockedDifficulty_); break; } case 117: { - LastPlayedQuest = input.ReadSFixed32(); + result.hasLastPlayedQuest = input.ReadSFixed32(ref result.lastPlayedQuest_); break; } case 120: { - LastPlayedQuestStep = input.ReadSInt32(); + result.hasLastPlayedQuestStep = input.ReadSInt32(ref result.lastPlayedQuestStep_); break; } case 128: { - TimePlayed = input.ReadUInt32(); + result.hasTimePlayed = input.ReadUInt32(ref result.timePlayed_); 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 +2225,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 +2250,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 +2265,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 +2346,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 +2371,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,154 +2388,174 @@ 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; @@ -2209,14 +2566,20 @@ static Digest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class HotbarButtonData : pb::GeneratedMessage { - private static readonly HotbarButtonData defaultInstance = new Builder().BuildPartial(); + private HotbarButtonData() { } + private static readonly HotbarButtonData defaultInstance = new HotbarButtonData().MakeReadOnly(); + private static readonly string[] _hotbarButtonDataFieldNames = new string[] { "gbid_item", "sno_power" }; + private static readonly uint[] _hotbarButtonDataFieldTags = new uint[] { 21, 13 }; public static HotbarButtonData DefaultInstance { get { return defaultInstance; } } public override HotbarButtonData DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override HotbarButtonData ThisMessage { @@ -2233,7 +2596,7 @@ protected override HotbarButtonData ThisMessage { public const int SnoPowerFieldNumber = 1; private bool hasSnoPower; - private int snoPower_ = 0; + private int snoPower_ = -1; public bool HasSnoPower { get { return hasSnoPower; } } @@ -2243,7 +2606,7 @@ public int SnoPower { public const int GbidItemFieldNumber = 2; private bool hasGbidItem; - private int gbidItem_ = 0; + private int gbidItem_ = -1; public bool HasGbidItem { get { return hasGbidItem; } } @@ -2259,13 +2622,14 @@ public override bool IsInitialized { } } - 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 = _hotbarButtonDataFieldNames; + if (hasSnoPower) { + output.WriteSFixed32(1, field_names[1], SnoPower); } - if (HasGbidItem) { - output.WriteSFixed32(2, GbidItem); + if (hasGbidItem) { + output.WriteSFixed32(2, field_names[0], GbidItem); } UnknownFields.WriteTo(output); } @@ -2277,10 +2641,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSnoPower) { + if (hasSnoPower) { size += pb::CodedOutputStream.ComputeSFixed32Size(1, SnoPower); } - if (HasGbidItem) { + if (hasGbidItem) { size += pb::CodedOutputStream.ComputeSFixed32Size(2, GbidItem); } size += UnknownFields.SerializedSize; @@ -2313,38 +2677,72 @@ public static HotbarButtonData ParseDelimitedFrom(global::System.IO.Stream input 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) { + public static HotbarButtonData ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static HotbarButtonData ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static HotbarButtonData ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private HotbarButtonData MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(HotbarButtonData cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - HotbarButtonData result = new HotbarButtonData(); + private bool resultIsReadOnly; + private HotbarButtonData result; + + private HotbarButtonData PrepareBuilder() { + if (resultIsReadOnly) { + HotbarButtonData original = result; + result = new HotbarButtonData(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override HotbarButtonData MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new HotbarButtonData(); + 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 { @@ -2356,12 +2754,11 @@ public override HotbarButtonData DefaultInstanceForType { } public override HotbarButtonData BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - HotbarButtonData returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2375,6 +2772,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(HotbarButtonData other) { if (other == global::D3.Hero.HotbarButtonData.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSnoPower) { SnoPower = other.SnoPower; } @@ -2385,20 +2783,31 @@ public override Builder MergeFrom(HotbarButtonData 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(_hotbarButtonDataFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _hotbarButtonDataFieldTags[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)) { @@ -2410,55 +2819,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 13: { - SnoPower = input.ReadSFixed32(); + result.hasSnoPower = input.ReadSFixed32(ref result.snoPower_); break; } case 21: { - GbidItem = input.ReadSFixed32(); + result.hasGbidItem = input.ReadSFixed32(ref result.gbidItem_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSnoPower { - get { return result.HasSnoPower; } + get { return result.hasSnoPower; } } public int SnoPower { get { return result.SnoPower; } set { SetSnoPower(value); } } public Builder SetSnoPower(int value) { + PrepareBuilder(); result.hasSnoPower = true; result.snoPower_ = value; return this; } public Builder ClearSnoPower() { + PrepareBuilder(); result.hasSnoPower = false; - result.snoPower_ = 0; + result.snoPower_ = -1; return this; } public bool HasGbidItem { - get { return result.HasGbidItem; } + get { return result.hasGbidItem; } } public int GbidItem { get { return result.GbidItem; } set { SetGbidItem(value); } } public Builder SetGbidItem(int value) { + PrepareBuilder(); result.hasGbidItem = true; result.gbidItem_ = value; return this; } public Builder ClearGbidItem() { + PrepareBuilder(); result.hasGbidItem = false; - result.gbidItem_ = 0; + result.gbidItem_ = -1; return this; } } @@ -2467,14 +2885,20 @@ static HotbarButtonData() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SkillKeyMapping : pb::GeneratedMessage { - private static readonly SkillKeyMapping defaultInstance = new Builder().BuildPartial(); + private SkillKeyMapping() { } + private static readonly SkillKeyMapping defaultInstance = new SkillKeyMapping().MakeReadOnly(); + private static readonly string[] _skillKeyMappingFieldNames = new string[] { "id_hotkey", "skill_button", "sno_power" }; + private static readonly uint[] _skillKeyMappingFieldTags = new uint[] { 16, 24, 13 }; public static SkillKeyMapping DefaultInstance { get { return defaultInstance; } } public override SkillKeyMapping DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SkillKeyMapping ThisMessage { @@ -2491,7 +2915,7 @@ protected override SkillKeyMapping ThisMessage { public const int SnoPowerFieldNumber = 1; private bool hasSnoPower; - private int snoPower_ = 0; + private int snoPower_ = -1; public bool HasSnoPower { get { return hasSnoPower; } } @@ -2501,7 +2925,7 @@ public int SnoPower { public const int IdHotkeyFieldNumber = 2; private bool hasIdHotkey; - private int idHotkey_ = 0; + private int idHotkey_ = -1; public bool HasIdHotkey { get { return hasIdHotkey; } } @@ -2511,7 +2935,7 @@ public int IdHotkey { public const int SkillButtonFieldNumber = 3; private bool hasSkillButton; - private int skillButton_ = 0; + private int skillButton_; public bool HasSkillButton { get { return hasSkillButton; } } @@ -2528,16 +2952,17 @@ public override bool IsInitialized { } } - 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 = _skillKeyMappingFieldNames; + if (hasSnoPower) { + output.WriteSFixed32(1, field_names[2], SnoPower); } - if (HasIdHotkey) { - output.WriteSInt32(2, IdHotkey); + if (hasIdHotkey) { + output.WriteSInt32(2, field_names[0], IdHotkey); } - if (HasSkillButton) { - output.WriteSInt32(3, SkillButton); + if (hasSkillButton) { + output.WriteSInt32(3, field_names[1], SkillButton); } UnknownFields.WriteTo(output); } @@ -2549,13 +2974,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSnoPower) { + if (hasSnoPower) { size += pb::CodedOutputStream.ComputeSFixed32Size(1, SnoPower); } - if (HasIdHotkey) { + if (hasIdHotkey) { size += pb::CodedOutputStream.ComputeSInt32Size(2, IdHotkey); } - if (HasSkillButton) { + if (hasSkillButton) { size += pb::CodedOutputStream.ComputeSInt32Size(3, SkillButton); } size += UnknownFields.SerializedSize; @@ -2588,38 +3013,72 @@ public static SkillKeyMapping ParseDelimitedFrom(global::System.IO.Stream input) public static SkillKeyMapping ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SkillKeyMapping ParseFrom(pb::CodedInputStream input) { + public static SkillKeyMapping ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SkillKeyMapping ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SkillKeyMapping ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SkillKeyMapping MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(SkillKeyMapping cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SkillKeyMapping result; + + private SkillKeyMapping PrepareBuilder() { + if (resultIsReadOnly) { + SkillKeyMapping original = result; + result = new SkillKeyMapping(); + 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; } + 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 { @@ -2631,12 +3090,11 @@ public override SkillKeyMapping DefaultInstanceForType { } public override SkillKeyMapping BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SkillKeyMapping returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2650,6 +3108,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SkillKeyMapping other) { if (other == global::D3.Hero.SkillKeyMapping.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSnoPower) { SnoPower = other.SnoPower; } @@ -2663,20 +3122,31 @@ public override Builder MergeFrom(SkillKeyMapping 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(_skillKeyMappingFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _skillKeyMappingFieldTags[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,75 +3158,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: { - SnoPower = input.ReadSFixed32(); + result.hasSnoPower = input.ReadSFixed32(ref result.snoPower_); break; } case 16: { - IdHotkey = input.ReadSInt32(); + result.hasIdHotkey = input.ReadSInt32(ref result.idHotkey_); break; } case 24: { - SkillButton = input.ReadSInt32(); + result.hasSkillButton = input.ReadSInt32(ref result.skillButton_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSnoPower { - get { return result.HasSnoPower; } + get { return result.hasSnoPower; } } public int SnoPower { get { return result.SnoPower; } set { SetSnoPower(value); } } public Builder SetSnoPower(int value) { + PrepareBuilder(); result.hasSnoPower = true; result.snoPower_ = value; return this; } public Builder ClearSnoPower() { + PrepareBuilder(); result.hasSnoPower = false; - result.snoPower_ = 0; + result.snoPower_ = -1; return this; } public bool HasIdHotkey { - get { return result.HasIdHotkey; } + get { return result.hasIdHotkey; } } public int IdHotkey { get { return result.IdHotkey; } set { SetIdHotkey(value); } } public Builder SetIdHotkey(int value) { + PrepareBuilder(); result.hasIdHotkey = true; result.idHotkey_ = value; return this; } public Builder ClearIdHotkey() { + PrepareBuilder(); result.hasIdHotkey = false; - result.idHotkey_ = 0; + result.idHotkey_ = -1; return this; } public bool HasSkillButton { - get { return result.HasSkillButton; } + get { return result.hasSkillButton; } } public int SkillButton { get { return result.SkillButton; } set { SetSkillButton(value); } } public Builder SetSkillButton(int value) { + PrepareBuilder(); result.hasSkillButton = true; result.skillButton_ = value; return this; } public Builder ClearSkillButton() { + PrepareBuilder(); result.hasSkillButton = false; result.skillButton_ = 0; return this; @@ -2767,14 +3248,20 @@ static SkillKeyMapping() { } } + [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 static readonly SavedQuest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override SavedQuest ThisMessage { @@ -2791,7 +3278,7 @@ protected override SavedQuest ThisMessage { public const int SnoQuestFieldNumber = 1; private bool hasSnoQuest; - private int snoQuest_ = 0; + private int snoQuest_ = -1; public bool HasSnoQuest { get { return hasSnoQuest; } } @@ -2801,7 +3288,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 +3298,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 +3307,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 +3320,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 +3341,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 +3369,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 +3384,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 +3395,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 +3430,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 +3509,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 +3527,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 +3538,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 +3583,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 +3688,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 +3718,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 +3743,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 +3789,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 +3841,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; + } + + private bool resultIsReadOnly; + private LearnedLore result; + + private LearnedLore PrepareBuilder() { + if (resultIsReadOnly) { + LearnedLore original = result; + result = new LearnedLore(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - LearnedLore result = new LearnedLore(); + 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 +3919,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 +3937,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 +3981,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 +4009,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 +4034,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 +4091,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 +4110,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPlayedConversationsBitfield) { + if (hasPlayedConversationsBitfield) { size += pb::CodedOutputStream.ComputeBytesSize(1, PlayedConversationsBitfield); } { @@ -3526,38 +4149,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 +4227,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 +4245,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 +4292,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 +4323,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 +4345,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 +4370,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 +4400,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 +4410,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 +4420,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 +4437,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 +4459,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 +4498,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 +4575,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 +4593,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 +4607,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 +4643,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,14 +4733,20 @@ static SavePointData_Proto() { } } + [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[] { "activated_waypoints", "hireling_saved_data", "hotbar_button_assignments", "last_level_time", "learned_lore", "save_point", "saved_conversations", "seen_tutorials", "skill_key_map", "sno_active_skills", "sno_traits", "time_played" }; + private static readonly uint[] _savedDataFieldTags = new uint[] { 32, 42, 10, 48, 58, 98, 66, 93, 18, 77, 85, 24 }; public static SavedData DefaultInstance { get { return defaultInstance; } } public override SavedData DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SavedData ThisMessage { @@ -4038,7 +4787,7 @@ public int SkillKeyMapCount { public const int TimePlayedFieldNumber = 3; private bool hasTimePlayed; - private uint timePlayed_ = 0; + private uint timePlayed_; public bool HasTimePlayed { get { return hasTimePlayed; } } @@ -4048,7 +4797,7 @@ public uint TimePlayed { public const int ActivatedWaypointsFieldNumber = 4; private bool hasActivatedWaypoints; - private uint activatedWaypoints_ = 0; + private uint activatedWaypoints_; public bool HasActivatedWaypoints { get { return hasActivatedWaypoints; } } @@ -4058,17 +4807,17 @@ public uint ActivatedWaypoints { public const int HirelingSavedDataFieldNumber = 5; private bool hasHirelingSavedData; - private global::D3.Hireling.SavedData hirelingSavedData_ = global::D3.Hireling.SavedData.DefaultInstance; + private global::D3.Hireling.SavedData hirelingSavedData_; public bool HasHirelingSavedData { get { return hasHirelingSavedData; } } public global::D3.Hireling.SavedData HirelingSavedData { - get { return hirelingSavedData_; } + get { return hirelingSavedData_ ?? global::D3.Hireling.SavedData.DefaultInstance; } } public const int LastLevelTimeFieldNumber = 6; private bool hasLastLevelTime; - private uint lastLevelTime_ = 0; + private uint lastLevelTime_; public bool HasLastLevelTime { get { return hasLastLevelTime; } } @@ -4078,22 +4827,22 @@ public uint LastLevelTime { public const int LearnedLoreFieldNumber = 7; private bool hasLearnedLore; - private global::D3.Hero.LearnedLore learnedLore_ = global::D3.Hero.LearnedLore.DefaultInstance; + private global::D3.Hero.LearnedLore learnedLore_; public bool HasLearnedLore { get { return hasLearnedLore; } } public global::D3.Hero.LearnedLore LearnedLore { - get { return learnedLore_; } + get { return learnedLore_ ?? global::D3.Hero.LearnedLore.DefaultInstance; } } public const int SavedConversationsFieldNumber = 8; private bool hasSavedConversations; - private global::D3.Hero.SavedConversations savedConversations_ = global::D3.Hero.SavedConversations.DefaultInstance; + private global::D3.Hero.SavedConversations savedConversations_; public bool HasSavedConversations { get { return hasSavedConversations; } } public global::D3.Hero.SavedConversations SavedConversations { - get { return savedConversations_; } + get { return savedConversations_ ?? global::D3.Hero.SavedConversations.DefaultInstance; } } public const int SnoActiveSkillsFieldNumber = 9; @@ -4134,12 +4883,12 @@ public int GetSeenTutorials(int index) { public const int SavePointFieldNumber = 12; 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 override bool IsInitialized { @@ -4164,49 +4913,44 @@ 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.HotbarButtonData element in HotbarButtonAssignmentsList) { - output.WriteMessage(1, element); + string[] field_names = _savedDataFieldNames; + if (hotbarButtonAssignments_.Count > 0) { + output.WriteMessageArray(1, field_names[2], hotbarButtonAssignments_); } - foreach (global::D3.Hero.SkillKeyMapping element in SkillKeyMapList) { - output.WriteMessage(2, element); + if (skillKeyMap_.Count > 0) { + output.WriteMessageArray(2, field_names[8], skillKeyMap_); } - if (HasTimePlayed) { - output.WriteUInt32(3, TimePlayed); + if (hasTimePlayed) { + output.WriteUInt32(3, field_names[11], TimePlayed); } - if (HasActivatedWaypoints) { - output.WriteUInt32(4, ActivatedWaypoints); + if (hasActivatedWaypoints) { + output.WriteUInt32(4, field_names[0], ActivatedWaypoints); } - if (HasHirelingSavedData) { - output.WriteMessage(5, HirelingSavedData); + if (hasHirelingSavedData) { + output.WriteMessage(5, field_names[1], HirelingSavedData); } - if (HasLastLevelTime) { - output.WriteUInt32(6, LastLevelTime); + if (hasLastLevelTime) { + output.WriteUInt32(6, field_names[3], LastLevelTime); } - if (HasLearnedLore) { - output.WriteMessage(7, LearnedLore); + if (hasLearnedLore) { + output.WriteMessage(7, field_names[4], LearnedLore); } - if (HasSavedConversations) { - output.WriteMessage(8, SavedConversations); + if (hasSavedConversations) { + output.WriteMessage(8, field_names[6], SavedConversations); } if (snoActiveSkills_.Count > 0) { - foreach (int element in snoActiveSkills_) { - output.WriteSFixed32(9, element); - } + output.WriteSFixed32Array(9, field_names[9], snoActiveSkills_); } if (snoTraits_.Count > 0) { - foreach (int element in snoTraits_) { - output.WriteSFixed32(10, element); - } + output.WriteSFixed32Array(10, field_names[10], snoTraits_); } if (seenTutorials_.Count > 0) { - foreach (int element in seenTutorials_) { - output.WriteSFixed32(11, element); - } + output.WriteSFixed32Array(11, field_names[7], seenTutorials_); } - if (HasSavePoint) { - output.WriteMessage(12, SavePoint); + if (hasSavePoint) { + output.WriteMessage(12, field_names[5], SavePoint); } UnknownFields.WriteTo(output); } @@ -4224,22 +4968,22 @@ public override int SerializedSize { foreach (global::D3.Hero.SkillKeyMapping element in SkillKeyMapList) { size += pb::CodedOutputStream.ComputeMessageSize(2, element); } - if (HasTimePlayed) { + if (hasTimePlayed) { size += pb::CodedOutputStream.ComputeUInt32Size(3, TimePlayed); } - if (HasActivatedWaypoints) { + if (hasActivatedWaypoints) { size += pb::CodedOutputStream.ComputeUInt32Size(4, ActivatedWaypoints); } - if (HasHirelingSavedData) { + if (hasHirelingSavedData) { size += pb::CodedOutputStream.ComputeMessageSize(5, HirelingSavedData); } - if (HasLastLevelTime) { + if (hasLastLevelTime) { size += pb::CodedOutputStream.ComputeUInt32Size(6, LastLevelTime); } - if (HasLearnedLore) { + if (hasLearnedLore) { size += pb::CodedOutputStream.ComputeMessageSize(7, LearnedLore); } - if (HasSavedConversations) { + if (hasSavedConversations) { size += pb::CodedOutputStream.ComputeMessageSize(8, SavedConversations); } { @@ -4260,7 +5004,7 @@ public override int SerializedSize { size += dataSize; size += 1 * seenTutorials_.Count; } - if (HasSavePoint) { + if (hasSavePoint) { size += pb::CodedOutputStream.ComputeMessageSize(12, SavePoint); } size += UnknownFields.SerializedSize; @@ -4293,38 +5037,77 @@ 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() { + hotbarButtonAssignments_.MakeReadOnly(); + skillKeyMap_.MakeReadOnly(); + snoActiveSkills_.MakeReadOnly(); + snoTraits_.MakeReadOnly(); + seenTutorials_.MakeReadOnly(); + return this; + } + public 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 +5119,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,11 +5137,12 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SavedData other) { if (other == global::D3.Hero.SavedData.DefaultInstance) return this; + PrepareBuilder(); if (other.hotbarButtonAssignments_.Count != 0) { - base.AddRange(other.hotbarButtonAssignments_, result.hotbarButtonAssignments_); + result.hotbarButtonAssignments_.Add(other.hotbarButtonAssignments_); } if (other.skillKeyMap_.Count != 0) { - base.AddRange(other.skillKeyMap_, result.skillKeyMap_); + result.skillKeyMap_.Add(other.skillKeyMap_); } if (other.HasTimePlayed) { TimePlayed = other.TimePlayed; @@ -4385,13 +5163,13 @@ public override Builder MergeFrom(SavedData other) { MergeSavedConversations(other.SavedConversations); } if (other.snoActiveSkills_.Count != 0) { - base.AddRange(other.snoActiveSkills_, result.snoActiveSkills_); + result.snoActiveSkills_.Add(other.snoActiveSkills_); } if (other.snoTraits_.Count != 0) { - base.AddRange(other.snoTraits_, result.snoTraits_); + result.snoTraits_.Add(other.snoTraits_); } if (other.seenTutorials_.Count != 0) { - base.AddRange(other.seenTutorials_, result.seenTutorials_); + result.seenTutorials_.Add(other.seenTutorials_); } if (other.HasSavePoint) { MergeSavePoint(other.SavePoint); @@ -4400,20 +5178,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(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); + uint tag; + 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); } - return this; + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4425,32 +5214,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 10: { - global::D3.Hero.HotbarButtonData.Builder subBuilder = global::D3.Hero.HotbarButtonData.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddHotbarButtonAssignments(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.hotbarButtonAssignments_, global::D3.Hero.HotbarButtonData.DefaultInstance, extensionRegistry); break; } case 18: { - global::D3.Hero.SkillKeyMapping.Builder subBuilder = global::D3.Hero.SkillKeyMapping.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddSkillKeyMap(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.skillKeyMap_, global::D3.Hero.SkillKeyMapping.DefaultInstance, extensionRegistry); break; } case 24: { - TimePlayed = input.ReadUInt32(); + result.hasTimePlayed = input.ReadUInt32(ref result.timePlayed_); break; } case 32: { - ActivatedWaypoints = input.ReadUInt32(); + result.hasActivatedWaypoints = input.ReadUInt32(ref result.activatedWaypoints_); break; } case 42: { global::D3.Hireling.SavedData.Builder subBuilder = global::D3.Hireling.SavedData.CreateBuilder(); - if (HasHirelingSavedData) { + if (result.hasHirelingSavedData) { subBuilder.MergeFrom(HirelingSavedData); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4458,12 +5243,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 48: { - LastLevelTime = input.ReadUInt32(); + result.hasLastLevelTime = input.ReadUInt32(ref result.lastLevelTime_); break; } case 58: { global::D3.Hero.LearnedLore.Builder subBuilder = global::D3.Hero.LearnedLore.CreateBuilder(); - if (HasLearnedLore) { + if (result.hasLearnedLore) { subBuilder.MergeFrom(LearnedLore); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4472,28 +5257,31 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 66: { 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 74: case 77: { - AddSnoActiveSkills(input.ReadSFixed32()); + input.ReadSFixed32Array(tag, field_name, result.snoActiveSkills_); break; } + case 82: case 85: { - AddSnoTraits(input.ReadSFixed32()); + input.ReadSFixed32Array(tag, field_name, result.snoTraits_); break; } + case 90: case 93: { - AddSeenTutorials(input.ReadSFixed32()); + input.ReadSFixed32Array(tag, field_name, result.seenTutorials_); break; } case 98: { 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); @@ -4502,11 +5290,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList HotbarButtonAssignmentsList { - get { return result.hotbarButtonAssignments_; } + get { return PrepareBuilder().hotbarButtonAssignments_; } } public int HotbarButtonAssignmentsCount { get { return result.HotbarButtonAssignmentsCount; } @@ -4516,35 +5309,41 @@ public int HotbarButtonAssignmentsCount { } public Builder SetHotbarButtonAssignments(int index, global::D3.Hero.HotbarButtonData value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hotbarButtonAssignments_[index] = value; return this; } public Builder SetHotbarButtonAssignments(int index, global::D3.Hero.HotbarButtonData.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hotbarButtonAssignments_[index] = builderForValue.Build(); return this; } public Builder AddHotbarButtonAssignments(global::D3.Hero.HotbarButtonData value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hotbarButtonAssignments_.Add(value); return this; } public Builder AddHotbarButtonAssignments(global::D3.Hero.HotbarButtonData.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.hotbarButtonAssignments_.Add(builderForValue.Build()); return this; } public Builder AddRangeHotbarButtonAssignments(scg::IEnumerable values) { - base.AddRange(values, result.hotbarButtonAssignments_); + PrepareBuilder(); + result.hotbarButtonAssignments_.Add(values); return this; } public Builder ClearHotbarButtonAssignments() { + PrepareBuilder(); result.hotbarButtonAssignments_.Clear(); return this; } public pbc::IPopsicleList SkillKeyMapList { - get { return result.skillKeyMap_; } + get { return PrepareBuilder().skillKeyMap_; } } public int SkillKeyMapCount { get { return result.SkillKeyMapCount; } @@ -4554,71 +5353,81 @@ public int SkillKeyMapCount { } public Builder SetSkillKeyMap(int index, global::D3.Hero.SkillKeyMapping value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.skillKeyMap_[index] = value; return this; } public Builder SetSkillKeyMap(int index, global::D3.Hero.SkillKeyMapping.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.skillKeyMap_[index] = builderForValue.Build(); return this; } public Builder AddSkillKeyMap(global::D3.Hero.SkillKeyMapping value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.skillKeyMap_.Add(value); return this; } public Builder AddSkillKeyMap(global::D3.Hero.SkillKeyMapping.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.skillKeyMap_.Add(builderForValue.Build()); return this; } public Builder AddRangeSkillKeyMap(scg::IEnumerable values) { - base.AddRange(values, result.skillKeyMap_); + PrepareBuilder(); + result.skillKeyMap_.Add(values); return this; } public Builder ClearSkillKeyMap() { + PrepareBuilder(); 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 +5435,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 +5460,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 +5495,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 +5520,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 +5535,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,13 +5560,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; + result.savedConversations_ = null; return this; } public pbc::IPopsicleList SnoActiveSkillsList { - get { return result.snoActiveSkills_; } + get { return PrepareBuilder().snoActiveSkills_; } } public int SnoActiveSkillsCount { get { return result.SnoActiveSkillsCount; } @@ -4753,24 +5576,28 @@ public int GetSnoActiveSkills(int index) { return result.GetSnoActiveSkills(index); } public Builder SetSnoActiveSkills(int index, int value) { + PrepareBuilder(); result.snoActiveSkills_[index] = value; return this; } public Builder AddSnoActiveSkills(int value) { + PrepareBuilder(); result.snoActiveSkills_.Add(value); return this; } public Builder AddRangeSnoActiveSkills(scg::IEnumerable values) { - base.AddRange(values, result.snoActiveSkills_); + PrepareBuilder(); + result.snoActiveSkills_.Add(values); return this; } public Builder ClearSnoActiveSkills() { + PrepareBuilder(); result.snoActiveSkills_.Clear(); return this; } public pbc::IPopsicleList SnoTraitsList { - get { return result.snoTraits_; } + get { return PrepareBuilder().snoTraits_; } } public int SnoTraitsCount { get { return result.SnoTraitsCount; } @@ -4779,24 +5606,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_; } + get { return PrepareBuilder().seenTutorials_; } } public int SeenTutorialsCount { get { return result.SeenTutorialsCount; } @@ -4805,24 +5636,28 @@ public int GetSeenTutorials(int index) { return result.GetSeenTutorials(index); } public Builder SetSeenTutorials(int index, int value) { + PrepareBuilder(); result.seenTutorials_[index] = value; return this; } public Builder AddSeenTutorials(int value) { + PrepareBuilder(); result.seenTutorials_.Add(value); return this; } public Builder AddRangeSeenTutorials(scg::IEnumerable values) { - base.AddRange(values, result.seenTutorials_); + PrepareBuilder(); + result.seenTutorials_.Add(values); return this; } public Builder ClearSeenTutorials() { + PrepareBuilder(); 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 +5665,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 +5690,9 @@ 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; } } @@ -4862,14 +5701,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 +5731,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 +5741,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 +5756,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 +5775,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 +5811,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; + } - Timestamps result = new Timestamps(); + private bool resultIsReadOnly; + private Timestamps result; + + private Timestamps PrepareBuilder() { + if (resultIsReadOnly) { + Timestamps original = result; + result = new Timestamps(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +5888,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 +5906,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 +5917,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 +5953,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 +6019,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 +6049,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 +6059,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 +6101,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 +6145,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 +6179,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 +6230,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; + } - SavedDefinition result = new SavedDefinition(); + 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 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 +6309,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 +6327,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 +6341,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 +6389,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 +6407,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 +6416,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 +6424,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 +6437,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 +6479,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 +6504,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 +6519,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 +6544,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 +6559,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 +6584,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 +6601,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,19 +6643,22 @@ 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 { @@ -5692,13 +6668,14 @@ public Builder MergeItems(global::D3.Items.ItemList value) { return this; } public Builder ClearItems() { + PrepareBuilder(); result.hasItems = false; - result.items_ = global::D3.Items.ItemList.DefaultInstance; + result.items_ = null; return this; } public pbc::IPopsicleList QuestRewardHistoryList { - get { return result.questRewardHistory_; } + get { return PrepareBuilder().questRewardHistory_; } } public int QuestRewardHistoryCount { get { return result.QuestRewardHistoryCount; } @@ -5708,29 +6685,35 @@ public int QuestRewardHistoryCount { } 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) { - base.AddRange(values, result.questRewardHistory_); + PrepareBuilder(); + result.questRewardHistory_.Add(values); return this; } public Builder ClearQuestRewardHistory() { + PrepareBuilder(); result.questRewardHistory_.Clear(); return this; } @@ -5740,14 +6723,20 @@ static SavedDefinition() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class NameSequence : pb::GeneratedMessage { - private static readonly NameSequence defaultInstance = new Builder().BuildPartial(); + private NameSequence() { } + private static readonly NameSequence defaultInstance = new NameSequence().MakeReadOnly(); + private static readonly string[] _nameSequenceFieldNames = new string[] { "sequence" }; + private static readonly uint[] _nameSequenceFieldTags = new uint[] { 8 }; public static NameSequence DefaultInstance { get { return defaultInstance; } } public override NameSequence DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override NameSequence ThisMessage { @@ -5764,7 +6753,7 @@ protected override NameSequence ThisMessage { public const int SequenceFieldNumber = 1; private bool hasSequence; - private long sequence_ = 0L; + private long sequence_; public bool HasSequence { get { return hasSequence; } } @@ -5778,10 +6767,11 @@ public override bool IsInitialized { } } - 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 = _nameSequenceFieldNames; + if (hasSequence) { + output.WriteInt64(1, field_names[0], Sequence); } UnknownFields.WriteTo(output); } @@ -5793,7 +6783,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSequence) { + if (hasSequence) { size += pb::CodedOutputStream.ComputeInt64Size(1, Sequence); } size += UnknownFields.SerializedSize; @@ -5826,38 +6816,72 @@ public static NameSequence ParseDelimitedFrom(global::System.IO.Stream input) { public static NameSequence ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static NameSequence ParseFrom(pb::CodedInputStream input) { + public static NameSequence ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static NameSequence ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static NameSequence ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private NameSequence MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(NameSequence cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - NameSequence result = new NameSequence(); + private bool resultIsReadOnly; + private NameSequence result; + + private NameSequence PrepareBuilder() { + if (resultIsReadOnly) { + NameSequence original = result; + result = new NameSequence(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override NameSequence MessageBeingBuilt { - get { return result; } + 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 { @@ -5869,12 +6893,11 @@ public override NameSequence DefaultInstanceForType { } public override NameSequence BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - NameSequence returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -5888,6 +6911,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(NameSequence other) { if (other == global::D3.Hero.NameSequence.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSequence) { Sequence = other.Sequence; } @@ -5895,20 +6919,31 @@ public override Builder MergeFrom(NameSequence 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(_nameSequenceFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _nameSequenceFieldTags[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,31 +6955,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; } case 8: { - Sequence = input.ReadInt64(); + result.hasSequence = input.ReadInt64(ref result.sequence_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSequence { - get { return result.HasSequence; } + get { return result.hasSequence; } } public long Sequence { get { return result.Sequence; } set { SetSequence(value); } } public Builder SetSequence(long value) { + PrepareBuilder(); result.hasSequence = true; result.sequence_ = value; return this; } public Builder ClearSequence() { + PrepareBuilder(); result.hasSequence = false; result.sequence_ = 0L; return this; @@ -5955,14 +6997,20 @@ static NameSequence() { } } + [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 static readonly NameText defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override NameText ThisMessage { @@ -5994,10 +7042,11 @@ 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 = _nameTextFieldNames; + if (hasName) { + output.WriteString(1, field_names[0], Name); } UnknownFields.WriteTo(output); } @@ -6009,7 +7058,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasName) { + if (hasName) { size += pb::CodedOutputStream.ComputeStringSize(1, Name); } size += UnknownFields.SerializedSize; @@ -6042,38 +7091,72 @@ public static NameText ParseDelimitedFrom(global::System.IO.Stream input) { public static NameText ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static NameText ParseFrom(pb::CodedInputStream input) { + public static NameText ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static NameText ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - NameText result = new NameText(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override NameText MessageBeingBuilt { - get { return result; } + 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 { @@ -6085,12 +7168,11 @@ public override NameText DefaultInstanceForType { } public override NameText BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - NameText returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -6104,6 +7186,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(NameText other) { if (other == global::D3.Hero.NameText.DefaultInstance) return this; + PrepareBuilder(); if (other.HasName) { Name = other.Name; } @@ -6111,20 +7194,31 @@ public override Builder MergeFrom(NameText 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -6136,20 +7230,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: { - Name = input.ReadString(); + result.hasName = input.ReadString(ref result.name_); 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; } @@ -6157,11 +7256,13 @@ 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; @@ -6172,14 +7273,20 @@ static NameText() { } } + [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 static readonly Escrow defaultInstance = new Builder().BuildPartial(); + private Escrow() { } + private static readonly Escrow defaultInstance = new Escrow().MakeReadOnly(); + private static readonly string[] _escrowFieldNames = new string[] { "generator", "hero_data", "serviced_tokens", "state", "version" }; + private static readonly uint[] _escrowFieldTags = new uint[] { 18, 26, 42, 32, 8 }; public static Escrow DefaultInstance { get { return defaultInstance; } } public override Escrow DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Escrow ThisMessage { @@ -6196,7 +7303,7 @@ protected override Escrow ThisMessage { public const int VersionFieldNumber = 1; private bool hasVersion; - private uint version_ = 0; + private uint version_; public bool HasVersion { get { return hasVersion; } } @@ -6206,27 +7313,27 @@ public uint Version { 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 const int HeroDataFieldNumber = 3; private bool hasHeroData; - private global::D3.Hero.SavedData heroData_ = global::D3.Hero.SavedData.DefaultInstance; + private global::D3.Hero.SavedData heroData_; public bool HasHeroData { get { return hasHeroData; } } public global::D3.Hero.SavedData HeroData { - get { return heroData_; } + get { return heroData_ ?? global::D3.Hero.SavedData.DefaultInstance; } } public const int StateFieldNumber = 4; private bool hasState; - private uint state_ = 0; + private uint state_; public bool HasState { get { return hasState; } } @@ -6234,6 +7341,18 @@ public uint State { get { return state_; } } + public const int ServicedTokensFieldNumber = 5; + 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.ItemId GetServicedTokens(int index) { + return servicedTokens_[index]; + } + public override bool IsInitialized { get { if (!hasVersion) return false; @@ -6243,23 +7362,30 @@ public override bool IsInitialized { if (HasHeroData) { if (!HeroData.IsInitialized) return false; } + foreach (global::D3.OnlineService.ItemId element in ServicedTokensList) { + 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); + string[] field_names = _escrowFieldNames; + if (hasVersion) { + output.WriteUInt32(1, field_names[4], Version); } - if (HasGenerator) { - output.WriteMessage(2, Generator); + if (hasGenerator) { + output.WriteMessage(2, field_names[0], Generator); } - if (HasHeroData) { - output.WriteMessage(3, HeroData); + if (hasHeroData) { + output.WriteMessage(3, field_names[1], HeroData); } - if (HasState) { - output.WriteUInt32(4, State); + if (hasState) { + output.WriteUInt32(4, field_names[3], State); + } + if (servicedTokens_.Count > 0) { + output.WriteMessageArray(5, field_names[2], servicedTokens_); } UnknownFields.WriteTo(output); } @@ -6271,18 +7397,21 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasVersion) { + if (hasVersion) { size += pb::CodedOutputStream.ComputeUInt32Size(1, Version); } - if (HasGenerator) { + if (hasGenerator) { size += pb::CodedOutputStream.ComputeMessageSize(2, Generator); } - if (HasHeroData) { + if (hasHeroData) { size += pb::CodedOutputStream.ComputeMessageSize(3, HeroData); } - if (HasState) { + if (hasState) { size += pb::CodedOutputStream.ComputeUInt32Size(4, State); } + foreach (global::D3.OnlineService.ItemId element in ServicedTokensList) { + size += pb::CodedOutputStream.ComputeMessageSize(5, element); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -6313,38 +7442,73 @@ public static Escrow ParseDelimitedFrom(global::System.IO.Stream input) { public static Escrow ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Escrow ParseFrom(pb::CodedInputStream input) { + public static Escrow ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Escrow ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - Escrow result = new Escrow(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Escrow MessageBeingBuilt { - get { return result; } + 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 { @@ -6356,12 +7520,11 @@ public override Escrow DefaultInstanceForType { } public override Escrow BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Escrow returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -6375,6 +7538,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Escrow other) { if (other == global::D3.Hero.Escrow.DefaultInstance) return this; + PrepareBuilder(); if (other.HasVersion) { Version = other.Version; } @@ -6387,24 +7551,38 @@ public override Builder MergeFrom(Escrow other) { if (other.HasState) { State = other.State; } + if (other.servicedTokens_.Count != 0) { + result.servicedTokens_.Add(other.servicedTokens_); + } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -6416,16 +7594,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.Items.Generator.Builder subBuilder = global::D3.Items.Generator.CreateBuilder(); - if (HasGenerator) { + if (result.hasGenerator) { subBuilder.MergeFrom(Generator); } input.ReadMessage(subBuilder, extensionRegistry); @@ -6434,7 +7612,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::D3.Hero.SavedData.Builder subBuilder = global::D3.Hero.SavedData.CreateBuilder(); - if (HasHeroData) { + if (result.hasHeroData) { subBuilder.MergeFrom(HeroData); } input.ReadMessage(subBuilder, extensionRegistry); @@ -6442,34 +7620,45 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 32: { - State = input.ReadUInt32(); + result.hasState = input.ReadUInt32(ref result.state_); + break; + } + case 42: { + input.ReadMessageArray(tag, field_name, result.servicedTokens_, global::D3.OnlineService.ItemId.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 HasGenerator { - get { return result.HasGenerator; } + get { return result.hasGenerator; } } public global::D3.Items.Generator Generator { get { return result.Generator; } @@ -6477,19 +7666,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 { @@ -6499,13 +7691,14 @@ 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; } public bool HasHeroData { - get { return result.HasHeroData; } + get { return result.hasHeroData; } } public global::D3.Hero.SavedData HeroData { get { return result.HeroData; } @@ -6513,19 +7706,22 @@ public bool HasHeroData { } public Builder SetHeroData(global::D3.Hero.SavedData value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasHeroData = true; result.heroData_ = value; return this; } public Builder SetHeroData(global::D3.Hero.SavedData.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasHeroData && result.heroData_ != global::D3.Hero.SavedData.DefaultInstance) { result.heroData_ = global::D3.Hero.SavedData.CreateBuilder(result.heroData_).MergeFrom(value).BuildPartial(); } else { @@ -6535,34 +7731,387 @@ public Builder MergeHeroData(global::D3.Hero.SavedData value) { return this; } public Builder ClearHeroData() { + PrepareBuilder(); result.hasHeroData = false; - result.heroData_ = global::D3.Hero.SavedData.DefaultInstance; + result.heroData_ = null; return this; } public bool HasState { - get { return result.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 pbc::IPopsicleList ServicedTokensList { + get { return PrepareBuilder().servicedTokens_; } + } + public int ServicedTokensCount { + get { return result.ServicedTokensCount; } + } + public global::D3.OnlineService.ItemId GetServicedTokens(int index) { + return result.GetServicedTokens(index); + } + public Builder SetServicedTokens(int index, global::D3.OnlineService.ItemId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.servicedTokens_[index] = value; + return this; + } + public Builder SetServicedTokens(int index, global::D3.OnlineService.ItemId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.servicedTokens_[index] = builderForValue.Build(); + return this; + } + public Builder AddServicedTokens(global::D3.OnlineService.ItemId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.servicedTokens_.Add(value); + return this; + } + public Builder AddServicedTokens(global::D3.OnlineService.ItemId.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.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); + } + } + #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/D3/Hireling/Hireling.cs b/src/LibMooNet/D3/Hireling/Hireling.cs similarity index 68% rename from source/D3Proto/D3/Hireling/Hireling.cs rename to src/LibMooNet/D3/Hireling/Hireling.cs index e6e32e1e..ce77ff44 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" + + "AigNEhgKEHBvd2VyX2tleV9wYXJhbXMYCyADKBESDAoEZGVhZBgMIAIoCCJ2" + + "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, 96, 21, 8, 24, 88 }; 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; } } @@ -129,7 +140,7 @@ public int GetPowerKeyParams(int index) { public const int DeadFieldNumber = 12; 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(11, field_names[5], powerKeyParams_); } - if (HasDead) { - output.WriteBool(12, Dead); + if (hasDead) { + output.WriteBool(12, 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,7 +210,7 @@ public override int SerializedSize { size += dataSize; size += 1 * powerKeyParams_.Count; } - if (HasDead) { + if (hasDead) { size += pb::CodedOutputStream.ComputeBoolSize(12, Dead); } size += UnknownFields.SerializedSize; @@ -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 90: case 88: { - AddPowerKeyParams(input.ReadSInt32()); + input.ReadSInt32Array(tag, field_name, result.powerKeyParams_); break; } case 96: { - Dead = input.ReadBool(); + 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 69% rename from source/D3Proto/D3/ItemCrafting/ItemCrafting.cs rename to src/LibMooNet/D3/ItemCrafting/ItemCrafting.cs index b585b16c..28a03ca6 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 @@ -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[] { "available_enchants", "cooldown_end", "level", "recipes" }; + private static readonly uint[] _crafterDataFieldTags = new uint[] { 21, 33, 24, 13 }; public static CrafterData DefaultInstance { get { return defaultInstance; } } public override CrafterData DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override CrafterData ThisMessage { @@ -99,7 +110,7 @@ public int GetAvailableEnchants(int 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); - } + output.WriteSFixed32Array(2, field_names[0], availableEnchants_); } - 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[1], CooldownEnd); } UnknownFields.WriteTo(output); } @@ -165,10 +173,10 @@ public override int SerializedSize { size += dataSize; size += 1 * availableEnchants_.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(); + availableEnchants_.MakeReadOnly(); + return this; + } + public 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_); + result.availableEnchants_.Add(other.availableEnchants_); } 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.availableEnchants_); 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,24 +400,28 @@ 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_; } + get { return PrepareBuilder().availableEnchants_; } } public int AvailableEnchantsCount { get { return result.AvailableEnchantsCount; } @@ -366,53 +430,61 @@ public int GetAvailableEnchants(int index) { return result.GetAvailableEnchants(index); } public Builder SetAvailableEnchants(int index, int value) { + PrepareBuilder(); result.availableEnchants_[index] = value; return this; } public Builder AddAvailableEnchants(int value) { + PrepareBuilder(); result.availableEnchants_.Add(value); return this; } public Builder AddRangeAvailableEnchants(scg::IEnumerable values) { - base.AddRange(values, result.availableEnchants_); + PrepareBuilder(); + result.availableEnchants_.Add(values); return this; } public Builder ClearAvailableEnchants() { + PrepareBuilder(); result.availableEnchants_.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 68% rename from source/D3Proto/D3/Items/Items.cs rename to src/LibMooNet/D3/Items/Items.cs index 80824763..f3ed3ace 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 @@ -41,38 +46,40 @@ 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" + + "EToCLTESIgoWaXRlbV9zdHJpbmdfbGlzdF9pbmRleBgEIAIoEToCLTEiygMK" + + "CUdlbmVyYXRvchIPCgRzZWVkGAEgAigNOgEwEikKCWdiX2hhbmRsZRgCIAIo" + + "CzIWLkQzLkdhbWVCYWxhbmNlLkhhbmRsZRIUCgxiYXNlX2FmZml4ZXMYAyAD" + + "KA8SLgoOcmFyZV9pdGVtX25hbWUYBCACKAsyFi5EMy5JdGVtcy5SYXJlSXRl" + + "bU5hbWUSGQoNZW5jaGFudF9hZmZpeBgFIAIoDzoCLTESGAoMc29ja2V0X2Fm" + + "Zml4GAYgAigPOgItMRIQCgVmbGFncxgHIAIoDToBMBISCgpkdXJhYmlsaXR5" + + "GAggAigNEhIKCnN0YWNrX3NpemUYCSACKAQSEAoIZHllX3R5cGUYCiACKA0S" + + "GgoSaXRlbV9xdWFsaXR5X2xldmVsGAsgAigREhoKEml0ZW1fYmluZGluZ19s" + + "ZXZlbBgMIAIoERIWCg5tYXhfZHVyYWJpbGl0eRgNIAIoDRItCghjb250ZW50" + + "cxgOIAMoCzIbLkQzLkl0ZW1zLkVtYmVkZGVkR2VuZXJhdG9yEhkKDWF0dHVu" + + "ZWRfc2tpbGwYDyABKA86Ai0xEiAKFWl0ZW1fdW5sb2NrX3RpbWVzdGFtcBgQ" + + "IAEoBDoBMCJhChFFbWJlZGRlZEdlbmVyYXRvchIkCgJpZBgBIAIoCzIYLkQz" + + "Lk9ubGluZVNlcnZpY2UuSXRlbUlkEiYKCWdlbmVyYXRvchgCIAIoCzITLkQz" + + "Lkl0ZW1zLkdlbmVyYXRvciKaAgoJU2F2ZWRJdGVtEiQKAmlkGAEgAigLMhgu" + + "RDMuT25saW5lU2VydmljZS5JdGVtSWQSMwoPb3duZXJfZW50aXR5X2lkGAIg" + + "ASgLMhouRDMuT25saW5lU2VydmljZS5FbnRpdHlJZBIrCglzb2NrZXRfaWQY" + + "AyABKAsyGC5EMy5PbmxpbmVTZXJ2aWNlLkl0ZW1JZBIWCg5oaXJlbGluZ19j" + + "bGFzcxgEIAIoERIRCglpdGVtX3Nsb3QYBSACKBESFAoMc3F1YXJlX2luZGV4" + + "GAYgAigREhwKEXVzZWRfc29ja2V0X2NvdW50GAcgAigNOgEwEiYKCWdlbmVy" + + "YXRvchgIIAEoCzITLkQzLkl0ZW1zLkdlbmVyYXRvciJzChJBdWN0aW9uQWNj" + + "b3VudEluZm8SLgoKYWNjb3VudF9pZBgBIAIoCzIaLkQzLk9ubGluZVNlcnZp" + + "Y2UuRW50aXR5SWQSLQoJZXNjcm93X2lkGAIgAigLMhouRDMuT25saW5lU2Vy" + + "dmljZS5FbnRpdHlJZCJbCgtBdWN0aW9uSXRlbRIkCgJpZBgBIAIoCzIYLkQz" + + "Lk9ubGluZVNlcnZpY2UuSXRlbUlkEiYKCWdlbmVyYXRvchgCIAIoCzITLkQz" + + "Lkl0ZW1zLkdlbmVyYXRvciJXCgtBdWN0aW9uSW5mbxIkCgJpZBgBIAIoCzIY" + + "LkQzLk9ubGluZVNlcnZpY2UuSXRlbUlkEiIKBW93bmVyGAIgASgLMhMuRDMu" + + "SXRlbXMuT3duZXJzaGlwIi4KCEl0ZW1MaXN0EiIKBWl0ZW1zGAEgAygLMhMu" + + "RDMuSXRlbXMuU2F2ZWRJdGVtIoQBCglPd25lcnNoaXASMwoPb3duZXJfZW50" + + "aXR5X2lkGAEgAigLMhouRDMuT25saW5lU2VydmljZS5FbnRpdHlJZBITCgtk" + + "ZWxldGVfdGltZRgCIAEoEhItCgllc2Nyb3dfaWQYAyABKAsyGi5EMy5Pbmxp" + + "bmVTZXJ2aWNlLkVudGl0eUlk"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_D3_Items_RareItemName__Descriptor = Descriptor.MessageTypes[0]; @@ -82,7 +89,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", "SocketAffix", "Flags", "Durability", "StackSize", "DyeType", "ItemQualityLevel", "ItemBindingLevel", "MaxDurability", "Contents", "AttunedSkill", "ItemUnlockTimestamp", }); 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, @@ -123,14 +130,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 +160,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 +170,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 +180,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 +190,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 +208,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 +233,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 +275,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 +352,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 +370,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 +387,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 +423,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 +537,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[] { "attuned_skill", "base_affixes", "contents", "durability", "dye_type", "enchant_affix", "flags", "gb_handle", "item_binding_level", "item_quality_level", "item_unlock_timestamp", "max_durability", "rare_item_name", "seed", "socket_affix", "stack_size" }; + private static readonly uint[] _generatorFieldTags = new uint[] { 125, 29, 114, 64, 80, 45, 56, 18, 96, 88, 128, 104, 34, 8, 53, 72 }; public static Generator DefaultInstance { get { return defaultInstance; } } public override Generator DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Generator ThisMessage { @@ -489,7 +567,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 +577,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 +599,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; } } @@ -541,7 +619,7 @@ public int EnchantAffix { public const int SocketAffixFieldNumber = 6; private bool hasSocketAffix; - private int socketAffix_ = 0; + private int socketAffix_ = -1; public bool HasSocketAffix { get { return hasSocketAffix; } } @@ -551,7 +629,7 @@ public int SocketAffix { public const int FlagsFieldNumber = 7; private bool hasFlags; - private uint flags_ = 0; + private uint flags_; public bool HasFlags { get { return hasFlags; } } @@ -561,7 +639,7 @@ public uint Flags { public const int DurabilityFieldNumber = 8; private bool hasDurability; - private uint durability_ = 0; + private uint durability_; public bool HasDurability { get { return hasDurability; } } @@ -571,7 +649,7 @@ public uint Durability { public const int StackSizeFieldNumber = 9; private bool hasStackSize; - private ulong stackSize_ = 0UL; + private ulong stackSize_; public bool HasStackSize { get { return hasStackSize; } } @@ -581,7 +659,7 @@ public ulong StackSize { public const int DyeTypeFieldNumber = 10; private bool hasDyeType; - private uint dyeType_ = 0; + private uint dyeType_; public bool HasDyeType { get { return hasDyeType; } } @@ -591,7 +669,7 @@ public uint DyeType { public const int ItemQualityLevelFieldNumber = 11; private bool hasItemQualityLevel; - private int itemQualityLevel_ = 0; + private int itemQualityLevel_; public bool HasItemQualityLevel { get { return hasItemQualityLevel; } } @@ -601,7 +679,7 @@ public int ItemQualityLevel { public const int ItemBindingLevelFieldNumber = 12; private bool hasItemBindingLevel; - private int itemBindingLevel_ = 0; + private int itemBindingLevel_; public bool HasItemBindingLevel { get { return hasItemBindingLevel; } } @@ -611,7 +689,7 @@ public int ItemBindingLevel { public const int MaxDurabilityFieldNumber = 13; private bool hasMaxDurability; - private uint maxDurability_ = 0; + private uint maxDurability_; public bool HasMaxDurability { get { return hasMaxDurability; } } @@ -633,7 +711,7 @@ public int ContentsCount { public const int AttunedSkillFieldNumber = 15; private bool hasAttunedSkill; - private int attunedSkill_ = 0; + private int attunedSkill_ = -1; public bool HasAttunedSkill { get { return hasAttunedSkill; } } @@ -641,6 +719,16 @@ public int AttunedSkill { get { return attunedSkill_; } } + public const int ItemUnlockTimestampFieldNumber = 16; + private bool hasItemUnlockTimestamp; + private ulong itemUnlockTimestamp_; + public bool HasItemUnlockTimestamp { + get { return hasItemUnlockTimestamp; } + } + public ulong ItemUnlockTimestamp { + get { return itemUnlockTimestamp_; } + } + public override bool IsInitialized { get { if (!hasSeed) return false; @@ -664,54 +752,56 @@ 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[1], baseAffixes_); + } + if (hasRareItemName) { + output.WriteMessage(4, field_names[12], RareItemName); } - if (HasRareItemName) { - output.WriteMessage(4, RareItemName); + if (hasEnchantAffix) { + output.WriteSFixed32(5, field_names[5], EnchantAffix); } - if (HasEnchantAffix) { - output.WriteSFixed32(5, EnchantAffix); + if (hasSocketAffix) { + output.WriteSFixed32(6, field_names[14], SocketAffix); } - if (HasSocketAffix) { - output.WriteSFixed32(6, SocketAffix); + if (hasFlags) { + output.WriteUInt32(7, field_names[6], Flags); } - if (HasFlags) { - output.WriteUInt32(7, Flags); + if (hasDurability) { + output.WriteUInt32(8, field_names[3], Durability); } - if (HasDurability) { - output.WriteUInt32(8, Durability); + if (hasStackSize) { + output.WriteUInt64(9, field_names[15], StackSize); } - if (HasStackSize) { - output.WriteUInt64(9, StackSize); + if (hasDyeType) { + output.WriteUInt32(10, field_names[4], DyeType); } - if (HasDyeType) { - output.WriteUInt32(10, DyeType); + if (hasItemQualityLevel) { + output.WriteSInt32(11, field_names[9], ItemQualityLevel); } - if (HasItemQualityLevel) { - output.WriteSInt32(11, ItemQualityLevel); + if (hasItemBindingLevel) { + output.WriteSInt32(12, field_names[8], ItemBindingLevel); } - if (HasItemBindingLevel) { - output.WriteSInt32(12, ItemBindingLevel); + if (hasMaxDurability) { + output.WriteUInt32(13, field_names[11], MaxDurability); } - if (HasMaxDurability) { - output.WriteUInt32(13, MaxDurability); + if (contents_.Count > 0) { + output.WriteMessageArray(14, field_names[2], contents_); } - foreach (global::D3.Items.EmbeddedGenerator element in ContentsList) { - output.WriteMessage(14, element); + if (hasAttunedSkill) { + output.WriteSFixed32(15, field_names[0], AttunedSkill); } - if (HasAttunedSkill) { - output.WriteSFixed32(15, AttunedSkill); + if (hasItemUnlockTimestamp) { + output.WriteUInt64(16, field_names[10], ItemUnlockTimestamp); } UnknownFields.WriteTo(output); } @@ -723,10 +813,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,42 +825,45 @@ 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) { + if (hasSocketAffix) { size += pb::CodedOutputStream.ComputeSFixed32Size(6, SocketAffix); } - if (HasFlags) { + if (hasFlags) { size += pb::CodedOutputStream.ComputeUInt32Size(7, Flags); } - if (HasDurability) { + if (hasDurability) { size += pb::CodedOutputStream.ComputeUInt32Size(8, Durability); } - if (HasStackSize) { + if (hasStackSize) { size += pb::CodedOutputStream.ComputeUInt64Size(9, StackSize); } - if (HasDyeType) { + if (hasDyeType) { size += pb::CodedOutputStream.ComputeUInt32Size(10, DyeType); } - if (HasItemQualityLevel) { + if (hasItemQualityLevel) { size += pb::CodedOutputStream.ComputeSInt32Size(11, ItemQualityLevel); } - if (HasItemBindingLevel) { + if (hasItemBindingLevel) { size += pb::CodedOutputStream.ComputeSInt32Size(12, ItemBindingLevel); } - if (HasMaxDurability) { + if (hasMaxDurability) { size += pb::CodedOutputStream.ComputeUInt32Size(13, MaxDurability); } foreach (global::D3.Items.EmbeddedGenerator element in ContentsList) { size += pb::CodedOutputStream.ComputeMessageSize(14, element); } - if (HasAttunedSkill) { + if (hasAttunedSkill) { size += pb::CodedOutputStream.ComputeSFixed32Size(15, AttunedSkill); } + if (hasItemUnlockTimestamp) { + size += pb::CodedOutputStream.ComputeUInt64Size(16, ItemUnlockTimestamp); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -801,38 +894,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 +973,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 +991,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 +999,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); @@ -905,29 +1032,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.HasAttunedSkill) { AttunedSkill = other.AttunedSkill; } + if (other.HasItemUnlockTimestamp) { + ItemUnlockTimestamp = other.ItemUnlockTimestamp; + } 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 +1080,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 +1111,85 @@ 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(); + result.hasSocketAffix = input.ReadSFixed32(ref result.socketAffix_); break; } case 56: { - Flags = input.ReadUInt32(); + result.hasFlags = input.ReadUInt32(ref result.flags_); break; } case 64: { - Durability = input.ReadUInt32(); + result.hasDurability = input.ReadUInt32(ref result.durability_); break; } case 72: { - StackSize = input.ReadUInt64(); + result.hasStackSize = input.ReadUInt64(ref result.stackSize_); break; } case 80: { - DyeType = input.ReadUInt32(); + result.hasDyeType = input.ReadUInt32(ref result.dyeType_); break; } case 88: { - ItemQualityLevel = input.ReadSInt32(); + result.hasItemQualityLevel = input.ReadSInt32(ref result.itemQualityLevel_); break; } case 96: { - ItemBindingLevel = input.ReadSInt32(); + result.hasItemBindingLevel = input.ReadSInt32(ref result.itemBindingLevel_); break; } case 104: { - MaxDurability = input.ReadUInt32(); + result.hasMaxDurability = input.ReadUInt32(ref result.maxDurability_); break; } case 114: { - global::D3.Items.EmbeddedGenerator.Builder subBuilder = global::D3.Items.EmbeddedGenerator.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddContents(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.contents_, global::D3.Items.EmbeddedGenerator.DefaultInstance, extensionRegistry); break; } case 125: { - AttunedSkill = input.ReadSFixed32(); + result.hasAttunedSkill = input.ReadSFixed32(ref result.attunedSkill_); + break; + } + case 128: { + result.hasItemUnlockTimestamp = input.ReadUInt64(ref result.itemUnlockTimestamp_); 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 +1197,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 +1222,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 +1238,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 +1267,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 +1292,194 @@ 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; + result.enchantAffix_ = -1; return this; } public bool HasSocketAffix { - get { return result.HasSocketAffix; } + get { return result.hasSocketAffix; } } public int SocketAffix { get { return result.SocketAffix; } set { SetSocketAffix(value); } } public Builder SetSocketAffix(int value) { + PrepareBuilder(); result.hasSocketAffix = true; result.socketAffix_ = value; return this; } public Builder ClearSocketAffix() { + PrepareBuilder(); result.hasSocketAffix = false; - result.socketAffix_ = 0; + result.socketAffix_ = -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; 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 +1489,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; } + get { return result.hasAttunedSkill; } } public int AttunedSkill { get { return result.AttunedSkill; } set { SetAttunedSkill(value); } } public Builder SetAttunedSkill(int value) { + PrepareBuilder(); result.hasAttunedSkill = true; result.attunedSkill_ = value; return this; } public Builder ClearAttunedSkill() { + PrepareBuilder(); result.hasAttunedSkill = false; - result.attunedSkill_ = 0; + result.attunedSkill_ = -1; + return this; + } + + 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; } } @@ -1358,14 +1567,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 +1597,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 +1625,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 +1644,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 +1680,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; + } - EmbeddedGenerator result = new EmbeddedGenerator(); + private bool resultIsReadOnly; + private EmbeddedGenerator result; + + private EmbeddedGenerator PrepareBuilder() { + if (resultIsReadOnly) { + EmbeddedGenerator original = result; + result = new EmbeddedGenerator(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +1757,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 +1775,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 +1786,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 +1822,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 +1836,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 +1845,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 +1862,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 +1887,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 +1902,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 +1927,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 +1938,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 +1968,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 +2008,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 +2018,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 +2028,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 +2038,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 +2067,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 +2104,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 +2158,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; + } - SavedItem result = new SavedItem(); + private bool resultIsReadOnly; + private SavedItem result; + + private SavedItem PrepareBuilder() { + if (resultIsReadOnly) { + SavedItem original = result; + result = new SavedItem(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +2235,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 +2253,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 +2282,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 +2318,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 +2332,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 +2341,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 +2349,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 +2375,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 +2392,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 +2417,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 +2432,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 +2457,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 +2472,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 +2497,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 +2592,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 +2617,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,14 +2628,20 @@ static SavedItem() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class AuctionAccountInfo : pb::GeneratedMessage { - private static readonly AuctionAccountInfo defaultInstance = new Builder().BuildPartial(); + private AuctionAccountInfo() { } + private static readonly AuctionAccountInfo defaultInstance = new AuctionAccountInfo().MakeReadOnly(); + private static readonly string[] _auctionAccountInfoFieldNames = new string[] { "account_id", "escrow_id" }; + private static readonly uint[] _auctionAccountInfoFieldTags = new uint[] { 10, 18 }; public static AuctionAccountInfo DefaultInstance { get { return defaultInstance; } } public override AuctionAccountInfo DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override AuctionAccountInfo ThisMessage { @@ -2297,22 +2658,22 @@ protected override AuctionAccountInfo ThisMessage { public const int AccountIdFieldNumber = 1; private bool hasAccountId; - private global::D3.OnlineService.EntityId accountId_ = global::D3.OnlineService.EntityId.DefaultInstance; + private global::D3.OnlineService.EntityId accountId_; public bool HasAccountId { get { return hasAccountId; } } public global::D3.OnlineService.EntityId AccountId { - get { return accountId_; } + get { return accountId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } } public const int EscrowIdFieldNumber = 2; private bool hasEscrowId; - private global::D3.OnlineService.EntityId escrowId_ = global::D3.OnlineService.EntityId.DefaultInstance; + private global::D3.OnlineService.EntityId escrowId_; public bool HasEscrowId { get { return hasEscrowId; } } public global::D3.OnlineService.EntityId EscrowId { - get { return escrowId_; } + get { return escrowId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -2325,13 +2686,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAccountId) { - output.WriteMessage(1, AccountId); + string[] field_names = _auctionAccountInfoFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); } - if (HasEscrowId) { - output.WriteMessage(2, EscrowId); + if (hasEscrowId) { + output.WriteMessage(2, field_names[1], EscrowId); } UnknownFields.WriteTo(output); } @@ -2343,10 +2705,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAccountId) { + if (hasAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); } - if (HasEscrowId) { + if (hasEscrowId) { size += pb::CodedOutputStream.ComputeMessageSize(2, EscrowId); } size += UnknownFields.SerializedSize; @@ -2379,38 +2741,72 @@ public static AuctionAccountInfo ParseDelimitedFrom(global::System.IO.Stream inp public static AuctionAccountInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static AuctionAccountInfo ParseFrom(pb::CodedInputStream input) { + public static AuctionAccountInfo ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static AuctionAccountInfo ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static AuctionAccountInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private AuctionAccountInfo MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(AuctionAccountInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - AuctionAccountInfo result = new AuctionAccountInfo(); + private bool resultIsReadOnly; + private AuctionAccountInfo result; + + private AuctionAccountInfo PrepareBuilder() { + if (resultIsReadOnly) { + AuctionAccountInfo original = result; + result = new AuctionAccountInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override AuctionAccountInfo MessageBeingBuilt { - get { return result; } + 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 { @@ -2422,12 +2818,11 @@ public override AuctionAccountInfo DefaultInstanceForType { } public override AuctionAccountInfo BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - AuctionAccountInfo returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2441,6 +2836,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(AuctionAccountInfo other) { if (other == global::D3.Items.AuctionAccountInfo.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAccountId) { MergeAccountId(other.AccountId); } @@ -2451,20 +2847,31 @@ public override Builder MergeFrom(AuctionAccountInfo 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(_auctionAccountInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _auctionAccountInfoFieldTags[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,12 +2883,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.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasAccountId) { + if (result.hasAccountId) { subBuilder.MergeFrom(AccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2490,7 +2897,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasEscrowId) { + if (result.hasEscrowId) { subBuilder.MergeFrom(EscrowId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2499,11 +2906,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAccountId { - get { return result.HasAccountId; } + get { return result.hasAccountId; } } public global::D3.OnlineService.EntityId AccountId { get { return result.AccountId; } @@ -2511,19 +2923,22 @@ public bool HasAccountId { } 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"); - if (result.HasAccountId && + PrepareBuilder(); + if (result.hasAccountId && result.accountId_ != global::D3.OnlineService.EntityId.DefaultInstance) { result.accountId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); } else { @@ -2533,13 +2948,14 @@ public Builder MergeAccountId(global::D3.OnlineService.EntityId value) { return this; } public Builder ClearAccountId() { + PrepareBuilder(); result.hasAccountId = false; - result.accountId_ = global::D3.OnlineService.EntityId.DefaultInstance; + result.accountId_ = null; return this; } public bool HasEscrowId { - get { return result.HasEscrowId; } + get { return result.hasEscrowId; } } public global::D3.OnlineService.EntityId EscrowId { get { return result.EscrowId; } @@ -2547,19 +2963,22 @@ public bool HasEscrowId { } 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"); - if (result.HasEscrowId && + PrepareBuilder(); + if (result.hasEscrowId && result.escrowId_ != global::D3.OnlineService.EntityId.DefaultInstance) { result.escrowId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.escrowId_).MergeFrom(value).BuildPartial(); } else { @@ -2569,8 +2988,9 @@ public Builder MergeEscrowId(global::D3.OnlineService.EntityId value) { return this; } public Builder ClearEscrowId() { + PrepareBuilder(); result.hasEscrowId = false; - result.escrowId_ = global::D3.OnlineService.EntityId.DefaultInstance; + result.escrowId_ = null; return this; } } @@ -2579,14 +2999,20 @@ static AuctionAccountInfo() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class AuctionItem : pb::GeneratedMessage { - private static readonly AuctionItem defaultInstance = new Builder().BuildPartial(); + private AuctionItem() { } + private static readonly AuctionItem defaultInstance = new AuctionItem().MakeReadOnly(); + private static readonly string[] _auctionItemFieldNames = new string[] { "generator", "id" }; + private static readonly uint[] _auctionItemFieldTags = new uint[] { 18, 10 }; public static AuctionItem DefaultInstance { get { return defaultInstance; } } public override AuctionItem DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override AuctionItem ThisMessage { @@ -2603,22 +3029,22 @@ protected override AuctionItem 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 { @@ -2631,13 +3057,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 = _auctionItemFieldNames; + 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); } @@ -2649,10 +3076,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; @@ -2685,38 +3112,72 @@ public static AuctionItem ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static AuctionItem ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static AuctionItem ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static AuctionItem ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private AuctionItem MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(AuctionItem cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AuctionItem result; + + private AuctionItem PrepareBuilder() { + if (resultIsReadOnly) { + AuctionItem original = result; + result = new AuctionItem(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - AuctionItem result = new AuctionItem(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override AuctionItem MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new AuctionItem(); + 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 { @@ -2728,12 +3189,11 @@ public override AuctionItem DefaultInstanceForType { } public override AuctionItem BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - AuctionItem returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2747,6 +3207,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(AuctionItem other) { if (other == global::D3.Items.AuctionItem.DefaultInstance) return this; + PrepareBuilder(); if (other.HasId) { MergeId(other.Id); } @@ -2757,20 +3218,31 @@ public override Builder MergeFrom(AuctionItem 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(_auctionItemFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _auctionItemFieldTags[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)) { @@ -2782,12 +3254,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); @@ -2796,7 +3268,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); @@ -2805,11 +3277,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; } @@ -2817,19 +3294,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 { @@ -2839,13 +3319,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; } @@ -2853,19 +3334,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 { @@ -2875,8 +3359,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; } } @@ -2885,14 +3370,20 @@ static AuctionItem() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class AuctionInfo : pb::GeneratedMessage { - private static readonly AuctionInfo defaultInstance = new Builder().BuildPartial(); + private AuctionInfo() { } + private static readonly AuctionInfo defaultInstance = new AuctionInfo().MakeReadOnly(); + private static readonly string[] _auctionInfoFieldNames = new string[] { "id", "owner" }; + private static readonly uint[] _auctionInfoFieldTags = new uint[] { 10, 18 }; public static AuctionInfo DefaultInstance { get { return defaultInstance; } } public override AuctionInfo DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override AuctionInfo ThisMessage { @@ -2909,22 +3400,22 @@ protected override AuctionInfo 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 OwnerFieldNumber = 2; private bool hasOwner; - private global::D3.Items.Ownership owner_ = global::D3.Items.Ownership.DefaultInstance; + private global::D3.Items.Ownership owner_; public bool HasOwner { get { return hasOwner; } } public global::D3.Items.Ownership Owner { - get { return owner_; } + get { return owner_ ?? global::D3.Items.Ownership.DefaultInstance; } } public override bool IsInitialized { @@ -2938,13 +3429,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 = _auctionInfoFieldNames; + if (hasId) { + output.WriteMessage(1, field_names[0], Id); } - if (HasOwner) { - output.WriteMessage(2, Owner); + if (hasOwner) { + output.WriteMessage(2, field_names[1], Owner); } UnknownFields.WriteTo(output); } @@ -2956,10 +3448,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasId) { + if (hasId) { size += pb::CodedOutputStream.ComputeMessageSize(1, Id); } - if (HasOwner) { + if (hasOwner) { size += pb::CodedOutputStream.ComputeMessageSize(2, Owner); } size += UnknownFields.SerializedSize; @@ -2992,38 +3484,72 @@ public static AuctionInfo ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static AuctionInfo ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static AuctionInfo ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static AuctionInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private AuctionInfo MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(AuctionInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - AuctionInfo result = new AuctionInfo(); + private bool resultIsReadOnly; + private AuctionInfo result; + + private AuctionInfo PrepareBuilder() { + if (resultIsReadOnly) { + AuctionInfo original = result; + result = new AuctionInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override AuctionInfo MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new AuctionInfo(); + 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 { @@ -3035,12 +3561,11 @@ public override AuctionInfo DefaultInstanceForType { } public override AuctionInfo BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - AuctionInfo returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3054,6 +3579,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(AuctionInfo other) { if (other == global::D3.Items.AuctionInfo.DefaultInstance) return this; + PrepareBuilder(); if (other.HasId) { MergeId(other.Id); } @@ -3064,20 +3590,31 @@ public override Builder MergeFrom(AuctionInfo 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(_auctionInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _auctionInfoFieldTags[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)) { @@ -3089,12 +3626,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); @@ -3103,7 +3640,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::D3.Items.Ownership.Builder subBuilder = global::D3.Items.Ownership.CreateBuilder(); - if (HasOwner) { + if (result.hasOwner) { subBuilder.MergeFrom(Owner); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3112,11 +3649,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; } @@ -3124,19 +3666,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 { @@ -3146,13 +3691,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 HasOwner { - get { return result.HasOwner; } + get { return result.hasOwner; } } public global::D3.Items.Ownership Owner { get { return result.Owner; } @@ -3160,19 +3706,22 @@ public bool HasOwner { } public Builder SetOwner(global::D3.Items.Ownership value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasOwner = true; result.owner_ = value; return this; } public Builder SetOwner(global::D3.Items.Ownership.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasOwner && result.owner_ != global::D3.Items.Ownership.DefaultInstance) { result.owner_ = global::D3.Items.Ownership.CreateBuilder(result.owner_).MergeFrom(value).BuildPartial(); } else { @@ -3182,8 +3731,9 @@ public Builder MergeOwner(global::D3.Items.Ownership value) { return this; } public Builder ClearOwner() { + PrepareBuilder(); result.hasOwner = false; - result.owner_ = global::D3.Items.Ownership.DefaultInstance; + result.owner_ = null; return this; } } @@ -3192,14 +3742,20 @@ static AuctionInfo() { } } + [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 static readonly ItemList defaultInstance = new Builder().BuildPartial(); + 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 ItemList DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ItemList ThisMessage { @@ -3235,10 +3791,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.Items.SavedItem element in ItemsList) { - output.WriteMessage(1, element); + string[] field_names = _itemListFieldNames; + if (items_.Count > 0) { + output.WriteMessageArray(1, field_names[0], items_); } UnknownFields.WriteTo(output); } @@ -3283,38 +3840,73 @@ public static ItemList ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static ItemList ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ItemList 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(ItemList 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(ItemList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ItemList result = new ItemList(); + private bool resultIsReadOnly; + private ItemList result; + + private ItemList PrepareBuilder() { + if (resultIsReadOnly) { + ItemList original = result; + result = new ItemList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ItemList MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ItemList(); + 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 { @@ -3326,13 +3918,11 @@ public override ItemList DefaultInstanceForType { } public override ItemList BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.items_.MakeReadOnly(); - ItemList returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3346,27 +3936,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ItemList other) { if (other == global::D3.Items.ItemList.DefaultInstance) return this; + PrepareBuilder(); if (other.items_.Count != 0) { - base.AddRange(other.items_, result.items_); + 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)) { @@ -3378,22 +3980,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.Items.SavedItem.Builder subBuilder = global::D3.Items.SavedItem.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddItems(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 pbc::IPopsicleList ItemsList { - get { return result.items_; } + get { return PrepareBuilder().items_; } } public int ItemsCount { get { return result.ItemsCount; } @@ -3403,29 +4008,35 @@ public int ItemsCount { } public Builder SetItems(int index, global::D3.Items.SavedItem value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.items_[index] = value; return this; } 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 Builder AddItems(global::D3.Items.SavedItem value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.items_.Add(value); return this; } public Builder AddItems(global::D3.Items.SavedItem.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.items_.Add(builderForValue.Build()); return this; } public Builder AddRangeItems(scg::IEnumerable values) { - base.AddRange(values, result.items_); + PrepareBuilder(); + result.items_.Add(values); return this; } public Builder ClearItems() { + PrepareBuilder(); result.items_.Clear(); return this; } @@ -3435,14 +4046,20 @@ static ItemList() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Ownership : pb::GeneratedMessage { - private static readonly Ownership defaultInstance = new Builder().BuildPartial(); + private Ownership() { } + private static readonly Ownership defaultInstance = new Ownership().MakeReadOnly(); + private static readonly string[] _ownershipFieldNames = new string[] { "delete_time", "escrow_id", "owner_entity_id" }; + private static readonly uint[] _ownershipFieldTags = new uint[] { 16, 26, 10 }; public static Ownership DefaultInstance { get { return defaultInstance; } } public override Ownership DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Ownership ThisMessage { @@ -3459,17 +4076,17 @@ protected override Ownership ThisMessage { public const int OwnerEntityIdFieldNumber = 1; 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 DeleteTimeFieldNumber = 2; private bool hasDeleteTime; - private long deleteTime_ = 0; + private long deleteTime_; public bool HasDeleteTime { get { return hasDeleteTime; } } @@ -3479,12 +4096,12 @@ public long DeleteTime { public const int EscrowIdFieldNumber = 3; private bool hasEscrowId; - private global::D3.OnlineService.EntityId escrowId_ = global::D3.OnlineService.EntityId.DefaultInstance; + private global::D3.OnlineService.EntityId escrowId_; public bool HasEscrowId { get { return hasEscrowId; } } public global::D3.OnlineService.EntityId EscrowId { - get { return escrowId_; } + get { return escrowId_ ?? global::D3.OnlineService.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -3498,16 +4115,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOwnerEntityId) { - output.WriteMessage(1, OwnerEntityId); + string[] field_names = _ownershipFieldNames; + if (hasOwnerEntityId) { + output.WriteMessage(1, field_names[2], OwnerEntityId); } - if (HasDeleteTime) { - output.WriteSInt64(2, DeleteTime); + if (hasDeleteTime) { + output.WriteSInt64(2, field_names[0], DeleteTime); } - if (HasEscrowId) { - output.WriteMessage(3, EscrowId); + if (hasEscrowId) { + output.WriteMessage(3, field_names[1], EscrowId); } UnknownFields.WriteTo(output); } @@ -3519,13 +4137,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOwnerEntityId) { + if (hasOwnerEntityId) { size += pb::CodedOutputStream.ComputeMessageSize(1, OwnerEntityId); } - if (HasDeleteTime) { + if (hasDeleteTime) { size += pb::CodedOutputStream.ComputeSInt64Size(2, DeleteTime); } - if (HasEscrowId) { + if (hasEscrowId) { size += pb::CodedOutputStream.ComputeMessageSize(3, EscrowId); } size += UnknownFields.SerializedSize; @@ -3558,38 +4176,72 @@ public static Ownership ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Ownership ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Ownership ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Ownership ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Ownership MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(Ownership cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - Ownership result = new Ownership(); + private bool resultIsReadOnly; + private Ownership result; + + private Ownership PrepareBuilder() { + if (resultIsReadOnly) { + Ownership original = result; + result = new Ownership(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Ownership MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Ownership(); + 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 { @@ -3601,12 +4253,11 @@ public override Ownership DefaultInstanceForType { } public override Ownership BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Ownership returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3620,6 +4271,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Ownership other) { if (other == global::D3.Items.Ownership.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOwnerEntityId) { MergeOwnerEntityId(other.OwnerEntityId); } @@ -3633,20 +4285,31 @@ public override Builder MergeFrom(Ownership 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(_ownershipFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _ownershipFieldTags[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)) { @@ -3658,12 +4321,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.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasOwnerEntityId) { + if (result.hasOwnerEntityId) { subBuilder.MergeFrom(OwnerEntityId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3671,12 +4334,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - DeleteTime = input.ReadSInt64(); + result.hasDeleteTime = input.ReadSInt64(ref result.deleteTime_); break; } case 26: { global::D3.OnlineService.EntityId.Builder subBuilder = global::D3.OnlineService.EntityId.CreateBuilder(); - if (HasEscrowId) { + if (result.hasEscrowId) { subBuilder.MergeFrom(EscrowId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3685,11 +4348,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasOwnerEntityId { - get { return result.HasOwnerEntityId; } + get { return result.hasOwnerEntityId; } } public global::D3.OnlineService.EntityId OwnerEntityId { get { return result.OwnerEntityId; } @@ -3697,19 +4365,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 { @@ -3719,31 +4390,34 @@ 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 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; } public bool HasEscrowId { - get { return result.HasEscrowId; } + get { return result.hasEscrowId; } } public global::D3.OnlineService.EntityId EscrowId { get { return result.EscrowId; } @@ -3751,19 +4425,22 @@ public bool HasEscrowId { } 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"); - if (result.HasEscrowId && + PrepareBuilder(); + if (result.hasEscrowId && result.escrowId_ != global::D3.OnlineService.EntityId.DefaultInstance) { result.escrowId_ = global::D3.OnlineService.EntityId.CreateBuilder(result.escrowId_).MergeFrom(value).BuildPartial(); } else { @@ -3773,8 +4450,9 @@ public Builder MergeEscrowId(global::D3.OnlineService.EntityId value) { return this; } public Builder ClearEscrowId() { + PrepareBuilder(); result.hasEscrowId = false; - result.escrowId_ = global::D3.OnlineService.EntityId.DefaultInstance; + result.escrowId_ = null; return this; } } @@ -3786,3 +4464,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 67% rename from source/D3Proto/D3/OnlineService/OnlineService.cs rename to src/LibMooNet/D3/OnlineService/OnlineService.cs index 16e8b41d..07f91e88 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" + + "ygEKEEdhbWVDcmVhdGVQYXJhbXMSEQoJZ2FtZV90eXBlGAEgAigREhkKDmNy" + + "ZWF0aW9uX2ZsYWdzGAIgAigNOgEwEjAKBGNvb3AYAyABKAsyIi5EMy5Pbmxp" + + "bmVTZXJ2aWNlLkNvb3BDcmVhdGVQYXJhbXMSLgoDcHZwGAQgASgLMiEuRDMu" + + "T25saW5lU2VydmljZS5QdlBDcmVhdGVQYXJhbXMSDAoEbmFtZRgFIAEoCRIY" + + "Cgppc19wcml2YXRlGAYgAigIOgR0cnVlImAKEEhlcm9DcmVhdGVQYXJhbXMS" + + "FgoKZ2JpZF9jbGFzcxgBIAIoDzoCLTESGgoLaXNfaGFyZGNvcmUYAiACKAg6" + + "BWZhbHNlEhgKCWlzX2ZlbWFsZRgDIAIoCDoFZmFsc2U="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_D3_OnlineService_EntityId__Descriptor = Descriptor.MessageTypes[0]; @@ -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; + } + + private bool resultIsReadOnly; + private GameId result; - GameId result = new GameId(); + 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; + } - ItemId result = new ItemId(); + private bool resultIsReadOnly; + private ItemId result; + + private ItemId PrepareBuilder() { + if (resultIsReadOnly) { + ItemId original = result; + result = new ItemId(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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; + } + + private bool resultIsReadOnly; + private CoopCreateParams result; - CoopCreateParams result = new CoopCreateParams(); + 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; + } + + private bool resultIsReadOnly; + private PvPCreateParams result; - PvPCreateParams result = new PvPCreateParams(); + 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", "is_private", "name", "pvp" }; + private static readonly uint[] _gameCreateParamsFieldTags = new uint[] { 26, 16, 8, 48, 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; @@ -1692,7 +2021,7 @@ public string Name { public const int IsPrivateFieldNumber = 6; private bool hasIsPrivate; - private bool isPrivate_ = false; + private bool isPrivate_ = true; public bool HasIsPrivate { get { return hasIsPrivate; } } @@ -1715,25 +2044,26 @@ 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); + string[] field_names = _gameCreateParamsFieldNames; + if (hasGameType) { + output.WriteSInt32(1, field_names[2], GameType); } - if (HasCreationFlags) { - output.WriteUInt32(2, CreationFlags); + if (hasCreationFlags) { + output.WriteUInt32(2, field_names[1], CreationFlags); } - if (HasCoop) { - output.WriteMessage(3, Coop); + if (hasCoop) { + output.WriteMessage(3, field_names[0], Coop); } - if (HasPvp) { - output.WriteMessage(4, Pvp); + if (hasPvp) { + output.WriteMessage(4, field_names[5], Pvp); } - if (HasName) { - output.WriteString(5, Name); + if (hasName) { + output.WriteString(5, field_names[4], Name); } - if (HasIsPrivate) { - output.WriteBool(6, IsPrivate); + if (hasIsPrivate) { + output.WriteBool(6, field_names[3], IsPrivate); } UnknownFields.WriteTo(output); } @@ -1745,22 +2075,22 @@ 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) { + if (hasIsPrivate) { size += pb::CodedOutputStream.ComputeBoolSize(6, IsPrivate); } size += UnknownFields.SerializedSize; @@ -1793,38 +2123,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 +2200,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 +2218,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; } @@ -1877,20 +2241,31 @@ public override Builder MergeFrom(GameCreateParams 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(_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 +2277,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 +2299,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 +2307,65 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 42: { - Name = input.ReadString(); + result.hasName = input.ReadString(ref result.name_); break; } case 48: { - IsPrivate = input.ReadBool(); + result.hasIsPrivate = input.ReadBool(ref result.isPrivate_); 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 +2373,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 +2398,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 +2413,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 +2438,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,31 +2453,35 @@ 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; } + get { return result.hasIsPrivate; } } public bool IsPrivate { get { return result.IsPrivate; } set { SetIsPrivate(value); } } public Builder SetIsPrivate(bool value) { + PrepareBuilder(); result.hasIsPrivate = true; result.isPrivate_ = value; return this; } public Builder ClearIsPrivate() { + PrepareBuilder(); result.hasIsPrivate = false; - result.isPrivate_ = false; + result.isPrivate_ = true; return this; } } @@ -2094,14 +2490,20 @@ static GameCreateParams() { } } + [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" }; + private static readonly uint[] _heroCreateParamsFieldTags = new uint[] { 13, 24, 16 }; public static HeroCreateParams DefaultInstance { get { return defaultInstance; } } public override HeroCreateParams DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override HeroCreateParams ThisMessage { @@ -2118,7 +2520,7 @@ protected override HeroCreateParams ThisMessage { public const int GbidClassFieldNumber = 1; private bool hasGbidClass; - private int gbidClass_ = 0; + private int gbidClass_ = -1; public bool HasGbidClass { get { return hasGbidClass; } } @@ -2128,7 +2530,7 @@ public int GbidClass { public const int IsHardcoreFieldNumber = 2; private bool hasIsHardcore; - private bool isHardcore_ = false; + private bool isHardcore_; public bool HasIsHardcore { get { return hasIsHardcore; } } @@ -2138,7 +2540,7 @@ public bool IsHardcore { public const int IsFemaleFieldNumber = 3; private bool hasIsFemale; - private bool isFemale_ = false; + private bool isFemale_; public bool HasIsFemale { get { return hasIsFemale; } } @@ -2155,16 +2557,17 @@ 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 (hasGbidClass) { + output.WriteSFixed32(1, field_names[0], GbidClass); } - if (HasIsHardcore) { - output.WriteBool(2, IsHardcore); + if (hasIsHardcore) { + output.WriteBool(2, field_names[2], IsHardcore); } - if (HasIsFemale) { - output.WriteBool(3, IsFemale); + if (hasIsFemale) { + output.WriteBool(3, field_names[1], IsFemale); } UnknownFields.WriteTo(output); } @@ -2176,13 +2579,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasGbidClass) { + if (hasGbidClass) { size += pb::CodedOutputStream.ComputeSFixed32Size(1, GbidClass); } - if (HasIsHardcore) { + if (hasIsHardcore) { size += pb::CodedOutputStream.ComputeBoolSize(2, IsHardcore); } - if (HasIsFemale) { + if (hasIsFemale) { size += pb::CodedOutputStream.ComputeBoolSize(3, IsFemale); } size += UnknownFields.SerializedSize; @@ -2215,38 +2618,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; + } - HeroCreateParams result = new HeroCreateParams(); + private bool resultIsReadOnly; + private HeroCreateParams result; + + private HeroCreateParams PrepareBuilder() { + if (resultIsReadOnly) { + HeroCreateParams original = result; + result = new HeroCreateParams(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +2695,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 +2713,7 @@ 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.HasGbidClass) { GbidClass = other.GbidClass; } @@ -2290,20 +2727,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 +2763,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: { - GbidClass = input.ReadSFixed32(); + result.hasGbidClass = input.ReadSFixed32(ref result.gbidClass_); break; } case 16: { - IsHardcore = input.ReadBool(); + result.hasIsHardcore = input.ReadBool(ref result.isHardcore_); break; } case 24: { - IsFemale = input.ReadBool(); + result.hasIsFemale = input.ReadBool(ref result.isFemale_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + 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 +2856,5 @@ static HeroCreateParams() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/D3/PartyMessage/PartyMessage.cs b/src/LibMooNet/D3/PartyMessage/PartyMessage.cs similarity index 69% rename from source/D3Proto/D3/PartyMessage/PartyMessage.cs rename to src/LibMooNet/D3/PartyMessage/PartyMessage.cs index b4feabe9..7df2eabc 100644 --- a/source/D3Proto/D3/PartyMessage/PartyMessage.cs +++ b/src/LibMooNet/D3/PartyMessage/PartyMessage.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.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 @@ -53,14 +58,20 @@ static PartyMessage() { } #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 static readonly ScreenStatus defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override ScreenStatus ThisMessage { @@ -77,7 +88,7 @@ protected override ScreenStatus ThisMessage { public const int ScreenFieldNumber = 1; private bool hasScreen; - private int screen_ = 0; + private int screen_; public bool HasScreen { get { return hasScreen; } } @@ -87,7 +98,7 @@ public int Screen { public const int StatusFieldNumber = 2; private bool hasStatus; - private int status_ = 0; + private int status_; public bool HasStatus { get { return hasStatus; } } @@ -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 (HasScreen) { - output.WriteInt32(1, Screen); + string[] field_names = _screenStatusFieldNames; + if (hasScreen) { + output.WriteInt32(1, field_names[0], Screen); } - if (HasStatus) { - output.WriteInt32(2, Status); + if (hasStatus) { + output.WriteInt32(2, field_names[1], Status); } UnknownFields.WriteTo(output); } @@ -121,10 +133,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasScreen) { + if (hasScreen) { size += pb::CodedOutputStream.ComputeInt32Size(1, Screen); } - if (HasStatus) { + if (hasStatus) { size += pb::CodedOutputStream.ComputeInt32Size(2, Status); } size += UnknownFields.SerializedSize; @@ -157,38 +169,72 @@ public static ScreenStatus ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static ScreenStatus ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ScreenStatus ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(ScreenStatus cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ScreenStatus result = new ScreenStatus(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ScreenStatus(); + 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 ScreenStatus DefaultInstanceForType { } public override ScreenStatus BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ScreenStatus 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(ScreenStatus other) { if (other == global::D3.PartyMessage.ScreenStatus.DefaultInstance) return this; + PrepareBuilder(); if (other.HasScreen) { Screen = other.Screen; } @@ -229,20 +275,31 @@ public override Builder MergeFrom(ScreenStatus 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(_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: { - 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: { - Screen = input.ReadInt32(); + result.hasScreen = input.ReadInt32(ref result.screen_); break; } case 16: { - Status = input.ReadInt32(); + result.hasStatus = input.ReadInt32(ref result.status_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasScreen { - get { return result.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; } + 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; @@ -311,14 +377,20 @@ static ScreenStatus() { } } + [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 static readonly SearchForPublicGameParams defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override SearchForPublicGameParams ThisMessage { @@ -335,7 +407,7 @@ protected override SearchForPublicGameParams ThisMessage { public const int StartTimeFieldNumber = 1; private bool hasStartTime; - private long startTime_ = 0; + private long startTime_; public bool HasStartTime { get { return hasStartTime; } } @@ -345,7 +417,7 @@ public long StartTime { public const int SecondsToSearchFieldNumber = 2; private bool hasSecondsToSearch; - private uint secondsToSearch_ = 0; + private uint secondsToSearch_; public bool HasSecondsToSearch { get { return hasSecondsToSearch; } } @@ -355,17 +427,17 @@ public uint SecondsToSearch { public const int GameParamsFieldNumber = 3; private bool hasGameParams; - private global::D3.OnlineService.GameCreateParams gameParams_ = global::D3.OnlineService.GameCreateParams.DefaultInstance; + private global::D3.OnlineService.GameCreateParams gameParams_; public bool HasGameParams { get { return hasGameParams; } } public global::D3.OnlineService.GameCreateParams GameParams { - get { return gameParams_; } + get { return gameParams_ ?? global::D3.OnlineService.GameCreateParams.DefaultInstance; } } public const int RemoveReasonFieldNumber = 4; private bool hasRemoveReason; - private int removeReason_ = 0; + private int removeReason_; public bool HasRemoveReason { get { return hasRemoveReason; } } @@ -382,19 +454,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasStartTime) { - output.WriteSInt64(1, StartTime); + string[] field_names = _searchForPublicGameParamsFieldNames; + if (hasStartTime) { + output.WriteSInt64(1, field_names[3], StartTime); } - if (HasSecondsToSearch) { - output.WriteUInt32(2, SecondsToSearch); + if (hasSecondsToSearch) { + output.WriteUInt32(2, field_names[2], SecondsToSearch); } - if (HasGameParams) { - output.WriteMessage(3, GameParams); + if (hasGameParams) { + output.WriteMessage(3, field_names[0], GameParams); } - if (HasRemoveReason) { - output.WriteInt32(4, RemoveReason); + if (hasRemoveReason) { + output.WriteInt32(4, field_names[1], RemoveReason); } UnknownFields.WriteTo(output); } @@ -406,16 +479,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasStartTime) { + if (hasStartTime) { size += pb::CodedOutputStream.ComputeSInt64Size(1, StartTime); } - if (HasSecondsToSearch) { + if (hasSecondsToSearch) { size += pb::CodedOutputStream.ComputeUInt32Size(2, SecondsToSearch); } - if (HasGameParams) { + if (hasGameParams) { size += pb::CodedOutputStream.ComputeMessageSize(3, GameParams); } - if (HasRemoveReason) { + if (hasRemoveReason) { size += pb::CodedOutputStream.ComputeInt32Size(4, RemoveReason); } size += UnknownFields.SerializedSize; @@ -448,38 +521,72 @@ public static SearchForPublicGameParams ParseDelimitedFrom(global::System.IO.Str 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) { + public static SearchForPublicGameParams ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SearchForPublicGameParams ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(SearchForPublicGameParams cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SearchForPublicGameParams result = new SearchForPublicGameParams(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SearchForPublicGameParams(); + 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 { @@ -491,12 +598,11 @@ public override SearchForPublicGameParams DefaultInstanceForType { } public override SearchForPublicGameParams BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SearchForPublicGameParams returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -510,6 +616,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SearchForPublicGameParams other) { if (other == global::D3.PartyMessage.SearchForPublicGameParams.DefaultInstance) return this; + PrepareBuilder(); if (other.HasStartTime) { StartTime = other.StartTime; } @@ -526,20 +633,31 @@ public override Builder MergeFrom(SearchForPublicGameParams 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -551,20 +669,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: { - StartTime = input.ReadSInt64(); + result.hasStartTime = input.ReadSInt64(ref result.startTime_); break; } case 16: { - SecondsToSearch = input.ReadUInt32(); + result.hasSecondsToSearch = input.ReadUInt32(ref result.secondsToSearch_); break; } case 26: { global::D3.OnlineService.GameCreateParams.Builder subBuilder = global::D3.OnlineService.GameCreateParams.CreateBuilder(); - if (HasGameParams) { + if (result.hasGameParams) { subBuilder.MergeFrom(GameParams); } input.ReadMessage(subBuilder, extensionRegistry); @@ -572,52 +690,61 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 32: { - RemoveReason = input.ReadInt32(); + result.hasRemoveReason = input.ReadInt32(ref result.removeReason_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasStartTime { - get { return result.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; } + 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; } + get { return result.hasGameParams; } } public global::D3.OnlineService.GameCreateParams GameParams { get { return result.GameParams; } @@ -625,19 +752,22 @@ public bool HasGameParams { } 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"); - if (result.HasGameParams && + PrepareBuilder(); + if (result.hasGameParams && result.gameParams_ != global::D3.OnlineService.GameCreateParams.DefaultInstance) { result.gameParams_ = global::D3.OnlineService.GameCreateParams.CreateBuilder(result.gameParams_).MergeFrom(value).BuildPartial(); } else { @@ -647,24 +777,27 @@ public Builder MergeGameParams(global::D3.OnlineService.GameCreateParams value) return this; } public Builder ClearGameParams() { + PrepareBuilder(); result.hasGameParams = false; - result.gameParams_ = global::D3.OnlineService.GameCreateParams.DefaultInstance; + result.gameParams_ = null; return this; } public bool HasRemoveReason { - get { return result.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; @@ -678,3 +811,5 @@ static SearchForPublicGameParams() { #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..bf92ab95 --- /dev/null +++ b/src/LibMooNet/D3/Profile/Profile.cs @@ -0,0 +1,4528 @@ +// 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_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" + + "aWN1bHR5GAMgASgNOgEwIjQKDVNraWxsV2l0aFJ1bmUSEQoFc2tpbGwYASAC" + + "KA86Ai0xEhAKBHJ1bmUYAiABKA86Ai0xIjsKD1NraWxsc1dpdGhSdW5lcxIo" + + "CgVydW5lcxgBIAMoCzIZLkQzLlByb2ZpbGUuU2tpbGxXaXRoUnVuZSIjCg1Q" + + "YXNzaXZlU2tpbGxzEhIKCnNub190cmFpdHMYASADKA8ilwYKC0hlcm9Qcm9m" + + "aWxlEhcKD21vbnN0ZXJzX2tpbGxlZBgBIAEoBBIVCg1lbGl0ZXNfa2lsbGVk" + + "GAIgASgEEhYKDmdvbGRfY29sbGVjdGVkGAMgASgEEhUKDWhpZ2hlc3RfbGV2" + + "ZWwYBCABKA0SGgoSaGlnaGVzdF9kaWZmaWN1bHR5GAUgASgNEhMKC2NyZWF0" + + "ZV90aW1lGAYgASgNEhcKCGhhcmRjb3JlGAcgASgIOgVmYWxzZRIOCgZhdHRh" + + "Y2sYCCABKA0SEQoJcHJlY2lzaW9uGAkgASgNEg8KB2RlZmVuc2UYCiABKA0S" + + "EAoIdml0YWxpdHkYCyABKA0SDQoFYXJtb3IYDCABKA0SCwoDZHBzGA0gASgC" + + "EhUKDXJlc2lzdF9hcmNhbmUYDiABKA0SEwoLcmVzaXN0X2ZpcmUYDyABKA0S" + + "GAoQcmVzaXN0X2xpZ2h0bmluZxgQIAEoDRIVCg1yZXNpc3RfcG9pc29uGBEg" + + "ASgNEhMKC3Jlc2lzdF9jb2xkGBIgASgNEiUKCWVxdWlwbWVudBgTIAEoCzIS" + + "LkQzLkl0ZW1zLkl0ZW1MaXN0EjYKEXNub19hY3RpdmVfc2tpbGxzGBQgASgL" + + "MhsuRDMuUHJvZmlsZS5Ta2lsbHNXaXRoUnVuZXMSLQoKc25vX3RyYWl0cxgV" + + "IAEoCzIZLkQzLlByb2ZpbGUuUGFzc2l2ZVNraWxscxISCgpkZWF0aF90aW1l" + + "GBYgASgNEiYKBmtpbGxlchgXIAEoCzIWLkQzLkdhbWVCYWxhbmNlLkhhbmRs" + + "ZRItCg1raWxsX2xvY2F0aW9uGBggASgLMhYuRDMuR2FtZUJhbGFuY2UuSGFu" + + "ZGxlEg8KB2VwaXRhcGgYGSABKAkSKwoHaGVyb19pZBgaIAEoCzIaLkQzLk9u" + + "bGluZVNlcnZpY2UuRW50aXR5SWQSFwoPZGFtYWdlX2luY3JlYXNlGBsgASgC" + + "EhMKC2NyaXRfY2hhbmNlGBwgASgCEhgKEGRhbWFnZV9yZWR1Y3Rpb24YHSAB" + + "KAISDAoEbGlmZRgeIAEoDSI5Cg9IZXJvUHJvZmlsZUxpc3QSJgoFaGVyb3MY" + + "ASADKAsyFy5EMy5Qcm9maWxlLkhlcm9Qcm9maWxlIpcFCg5BY2NvdW50UHJv" + + "ZmlsZRIaChJoaWdoZXN0X2RpZmZpY3VsdHkYASABKA0SIQoZaGlnaGVzdF9i" + + "b3NzX2RpZmZpY3VsdHlfMRgCIAEoDRIhChloaWdoZXN0X2Jvc3NfZGlmZmlj" + + "dWx0eV8yGAMgASgNEiEKGWhpZ2hlc3RfYm9zc19kaWZmaWN1bHR5XzMYBCAB" + + "KA0SIQoZaGlnaGVzdF9ib3NzX2RpZmZpY3VsdHlfNBgFIAEoDRIaCg9tb25z" + + "dGVyc19raWxsZWQYBiABKAQ6ATASGAoNZWxpdGVzX2tpbGxlZBgHIAEoBDoB" + + "MBIZCg5nb2xkX2NvbGxlY3RlZBgIIAEoBDoBMBIeChZoaWdoZXN0X2hhcmRj" + + "b3JlX2xldmVsGAkgASgEEiAKGGhhcmRjb3JlX21vbnN0ZXJzX2tpbGxlZBgK" + + "IAEoBBIuCg9jbGFzc19iYXJiYXJpYW4YCyABKAsyFS5EMy5Qcm9maWxlLkNs" + + "YXNzSW5mbxIwChFjbGFzc19kZW1vbmh1bnRlchgMIAEoCzIVLkQzLlByb2Zp" + + "bGUuQ2xhc3NJbmZvEikKCmNsYXNzX21vbmsYDSABKAsyFS5EMy5Qcm9maWxl" + + "LkNsYXNzSW5mbxIwChFjbGFzc193aXRjaGRvY3RvchgOIAEoCzIVLkQzLlBy" + + "b2ZpbGUuQ2xhc3NJbmZvEisKDGNsYXNzX3dpemFyZBgPIAEoCzIVLkQzLlBy" + + "b2ZpbGUuQ2xhc3NJbmZvEh4KFmFjaGlldmVtZW50X3Nob3djYXNlXzAYECAB" + + "KAQSHgoWYWNoaWV2ZW1lbnRfc2hvd2Nhc2VfMRgRIAEoBBIeChZhY2hpZXZl" + + "bWVudF9zaG93Y2FzZV8yGBIgASgE"); + 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", "Rune", }); + 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_HeroProfile__Descriptor = Descriptor.MessageTypes[4]; + 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", "Attack", "Precision", "Defense", "Vitality", "Armor", "Dps", "ResistArcane", "ResistFire", "ResistLightning", "ResistPoison", "ResistCold", "Equipment", "SnoActiveSkills", "SnoTraits", "DeathTime", "Killer", "KillLocation", "Epitaph", "HeroId", "DamageIncrease", "CritChance", "DamageReduction", "Life", }); + internal__static_D3_Profile_HeroProfileList__Descriptor = Descriptor.MessageTypes[5]; + 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[6]; + 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", "AchievementShowcase0", "AchievementShowcase1", "AchievementShowcase2", }); + 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", "skill" }; + private static readonly uint[] _skillWithRuneFieldTags = new uint[] { 21, 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 RuneFieldNumber = 2; + private bool hasRune; + private int rune_ = -1; + public bool HasRune { + get { return hasRune; } + } + public int Rune { + get { return rune_; } + } + + 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 (hasRune) { + output.WriteSFixed32(2, field_names[0], Rune); + } + 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 (hasRune) { + size += pb::CodedOutputStream.ComputeSFixed32Size(2, Rune); + } + 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.HasRune) { + Rune = other.Rune; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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 21: { + result.hasRune = input.ReadSFixed32(ref result.rune_); + 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 HasRune { + get { return result.hasRune; } + } + public int Rune { + get { return result.Rune; } + set { SetRune(value); } + } + public Builder SetRune(int value) { + PrepareBuilder(); + result.hasRune = true; + result.rune_ = value; + return this; + } + public Builder ClearRune() { + PrepareBuilder(); + result.hasRune = false; + result.rune_ = -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 HeroProfile : pb::GeneratedMessage { + private HeroProfile() { } + private static readonly HeroProfile defaultInstance = new HeroProfile().MakeReadOnly(); + private static readonly string[] _heroProfileFieldNames = new string[] { "armor", "attack", "create_time", "crit_chance", "damage_increase", "damage_reduction", "death_time", "defense", "dps", "elites_killed", "epitaph", "equipment", "gold_collected", "hardcore", "hero_id", "highest_difficulty", "highest_level", "kill_location", "killer", "life", "monsters_killed", "precision", "resist_arcane", "resist_cold", "resist_fire", "resist_lightning", "resist_poison", "sno_active_skills", "sno_traits", "vitality" }; + private static readonly uint[] _heroProfileFieldTags = new uint[] { 96, 64, 48, 229, 221, 237, 176, 80, 109, 16, 202, 154, 24, 56, 210, 40, 32, 194, 186, 240, 8, 72, 112, 144, 120, 128, 136, 162, 170, 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 AttackFieldNumber = 8; + private bool hasAttack; + private uint attack_; + public bool HasAttack { + get { return hasAttack; } + } + public uint Attack { + get { return attack_; } + } + + public const int PrecisionFieldNumber = 9; + private bool hasPrecision; + private uint precision_; + public bool HasPrecision { + get { return hasPrecision; } + } + public uint Precision { + get { return precision_; } + } + + public const int DefenseFieldNumber = 10; + private bool hasDefense; + private uint defense_; + public bool HasDefense { + get { return hasDefense; } + } + public uint Defense { + get { return defense_; } + } + + 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 KillerFieldNumber = 23; + private bool hasKiller; + private global::D3.GameBalance.Handle killer_; + public bool HasKiller { + get { return hasKiller; } + } + public global::D3.GameBalance.Handle Killer { + get { return killer_ ?? global::D3.GameBalance.Handle.DefaultInstance; } + } + + public const int KillLocationFieldNumber = 24; + private bool hasKillLocation; + private global::D3.GameBalance.Handle killLocation_; + public bool HasKillLocation { + get { return hasKillLocation; } + } + public global::D3.GameBalance.Handle KillLocation { + get { return killLocation_ ?? global::D3.GameBalance.Handle.DefaultInstance; } + } + + public const int EpitaphFieldNumber = 25; + private bool hasEpitaph; + private string epitaph_ = ""; + public bool HasEpitaph { + get { return hasEpitaph; } + } + public string Epitaph { + get { return epitaph_; } + } + + public const int HeroIdFieldNumber = 26; + 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 = 27; + private bool hasDamageIncrease; + private float damageIncrease_; + public bool HasDamageIncrease { + get { return hasDamageIncrease; } + } + public float DamageIncrease { + get { return damageIncrease_; } + } + + public const int CritChanceFieldNumber = 28; + private bool hasCritChance; + private float critChance_; + public bool HasCritChance { + get { return hasCritChance; } + } + public float CritChance { + get { return critChance_; } + } + + public const int DamageReductionFieldNumber = 29; + private bool hasDamageReduction; + private float damageReduction_; + public bool HasDamageReduction { + get { return hasDamageReduction; } + } + public float DamageReduction { + get { return damageReduction_; } + } + + public const int LifeFieldNumber = 30; + 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 (HasKiller) { + if (!Killer.IsInitialized) return false; + } + if (HasKillLocation) { + if (!KillLocation.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[20], MonstersKilled); + } + if (hasElitesKilled) { + output.WriteUInt64(2, field_names[9], ElitesKilled); + } + if (hasGoldCollected) { + output.WriteUInt64(3, field_names[12], GoldCollected); + } + if (hasHighestLevel) { + output.WriteUInt32(4, field_names[16], HighestLevel); + } + if (hasHighestDifficulty) { + output.WriteUInt32(5, field_names[15], HighestDifficulty); + } + if (hasCreateTime) { + output.WriteUInt32(6, field_names[2], CreateTime); + } + if (hasHardcore) { + output.WriteBool(7, field_names[13], Hardcore); + } + if (hasAttack) { + output.WriteUInt32(8, field_names[1], Attack); + } + if (hasPrecision) { + output.WriteUInt32(9, field_names[21], Precision); + } + if (hasDefense) { + output.WriteUInt32(10, field_names[7], Defense); + } + if (hasVitality) { + output.WriteUInt32(11, field_names[29], Vitality); + } + if (hasArmor) { + output.WriteUInt32(12, field_names[0], Armor); + } + if (hasDps) { + output.WriteFloat(13, field_names[8], Dps); + } + if (hasResistArcane) { + output.WriteUInt32(14, field_names[22], ResistArcane); + } + if (hasResistFire) { + output.WriteUInt32(15, field_names[24], ResistFire); + } + if (hasResistLightning) { + output.WriteUInt32(16, field_names[25], ResistLightning); + } + if (hasResistPoison) { + output.WriteUInt32(17, field_names[26], ResistPoison); + } + if (hasResistCold) { + output.WriteUInt32(18, field_names[23], ResistCold); + } + if (hasEquipment) { + output.WriteMessage(19, field_names[11], Equipment); + } + if (hasSnoActiveSkills) { + output.WriteMessage(20, field_names[27], SnoActiveSkills); + } + if (hasSnoTraits) { + output.WriteMessage(21, field_names[28], SnoTraits); + } + if (hasDeathTime) { + output.WriteUInt32(22, field_names[6], DeathTime); + } + if (hasKiller) { + output.WriteMessage(23, field_names[18], Killer); + } + if (hasKillLocation) { + output.WriteMessage(24, field_names[17], KillLocation); + } + if (hasEpitaph) { + output.WriteString(25, field_names[10], Epitaph); + } + if (hasHeroId) { + output.WriteMessage(26, field_names[14], HeroId); + } + if (hasDamageIncrease) { + output.WriteFloat(27, field_names[4], DamageIncrease); + } + if (hasCritChance) { + output.WriteFloat(28, field_names[3], CritChance); + } + if (hasDamageReduction) { + output.WriteFloat(29, field_names[5], DamageReduction); + } + if (hasLife) { + output.WriteUInt32(30, field_names[19], 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 (hasAttack) { + size += pb::CodedOutputStream.ComputeUInt32Size(8, Attack); + } + if (hasPrecision) { + size += pb::CodedOutputStream.ComputeUInt32Size(9, Precision); + } + if (hasDefense) { + size += pb::CodedOutputStream.ComputeUInt32Size(10, Defense); + } + 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 (hasKiller) { + size += pb::CodedOutputStream.ComputeMessageSize(23, Killer); + } + if (hasKillLocation) { + size += pb::CodedOutputStream.ComputeMessageSize(24, KillLocation); + } + if (hasEpitaph) { + size += pb::CodedOutputStream.ComputeStringSize(25, Epitaph); + } + if (hasHeroId) { + size += pb::CodedOutputStream.ComputeMessageSize(26, HeroId); + } + if (hasDamageIncrease) { + size += pb::CodedOutputStream.ComputeFloatSize(27, DamageIncrease); + } + if (hasCritChance) { + size += pb::CodedOutputStream.ComputeFloatSize(28, CritChance); + } + if (hasDamageReduction) { + size += pb::CodedOutputStream.ComputeFloatSize(29, DamageReduction); + } + if (hasLife) { + size += pb::CodedOutputStream.ComputeUInt32Size(30, 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.HasAttack) { + Attack = other.Attack; + } + if (other.HasPrecision) { + Precision = other.Precision; + } + if (other.HasDefense) { + Defense = other.Defense; + } + 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.HasKiller) { + MergeKiller(other.Killer); + } + if (other.HasKillLocation) { + MergeKillLocation(other.KillLocation); + } + if (other.HasEpitaph) { + Epitaph = other.Epitaph; + } + 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.hasAttack = input.ReadUInt32(ref result.attack_); + break; + } + case 72: { + result.hasPrecision = input.ReadUInt32(ref result.precision_); + break; + } + case 80: { + result.hasDefense = input.ReadUInt32(ref result.defense_); + 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.GameBalance.Handle.Builder subBuilder = global::D3.GameBalance.Handle.CreateBuilder(); + if (result.hasKiller) { + subBuilder.MergeFrom(Killer); + } + input.ReadMessage(subBuilder, extensionRegistry); + Killer = subBuilder.BuildPartial(); + break; + } + case 194: { + global::D3.GameBalance.Handle.Builder subBuilder = global::D3.GameBalance.Handle.CreateBuilder(); + if (result.hasKillLocation) { + subBuilder.MergeFrom(KillLocation); + } + input.ReadMessage(subBuilder, extensionRegistry); + KillLocation = subBuilder.BuildPartial(); + break; + } + case 202: { + result.hasEpitaph = input.ReadString(ref result.epitaph_); + break; + } + case 210: { + 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 221: { + result.hasDamageIncrease = input.ReadFloat(ref result.damageIncrease_); + break; + } + case 229: { + result.hasCritChance = input.ReadFloat(ref result.critChance_); + break; + } + case 237: { + result.hasDamageReduction = input.ReadFloat(ref result.damageReduction_); + break; + } + case 240: { + 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 HasAttack { + get { return result.hasAttack; } + } + public uint Attack { + get { return result.Attack; } + set { SetAttack(value); } + } + public Builder SetAttack(uint value) { + PrepareBuilder(); + result.hasAttack = true; + result.attack_ = value; + return this; + } + public Builder ClearAttack() { + PrepareBuilder(); + result.hasAttack = false; + result.attack_ = 0; + return this; + } + + public bool HasPrecision { + get { return result.hasPrecision; } + } + public uint Precision { + get { return result.Precision; } + set { SetPrecision(value); } + } + public Builder SetPrecision(uint value) { + PrepareBuilder(); + result.hasPrecision = true; + result.precision_ = value; + return this; + } + public Builder ClearPrecision() { + PrepareBuilder(); + result.hasPrecision = false; + result.precision_ = 0; + return this; + } + + public bool HasDefense { + get { return result.hasDefense; } + } + public uint Defense { + get { return result.Defense; } + set { SetDefense(value); } + } + public Builder SetDefense(uint value) { + PrepareBuilder(); + result.hasDefense = true; + result.defense_ = value; + return this; + } + public Builder ClearDefense() { + PrepareBuilder(); + result.hasDefense = false; + result.defense_ = 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 HasKiller { + get { return result.hasKiller; } + } + public global::D3.GameBalance.Handle Killer { + get { return result.Killer; } + set { SetKiller(value); } + } + public Builder SetKiller(global::D3.GameBalance.Handle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasKiller = true; + result.killer_ = value; + return this; + } + public Builder SetKiller(global::D3.GameBalance.Handle.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasKiller = true; + result.killer_ = builderForValue.Build(); + return this; + } + public Builder MergeKiller(global::D3.GameBalance.Handle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasKiller && + result.killer_ != global::D3.GameBalance.Handle.DefaultInstance) { + result.killer_ = global::D3.GameBalance.Handle.CreateBuilder(result.killer_).MergeFrom(value).BuildPartial(); + } else { + result.killer_ = value; + } + result.hasKiller = true; + return this; + } + public Builder ClearKiller() { + PrepareBuilder(); + result.hasKiller = false; + result.killer_ = null; + return this; + } + + public bool HasKillLocation { + get { return result.hasKillLocation; } + } + public global::D3.GameBalance.Handle KillLocation { + get { return result.KillLocation; } + set { SetKillLocation(value); } + } + public Builder SetKillLocation(global::D3.GameBalance.Handle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasKillLocation = true; + result.killLocation_ = value; + return this; + } + public Builder SetKillLocation(global::D3.GameBalance.Handle.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasKillLocation = true; + result.killLocation_ = builderForValue.Build(); + return this; + } + public Builder MergeKillLocation(global::D3.GameBalance.Handle value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasKillLocation && + result.killLocation_ != global::D3.GameBalance.Handle.DefaultInstance) { + result.killLocation_ = global::D3.GameBalance.Handle.CreateBuilder(result.killLocation_).MergeFrom(value).BuildPartial(); + } else { + result.killLocation_ = value; + } + result.hasKillLocation = true; + return this; + } + public Builder ClearKillLocation() { + PrepareBuilder(); + result.hasKillLocation = false; + result.killLocation_ = 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; + } + + 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[] { "achievement_showcase_0", "achievement_showcase_1", "achievement_showcase_2", "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[] { 128, 136, 144, 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 const int AchievementShowcase0FieldNumber = 16; + private bool hasAchievementShowcase0; + private ulong achievementShowcase0_; + public bool HasAchievementShowcase0 { + get { return hasAchievementShowcase0; } + } + public ulong AchievementShowcase0 { + get { return achievementShowcase0_; } + } + + public const int AchievementShowcase1FieldNumber = 17; + private bool hasAchievementShowcase1; + private ulong achievementShowcase1_; + public bool HasAchievementShowcase1 { + get { return hasAchievementShowcase1; } + } + public ulong AchievementShowcase1 { + get { return achievementShowcase1_; } + } + + public const int AchievementShowcase2FieldNumber = 18; + private bool hasAchievementShowcase2; + private ulong achievementShowcase2_; + public bool HasAchievementShowcase2 { + get { return hasAchievementShowcase2; } + } + public ulong AchievementShowcase2 { + get { return achievementShowcase2_; } + } + + 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[15], HighestDifficulty); + } + if (hasHighestBossDifficulty1) { + output.WriteUInt32(2, field_names[11], HighestBossDifficulty1); + } + if (hasHighestBossDifficulty2) { + output.WriteUInt32(3, field_names[12], HighestBossDifficulty2); + } + if (hasHighestBossDifficulty3) { + output.WriteUInt32(4, field_names[13], HighestBossDifficulty3); + } + if (hasHighestBossDifficulty4) { + output.WriteUInt32(5, field_names[14], HighestBossDifficulty4); + } + if (hasMonstersKilled) { + output.WriteUInt64(6, field_names[17], MonstersKilled); + } + if (hasElitesKilled) { + output.WriteUInt64(7, field_names[8], ElitesKilled); + } + if (hasGoldCollected) { + output.WriteUInt64(8, field_names[9], GoldCollected); + } + if (hasHighestHardcoreLevel) { + output.WriteUInt64(9, field_names[16], HighestHardcoreLevel); + } + if (hasHardcoreMonstersKilled) { + output.WriteUInt64(10, field_names[10], HardcoreMonstersKilled); + } + if (hasClassBarbarian) { + output.WriteMessage(11, field_names[3], ClassBarbarian); + } + if (hasClassDemonhunter) { + output.WriteMessage(12, field_names[4], ClassDemonhunter); + } + if (hasClassMonk) { + output.WriteMessage(13, field_names[5], ClassMonk); + } + if (hasClassWitchdoctor) { + output.WriteMessage(14, field_names[6], ClassWitchdoctor); + } + if (hasClassWizard) { + output.WriteMessage(15, field_names[7], ClassWizard); + } + if (hasAchievementShowcase0) { + output.WriteUInt64(16, field_names[0], AchievementShowcase0); + } + if (hasAchievementShowcase1) { + output.WriteUInt64(17, field_names[1], AchievementShowcase1); + } + if (hasAchievementShowcase2) { + output.WriteUInt64(18, field_names[2], AchievementShowcase2); + } + 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); + } + if (hasAchievementShowcase0) { + size += pb::CodedOutputStream.ComputeUInt64Size(16, AchievementShowcase0); + } + if (hasAchievementShowcase1) { + size += pb::CodedOutputStream.ComputeUInt64Size(17, AchievementShowcase1); + } + if (hasAchievementShowcase2) { + size += pb::CodedOutputStream.ComputeUInt64Size(18, AchievementShowcase2); + } + 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); + } + if (other.HasAchievementShowcase0) { + AchievementShowcase0 = other.AchievementShowcase0; + } + if (other.HasAchievementShowcase1) { + AchievementShowcase1 = other.AchievementShowcase1; + } + if (other.HasAchievementShowcase2) { + AchievementShowcase2 = other.AchievementShowcase2; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + case 128: { + result.hasAchievementShowcase0 = input.ReadUInt64(ref result.achievementShowcase0_); + break; + } + case 136: { + result.hasAchievementShowcase1 = input.ReadUInt64(ref result.achievementShowcase1_); + break; + } + case 144: { + result.hasAchievementShowcase2 = input.ReadUInt64(ref result.achievementShowcase2_); + 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; + } + + public bool HasAchievementShowcase0 { + get { return result.hasAchievementShowcase0; } + } + public ulong AchievementShowcase0 { + get { return result.AchievementShowcase0; } + set { SetAchievementShowcase0(value); } + } + public Builder SetAchievementShowcase0(ulong value) { + PrepareBuilder(); + result.hasAchievementShowcase0 = true; + result.achievementShowcase0_ = value; + return this; + } + public Builder ClearAchievementShowcase0() { + PrepareBuilder(); + result.hasAchievementShowcase0 = false; + result.achievementShowcase0_ = 0UL; + return this; + } + + public bool HasAchievementShowcase1 { + get { return result.hasAchievementShowcase1; } + } + public ulong AchievementShowcase1 { + get { return result.AchievementShowcase1; } + set { SetAchievementShowcase1(value); } + } + public Builder SetAchievementShowcase1(ulong value) { + PrepareBuilder(); + result.hasAchievementShowcase1 = true; + result.achievementShowcase1_ = value; + return this; + } + public Builder ClearAchievementShowcase1() { + PrepareBuilder(); + result.hasAchievementShowcase1 = false; + result.achievementShowcase1_ = 0UL; + return this; + } + + public bool HasAchievementShowcase2 { + get { return result.hasAchievementShowcase2; } + } + public ulong AchievementShowcase2 { + get { return result.AchievementShowcase2; } + set { SetAchievementShowcase2(value); } + } + public Builder SetAchievementShowcase2(ulong value) { + PrepareBuilder(); + result.hasAchievementShowcase2 = true; + result.achievementShowcase2_ = value; + return this; + } + public Builder ClearAchievementShowcase2() { + PrepareBuilder(); + result.hasAchievementShowcase2 = false; + result.achievementShowcase2_ = 0UL; + 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 62% rename from source/D3Proto/D3/Quests/Quest.cs rename to src/LibMooNet/D3/Quests/Quest.cs index f0acdfe3..c9a2f9d2 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=="); + "CgtRdWVzdC5wcm90bxIJRDMuUXVlc3RzGgtJdGVtcy5wcm90byJoCgtRdWVz" + + "dFJld2FyZBIVCgp4cF9ncmFudGVkGAEgASgFOgEwEhcKDGdvbGRfZ3JhbnRl" + + "ZBgCIAEoBToBMBIpCgxpdGVtX2dyYW50ZWQYAyABKAsyEy5EMy5JdGVtcy5H" + + "ZW5lcmF0b3IiVgoRUXVlc3RTdGVwQ29tcGxldGUSGQoRaXNfcXVlc3RfY29t" + + "cGxldGUYASACKAgSJgoGcmV3YXJkGAIgASgLMhYuRDMuUXVlc3RzLlF1ZXN0" + + "UmV3YXJk"); 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", }); 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", "xp_granted" }; + private static readonly uint[] _questRewardFieldTags = new uint[] { 16, 26, 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,36 @@ 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 Item { - get { return item_; } + public global::D3.Items.Generator ItemGranted { + get { return itemGranted_ ?? global::D3.Items.Generator.DefaultInstance; } } 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[2], 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); } UnknownFields.WriteTo(output); } @@ -134,14 +147,14 @@ 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); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -173,38 +186,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 +263,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 +281,45 @@ 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); } 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 +331,113 @@ 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; } } } + + 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; } } @@ -375,14 +446,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 +476,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 +486,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 +504,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 +523,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 +559,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 +636,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 +654,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 +665,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 +701,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 +719,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 +756,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 +781,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 +795,5 @@ static QuestStepComplete() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/D3/Stats/Stats.cs b/src/LibMooNet/D3/Stats/Stats.cs similarity index 68% rename from source/D3Proto/D3/Stats/Stats.cs rename to src/LibMooNet/D3/Stats/Stats.cs index 602df4e6..542ee558 100644 --- a/source/D3Proto/D3/Stats/Stats.cs +++ b/src/LibMooNet/D3/Stats/Stats.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.Stats { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class Stats { #region Extension registration @@ -50,14 +55,20 @@ static Stats() { } #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 StatCategory : pb::GeneratedMessage { - private static readonly StatCategory defaultInstance = new Builder().BuildPartial(); + private StatCategory() { } + private static readonly StatCategory defaultInstance = new StatCategory().MakeReadOnly(); + private static readonly string[] _statCategoryFieldNames = new string[] { "data_1", "data_2", "stat_id", "total" }; + private static readonly uint[] _statCategoryFieldTags = new uint[] { 16, 24, 8, 32 }; public static StatCategory DefaultInstance { get { return defaultInstance; } } public override StatCategory DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override StatCategory ThisMessage { @@ -74,7 +85,7 @@ protected override StatCategory ThisMessage { public const int StatIdFieldNumber = 1; private bool hasStatId; - private uint statId_ = 0; + private uint statId_; public bool HasStatId { get { return hasStatId; } } @@ -84,7 +95,7 @@ public uint StatId { public const int Data1FieldNumber = 2; private bool hasData1; - private uint data1_ = 0; + private uint data1_; public bool HasData1 { get { return hasData1; } } @@ -94,7 +105,7 @@ public uint Data1 { public const int Data2FieldNumber = 3; private bool hasData2; - private uint data2_ = 0; + private uint data2_; public bool HasData2 { get { return hasData2; } } @@ -104,7 +115,7 @@ public uint Data2 { public const int TotalFieldNumber = 4; private bool hasTotal; - private ulong total_ = 0UL; + private ulong total_; public bool HasTotal { get { return hasTotal; } } @@ -121,19 +132,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasStatId) { - output.WriteUInt32(1, StatId); + string[] field_names = _statCategoryFieldNames; + if (hasStatId) { + output.WriteUInt32(1, field_names[2], StatId); } - if (HasData1) { - output.WriteUInt32(2, Data1); + if (hasData1) { + output.WriteUInt32(2, field_names[0], Data1); } - if (HasData2) { - output.WriteUInt32(3, Data2); + if (hasData2) { + output.WriteUInt32(3, field_names[1], Data2); } - if (HasTotal) { - output.WriteUInt64(4, Total); + if (hasTotal) { + output.WriteUInt64(4, field_names[3], Total); } UnknownFields.WriteTo(output); } @@ -145,16 +157,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasStatId) { + if (hasStatId) { size += pb::CodedOutputStream.ComputeUInt32Size(1, StatId); } - if (HasData1) { + if (hasData1) { size += pb::CodedOutputStream.ComputeUInt32Size(2, Data1); } - if (HasData2) { + if (hasData2) { size += pb::CodedOutputStream.ComputeUInt32Size(3, Data2); } - if (HasTotal) { + if (hasTotal) { size += pb::CodedOutputStream.ComputeUInt64Size(4, Total); } size += UnknownFields.SerializedSize; @@ -187,38 +199,72 @@ public static StatCategory ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static StatCategory ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static StatCategory ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static StatCategory ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private StatCategory MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(StatCategory cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - StatCategory result = new StatCategory(); + private bool resultIsReadOnly; + private StatCategory result; + + private StatCategory PrepareBuilder() { + if (resultIsReadOnly) { + StatCategory original = result; + result = new StatCategory(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override StatCategory MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new StatCategory(); + 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 { @@ -230,12 +276,11 @@ public override StatCategory DefaultInstanceForType { } public override StatCategory BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - StatCategory returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -249,6 +294,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(StatCategory other) { if (other == global::D3.Stats.StatCategory.DefaultInstance) return this; + PrepareBuilder(); if (other.HasStatId) { StatId = other.StatId; } @@ -265,20 +311,31 @@ public override Builder MergeFrom(StatCategory 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(_statCategoryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _statCategoryFieldTags[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)) { @@ -290,97 +347,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: { - StatId = input.ReadUInt32(); + result.hasStatId = input.ReadUInt32(ref result.statId_); break; } case 16: { - Data1 = input.ReadUInt32(); + result.hasData1 = input.ReadUInt32(ref result.data1_); break; } case 24: { - Data2 = input.ReadUInt32(); + result.hasData2 = input.ReadUInt32(ref result.data2_); break; } case 32: { - Total = input.ReadUInt64(); + result.hasTotal = input.ReadUInt64(ref result.total_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasStatId { - get { return result.HasStatId; } + get { return result.hasStatId; } } public uint StatId { get { return result.StatId; } set { SetStatId(value); } } public Builder SetStatId(uint value) { + PrepareBuilder(); result.hasStatId = true; result.statId_ = value; return this; } public Builder ClearStatId() { + PrepareBuilder(); result.hasStatId = false; result.statId_ = 0; return this; } public bool HasData1 { - get { return result.HasData1; } + get { return result.hasData1; } } public uint Data1 { get { return result.Data1; } set { SetData1(value); } } public Builder SetData1(uint value) { + PrepareBuilder(); result.hasData1 = true; result.data1_ = value; return this; } public Builder ClearData1() { + PrepareBuilder(); result.hasData1 = false; result.data1_ = 0; return this; } public bool HasData2 { - get { return result.HasData2; } + get { return result.hasData2; } } public uint Data2 { get { return result.Data2; } set { SetData2(value); } } public Builder SetData2(uint value) { + PrepareBuilder(); result.hasData2 = true; result.data2_ = value; return this; } public Builder ClearData2() { + PrepareBuilder(); result.hasData2 = false; result.data2_ = 0; return this; } public bool HasTotal { - get { return result.HasTotal; } + get { return result.hasTotal; } } public ulong Total { get { return result.Total; } set { SetTotal(value); } } public Builder SetTotal(ulong value) { + PrepareBuilder(); result.hasTotal = true; result.total_ = value; return this; } public Builder ClearTotal() { + PrepareBuilder(); result.hasTotal = false; result.total_ = 0UL; return this; @@ -391,14 +461,20 @@ static StatCategory() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class StatList : pb::GeneratedMessage { - private static readonly StatList defaultInstance = new Builder().BuildPartial(); + private StatList() { } + private static readonly StatList defaultInstance = new StatList().MakeReadOnly(); + private static readonly string[] _statListFieldNames = new string[] { "stats" }; + private static readonly uint[] _statListFieldTags = new uint[] { 10 }; public static StatList DefaultInstance { get { return defaultInstance; } } public override StatList DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override StatList ThisMessage { @@ -434,10 +510,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.Stats.StatCategory element in StatsList) { - output.WriteMessage(1, element); + string[] field_names = _statListFieldNames; + if (stats_.Count > 0) { + output.WriteMessageArray(1, field_names[0], stats_); } UnknownFields.WriteTo(output); } @@ -482,38 +559,73 @@ public static StatList ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static StatList ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static StatList ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static StatList ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private StatList 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(StatList 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(StatList cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - StatList result = new StatList(); + private bool resultIsReadOnly; + private StatList result; + + private StatList PrepareBuilder() { + if (resultIsReadOnly) { + StatList original = result; + result = new StatList(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override StatList MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new StatList(); + 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 { @@ -525,13 +637,11 @@ public override StatList DefaultInstanceForType { } public override StatList BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.stats_.MakeReadOnly(); - StatList returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -545,27 +655,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(StatList other) { if (other == global::D3.Stats.StatList.DefaultInstance) return this; + PrepareBuilder(); if (other.stats_.Count != 0) { - base.AddRange(other.stats_, result.stats_); + result.stats_.Add(other.stats_); } 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(_statListFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _statListFieldTags[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)) { @@ -577,22 +699,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.Stats.StatCategory.Builder subBuilder = global::D3.Stats.StatCategory.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddStats(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.stats_, global::D3.Stats.StatCategory.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList StatsList { - get { return result.stats_; } + get { return PrepareBuilder().stats_; } } public int StatsCount { get { return result.StatsCount; } @@ -602,29 +727,35 @@ public int StatsCount { } public Builder SetStats(int index, global::D3.Stats.StatCategory value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.stats_[index] = value; return this; } public Builder SetStats(int index, global::D3.Stats.StatCategory.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.stats_[index] = builderForValue.Build(); return this; } public Builder AddStats(global::D3.Stats.StatCategory value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.stats_.Add(value); return this; } public Builder AddStats(global::D3.Stats.StatCategory.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.stats_.Add(builderForValue.Build()); return this; } public Builder AddRangeStats(scg::IEnumerable values) { - base.AddRange(values, result.stats_); + PrepareBuilder(); + result.stats_.Add(values); return this; } public Builder ClearStats() { + PrepareBuilder(); result.stats_.Clear(); return this; } @@ -637,3 +768,5 @@ static StatList() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/D3Proto.csproj b/src/LibMooNet/LibMooNet.csproj similarity index 84% rename from source/D3Proto/D3Proto.csproj rename to src/LibMooNet/LibMooNet.csproj index 25ddf460..17fe5d09 100644 --- a/source/D3Proto/D3Proto.csproj +++ b/src/LibMooNet/LibMooNet.csproj @@ -1,4 +1,4 @@ - + Debug @@ -7,9 +7,8 @@ 2.0 {4CC19847-6F24-4453-9E31-126F94308AB9} Library - D3Proto - D3Proto - v4.0 + LibMooNet + LibMooNet true @@ -30,39 +29,46 @@ false - - - - False - ..\libs\Google.ProtocolBuffers.dll + + + ..\..\dep\protobuf-csharp\Google.ProtocolBuffers.dll + - - - + + + + + + + + + + + - - + + + - @@ -85,12 +91,9 @@ + - - - - - + \ 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..129fab09 --- /dev/null +++ b/src/LibMooNet/Properties/AssemblyInfo.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.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 62% rename from source/D3Proto/bnet/protocol/ContentHandle.cs rename to src/LibMooNet/bnet/protocol/ContentHandle.cs index 2ff765d2..f6e6fa13 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 @@ -27,14 +32,14 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static ContentHandle() { byte[] descriptorData = global::System.Convert.FromBase64String( "CiFsaWIvcHJvdG9jb2wvY29udGVudF9oYW5kbGUucHJvdG8SDWJuZXQucHJv" + - "dG9jb2wiPAoNQ29udGVudEhhbmRsZRIOCgZyZWdpb24YASACKAcSDQoFdXNh" + - "Z2UYAiACKAcSDAoEaGFzaBgDIAIoDEIQQg5DQ29udGVudEhhbmRsZQ=="); + "dG9jb2wiTwoNQ29udGVudEhhbmRsZRIOCgZyZWdpb24YASACKAcSDQoFdXNh" + + "Z2UYAiACKAcSDAoEaGFzaBgDIAIoDBIRCglwcm90b191cmwYBCABKAk="); 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/source/D3Proto/bnet/protocol/Descriptor.cs b/src/LibMooNet/bnet/protocol/Descriptor.cs similarity index 64% rename from source/D3Proto/bnet/protocol/Descriptor.cs rename to src/LibMooNet/bnet/protocol/Descriptor.cs index 63a385df..c37f3cbe 100644 --- a/source/D3Proto/bnet/protocol/Descriptor.cs +++ b/src/LibMooNet/bnet/protocol/Descriptor.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 { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class Descriptor { #region Extension registration @@ -17,7 +22,7 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_Path__FieldAccessorTable; #endregion #region Descriptor - public static pbd::FileDescriptor Descriptor_ { + public static pbd::FileDescriptor DescriptorProp { get { return descriptor; } } private static pbd::FileDescriptor descriptor; @@ -25,10 +30,10 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static Descriptor() { byte[] descriptorData = global::System.Convert.FromBase64String( "Ch1saWIvcHJvdG9jb2wvZGVzY3JpcHRvci5wcm90bxINYm5ldC5wcm90b2Nv" + - "bCIXCgRQYXRoEg8KB29yZGluYWwYASADKA0="); + "bCIbCgRQYXRoEhMKB29yZGluYWwYASADKA1CAhAB"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; - internal__static_bnet_protocol_Path__Descriptor = Descriptor_.MessageTypes[0]; + internal__static_bnet_protocol_Path__Descriptor = DescriptorProp.MessageTypes[0]; internal__static_bnet_protocol_Path__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_Path__Descriptor, new string[] { "Ordinal", }); @@ -42,14 +47,20 @@ static Descriptor() { } #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 Path : pb::GeneratedMessage { - private static readonly Path defaultInstance = new Builder().BuildPartial(); + private Path() { } + private static readonly Path defaultInstance = new Path().MakeReadOnly(); + private static readonly string[] _pathFieldNames = new string[] { "ordinal" }; + private static readonly uint[] _pathFieldTags = new uint[] { 10 }; public static Path DefaultInstance { get { return defaultInstance; } } public override Path DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Path ThisMessage { @@ -65,6 +76,7 @@ protected override Path ThisMessage { } public const int OrdinalFieldNumber = 1; + private int ordinalMemoizedSerializedSize; private pbc::PopsicleList ordinal_ = new pbc::PopsicleList(); public scg::IList OrdinalList { get { return pbc::Lists.AsReadOnly(ordinal_); } @@ -82,12 +94,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 = _pathFieldNames; if (ordinal_.Count > 0) { - foreach (uint element in ordinal_) { - output.WriteUInt32(1, element); - } + output.WritePackedUInt32Array(1, field_names[0], ordinalMemoizedSerializedSize, ordinal_); } UnknownFields.WriteTo(output); } @@ -105,7 +116,10 @@ public override int SerializedSize { dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); } size += dataSize; - size += 1 * ordinal_.Count; + if (ordinal_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + ordinalMemoizedSerializedSize = dataSize; } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -137,38 +151,73 @@ public static Path ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Path ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Path ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Path ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Path MakeReadOnly() { + ordinal_.MakeReadOnly(); + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(Path cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Path result; + + private Path PrepareBuilder() { + if (resultIsReadOnly) { + Path original = result; + result = new Path(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - Path result = new Path(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Path MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Path(); + 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 { @@ -180,13 +229,11 @@ public override Path DefaultInstanceForType { } public override Path BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.ordinal_.MakeReadOnly(); - Path returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -200,27 +247,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Path other) { if (other == global::bnet.protocol.Path.DefaultInstance) return this; + PrepareBuilder(); if (other.ordinal_.Count != 0) { - base.AddRange(other.ordinal_, result.ordinal_); + result.ordinal_.Add(other.ordinal_); } 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(_pathFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _pathFieldTags[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)) { @@ -232,20 +291,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 8: { - AddOrdinal(input.ReadUInt32()); + input.ReadUInt32Array(tag, field_name, result.ordinal_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList OrdinalList { - get { return result.ordinal_; } + get { return PrepareBuilder().ordinal_; } } public int OrdinalCount { get { return result.OrdinalCount; } @@ -254,27 +319,33 @@ public uint GetOrdinal(int index) { return result.GetOrdinal(index); } public Builder SetOrdinal(int index, uint value) { + PrepareBuilder(); result.ordinal_[index] = value; return this; } public Builder AddOrdinal(uint value) { + PrepareBuilder(); result.ordinal_.Add(value); return this; } public Builder AddRangeOrdinal(scg::IEnumerable values) { - base.AddRange(values, result.ordinal_); + PrepareBuilder(); + result.ordinal_.Add(values); return this; } public Builder ClearOrdinal() { + PrepareBuilder(); result.ordinal_.Clear(); return this; } } static Path() { - object.ReferenceEquals(global::bnet.protocol.Descriptor.Descriptor_, null); + object.ReferenceEquals(global::bnet.protocol.Descriptor.DescriptorProp, null); } } #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/Entity.cs b/src/LibMooNet/bnet/protocol/Entity.cs similarity index 69% rename from source/D3Proto/bnet/protocol/Entity.cs rename to src/LibMooNet/bnet/protocol/Entity.cs index 0df27b16..c6d1efec 100644 --- a/source/D3Proto/bnet/protocol/Entity.cs +++ b/src/LibMooNet/bnet/protocol/Entity.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 { + [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 @@ -52,14 +57,20 @@ static Entity() { } #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[] { "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; } + get { return DefaultInstance; } } protected override EntityId ThisMessage { @@ -76,7 +87,7 @@ protected override EntityId ThisMessage { public const int HighFieldNumber = 1; private bool hasHigh; - private ulong high_ = 0; + private ulong high_; public bool HasHigh { get { return hasHigh; } } @@ -86,7 +97,7 @@ public ulong High { public const int LowFieldNumber = 2; private bool hasLow; - private ulong low_ = 0; + private ulong low_; public bool HasLow { get { return hasLow; } } @@ -102,13 +113,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasHigh) { - output.WriteFixed64(1, High); + string[] field_names = _entityIdFieldNames; + if (hasHigh) { + output.WriteFixed64(1, field_names[0], High); } - if (HasLow) { - output.WriteFixed64(2, Low); + if (hasLow) { + output.WriteFixed64(2, field_names[1], Low); } UnknownFields.WriteTo(output); } @@ -120,10 +132,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasHigh) { + if (hasHigh) { size += pb::CodedOutputStream.ComputeFixed64Size(1, High); } - if (HasLow) { + if (hasLow) { size += pb::CodedOutputStream.ComputeFixed64Size(2, Low); } size += UnknownFields.SerializedSize; @@ -156,38 +168,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; + } + + private bool resultIsReadOnly; + private EntityId result; + + private EntityId PrepareBuilder() { + if (resultIsReadOnly) { + EntityId original = result; + result = new EntityId(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - EntityId result = new EntityId(); + 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 { @@ -199,12 +245,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) { @@ -218,6 +263,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(EntityId other) { if (other == global::bnet.protocol.EntityId.DefaultInstance) return this; + PrepareBuilder(); if (other.HasHigh) { High = other.High; } @@ -228,20 +274,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)) { @@ -253,53 +310,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: { - High = input.ReadFixed64(); + result.hasHigh = input.ReadFixed64(ref result.high_); break; } case 17: { - Low = input.ReadFixed64(); + result.hasLow = input.ReadFixed64(ref result.low_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasHigh { - get { return result.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; } + 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; @@ -310,14 +376,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 Identity : pb::GeneratedMessage { - private static readonly Identity defaultInstance = new Builder().BuildPartial(); + private Identity() { } + private static readonly Identity defaultInstance = new Identity().MakeReadOnly(); + private static readonly string[] _identityFieldNames = new string[] { "account_id", "game_account_id", "toon_id" }; + private static readonly uint[] _identityFieldTags = new uint[] { 10, 18, 26 }; public static Identity DefaultInstance { get { return defaultInstance; } } public override Identity DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Identity ThisMessage { @@ -334,32 +406,32 @@ protected override Identity ThisMessage { public const int AccountIdFieldNumber = 1; private bool hasAccountId; - private global::bnet.protocol.EntityId accountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId accountId_; public bool HasAccountId { get { return hasAccountId; } } public global::bnet.protocol.EntityId AccountId { - get { return accountId_; } + get { return accountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int GameAccountIdFieldNumber = 2; private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId gameAccountId_; public bool HasGameAccountId { get { return hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ToonIdFieldNumber = 3; private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId toonId_; public bool HasToonId { get { return hasToonId; } } public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } + get { return toonId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -377,16 +449,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAccountId) { - output.WriteMessage(1, AccountId); + string[] field_names = _identityFieldNames; + if (hasAccountId) { + output.WriteMessage(1, field_names[0], AccountId); } - if (HasGameAccountId) { - output.WriteMessage(2, GameAccountId); + if (hasGameAccountId) { + output.WriteMessage(2, field_names[1], GameAccountId); } - if (HasToonId) { - output.WriteMessage(3, ToonId); + if (hasToonId) { + output.WriteMessage(3, field_names[2], ToonId); } UnknownFields.WriteTo(output); } @@ -398,13 +471,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAccountId) { + if (hasAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AccountId); } - if (HasGameAccountId) { + if (hasGameAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); } - if (HasToonId) { + if (hasToonId) { size += pb::CodedOutputStream.ComputeMessageSize(3, ToonId); } size += UnknownFields.SerializedSize; @@ -437,38 +510,72 @@ public static Identity ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Identity ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Identity ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(Identity cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - Identity result = new Identity(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Identity(); + 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 { @@ -480,12 +587,11 @@ public override Identity DefaultInstanceForType { } public override Identity BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Identity returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -499,6 +605,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Identity other) { if (other == global::bnet.protocol.Identity.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAccountId) { MergeAccountId(other.AccountId); } @@ -512,20 +619,31 @@ public override Builder MergeFrom(Identity 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -537,12 +655,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 (HasAccountId) { + if (result.hasAccountId) { subBuilder.MergeFrom(AccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -551,7 +669,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { + if (result.hasGameAccountId) { subBuilder.MergeFrom(GameAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -560,7 +678,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { + if (result.hasToonId) { subBuilder.MergeFrom(ToonId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -569,11 +687,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAccountId { - get { return result.HasAccountId; } + get { return result.hasAccountId; } } public global::bnet.protocol.EntityId AccountId { get { return result.AccountId; } @@ -581,19 +704,22 @@ public bool HasAccountId { } 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"); - if (result.HasAccountId && + PrepareBuilder(); + if (result.hasAccountId && result.accountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.accountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.accountId_).MergeFrom(value).BuildPartial(); } else { @@ -603,13 +729,14 @@ public Builder MergeAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearAccountId() { + PrepareBuilder(); result.hasAccountId = false; - result.accountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.accountId_ = null; return this; } public bool HasGameAccountId { - get { return result.HasGameAccountId; } + get { return result.hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { get { return result.GameAccountId; } @@ -617,19 +744,22 @@ public bool HasGameAccountId { } 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"); - if (result.HasGameAccountId && + PrepareBuilder(); + if (result.hasGameAccountId && result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -639,13 +769,14 @@ public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearGameAccountId() { + PrepareBuilder(); result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.gameAccountId_ = null; return this; } public bool HasToonId { - get { return result.HasToonId; } + get { return result.hasToonId; } } public global::bnet.protocol.EntityId ToonId { get { return result.ToonId; } @@ -653,19 +784,22 @@ public bool HasToonId { } public Builder SetToonId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToonId = true; result.toonId_ = value; return this; } public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToonId && result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); } else { @@ -675,8 +809,9 @@ public Builder MergeToonId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToonId() { + PrepareBuilder(); result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toonId_ = null; return this; } } @@ -688,3 +823,5 @@ static Identity() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/Resource.cs b/src/LibMooNet/bnet/protocol/Resource.cs similarity index 69% rename from source/D3Proto/bnet/protocol/Resource.cs rename to src/LibMooNet/bnet/protocol/Resource.cs index ebe6f20d..36c9f476 100644 --- a/source/D3Proto/bnet/protocol/Resource.cs +++ b/src/LibMooNet/bnet/protocol/Resource.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 { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class Resource { #region Extension registration @@ -78,14 +83,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 { @@ -112,7 +123,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 +154,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 +176,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 +215,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 +293,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 +311,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 +319,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 +361,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 +395,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,29 +438,35 @@ 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; } @@ -406,14 +476,20 @@ static Payload() { } } + [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 { @@ -460,13 +536,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 +555,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 +591,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 +669,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 +687,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 +734,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 +764,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,29 +787,35 @@ 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; } @@ -692,14 +825,20 @@ static Dependency() { } } + [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 { @@ -750,13 +889,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 +944,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 +1023,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 +1041,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 +1088,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 +1120,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,29 +1164,35 @@ 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; } @@ -1004,14 +1202,20 @@ static Metadata() { } } + [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 { @@ -1054,13 +1258,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 +1277,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 +1313,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 +1390,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 +1408,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 +1419,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 +1455,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 +1485,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,11 +1506,13 @@ 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; @@ -1264,14 +1523,20 @@ static IndexEntry() { } } + [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 { @@ -1307,10 +1572,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 +1621,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 +1699,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 +1717,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 +1761,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,29 +1789,35 @@ 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; } @@ -1510,3 +1830,5 @@ static ResourceIndex() { #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..13cfc9cb --- /dev/null +++ b/src/LibMooNet/bnet/protocol/Rpc.cs @@ -0,0 +1,2633 @@ +// 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); + 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; + 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( + "ChFsaWIvcnBjL3JwYy5wcm90bxINYm5ldC5wcm90b2NvbBogZ29vZ2xlL3By" + + "b3RvYnVmL2Rlc2NyaXB0b3IucHJvdG8iDQoLTk9fUkVTUE9OU0UiTgoHQWRk" + + "cmVzcxIPCgdhZGRyZXNzGAEgAigJEgwKBHBvcnQYAiABKA0SJAoEbmV4dBgD" + + "IAEoCzIWLmJuZXQucHJvdG9jb2wuQWRkcmVzcyIpCglQcm9jZXNzSWQSDQoF" + + "bGFiZWwYASACKA0SDQoFZXBvY2gYAiACKA0iTQoNT2JqZWN0QWRkcmVzcxIm" + + "CgRob3N0GAEgAigLMhguYm5ldC5wcm90b2NvbC5Qcm9jZXNzSWQSFAoJb2Jq" + + "ZWN0X2lkGAIgASgEOgEwIggKBk5vRGF0YSJ6CglFcnJvckluZm8SNAoOb2Jq" + + "ZWN0X2FkZHJlc3MYASACKAsyHC5ibmV0LnByb3RvY29sLk9iamVjdEFkZHJl" + + "c3MSDgoGc3RhdHVzGAIgAigNEhQKDHNlcnZpY2VfaGFzaBgDIAIoDRIRCglt" + + "ZXRob2RfaWQYBCACKA0ioQEKBkhlYWRlchISCgpzZXJ2aWNlX2lkGAEgAigN" + + "EhEKCW1ldGhvZF9pZBgCIAEoDRINCgV0b2tlbhgDIAIoDRIUCglvYmplY3Rf" + + "aWQYBCABKAQ6ATASDwoEc2l6ZRgFIAEoDToBMBIRCgZzdGF0dXMYBiABKA06" + + "ATASJwoFZXJyb3IYByADKAsyGC5ibmV0LnByb3RvY29sLkVycm9ySW5mbzoz" + + "CgltZXRob2RfaWQSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9ucxjQ" + + "hgMgASgNOi4KBGNvc3QSHi5nb29nbGUucHJvdG9idWYuTWV0aG9kT3B0aW9u" + + "cxjRhgMgASgNOjEKB3RpbWVvdXQSHi5nb29nbGUucHJvdG9idWYuTWV0aG9k" + + "T3B0aW9ucxjShgMgASgC"); + 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[] { }); + 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]); + 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 + [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", "next", "port" }; + private static readonly uint[] _addressFieldTags = new uint[] { 10, 26, 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 const int NextFieldNumber = 3; + private bool hasNext; + private global::bnet.protocol.Address next_; + public bool HasNext { + get { return hasNext; } + } + public global::bnet.protocol.Address Next { + get { return next_ ?? global::bnet.protocol.Address.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasAddress_) return false; + if (HasNext) { + if (!Next.IsInitialized) 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[2], Port); + } + if (hasNext) { + output.WriteMessage(3, field_names[1], 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::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; + } + if (other.HasNext) { + MergeNext(other.Next); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + case 26: { + global::bnet.protocol.Address.Builder subBuilder = global::bnet.protocol.Address.CreateBuilder(); + if (result.hasNext) { + subBuilder.MergeFrom(Next); + } + input.ReadMessage(subBuilder, extensionRegistry); + Next = subBuilder.BuildPartial(); + 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; + } + + 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"); + PrepareBuilder(); + result.hasNext = true; + result.next_ = value; + return this; + } + public Builder SetNext(global::bnet.protocol.Address.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasNext = true; + result.next_ = builderForValue.Build(); + return this; + } + public Builder MergeNext(global::bnet.protocol.Address value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + 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() { + PrepareBuilder(); + result.hasNext = false; + result.next_ = null; + 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/achievements/Achievements.cs b/src/LibMooNet/bnet/protocol/achievements/Achievements.cs new file mode 100644 index 00000000..5770ed44 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/achievements/Achievements.cs @@ -0,0 +1,5465 @@ +// 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 Achievements { + + #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_SnapshotUpdateNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_achievements_SnapshotUpdateNotification__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static Achievements() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "CjJzZXJ2aWNlL2FjaGlldmVtZW50cy9kZWZpbml0aW9uL2FjaGlldmVtZW50" + + "cy5wcm90bxIaYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVudHMaEWxpYi9ycGMv" + + "cnBjLnByb3RvGhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3RvGiFsaWIvcHJv" + + "dG9jb2wvY29udGVudF9oYW5kbGUucHJvdG8iRQoXQWNoaWV2ZW1lbnRVcGRh" + + "dGVSZWNvcmQSFgoOYWNoaWV2ZW1lbnRfaWQYASACKAQSEgoKY29tcGxldGlv" + + "bhgCIAIoBSJpChRDcml0ZXJpYVVwZGF0ZVJlY29yZBITCgtjcml0ZXJpYV9J" + + "ZBgBIAIoBBIVCgpzdGFydF90aW1lGAIgASgEOgEwEhMKCHF1YW50aXR5GAMg" + + "ASgEOgEwEhAKBWZsYWdzGAQgASgNOgEwIoIBChBQb3N0VXBkYXRlUmVjb3Jk" + + "EioKCXRhcmdldF9pZBgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + + "QgoIY3JpdGVyaWEYAiADKAsyMC5ibmV0LnByb3RvY29sLmFjaGlldmVtZW50" + + "cy5Dcml0ZXJpYVVwZGF0ZVJlY29yZCJ0ChFQb3N0VXBkYXRlUmVxdWVzdBJI" + + "ChJwb3N0X3VwZGF0ZV9yZWNvcmQYASADKAsyLC5ibmV0LnByb3RvY29sLmFj" + + "aGlldmVtZW50cy5Qb3N0VXBkYXRlUmVjb3JkEhUKCnByb2dyYW1faWQYAiAB" + + "KAc6ATAiKAoSUG9zdFVwZGF0ZVJlc3BvbnNlEhIKCmVycm9yX2NvZGUYASAD" + + "KA0ijgEKGlJlZ2lzdGVyV2l0aFNlcnZpY2VSZXF1ZXN0EioKCXRhcmdldF9p" + + "ZBgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSEQoJb2JqZWN0X2lk" + + "GAIgAigEEhoKEnJlZ2lzdHJhdGlvbl9mbGFncxgDIAEoDRIVCgpwcm9ncmFt" + + "X2lkGAQgASgHOgEwIv4BChtSZWdpc3RlcldpdGhTZXJ2aWNlUmVzcG9uc2US" + + "IQoWbWF4X3JlY29yZHNfcGVyX3VwZGF0ZRgBIAEoDToBMBIiChdtYXhfY3Jp" + + "dGVyaWFfcGVyX3JlY29yZBgCIAEoDToBMBImChttYXhfYWNoaWV2ZW1lbnRz" + + "X3Blcl9yZWNvcmQYAyABKA06ATASHAoRbWF4X3JlZ2lzdHJhdGlvbnMYBCAB" + + "KA06ATASGgoPZmx1c2hfZnJlcXVlbmN5GAUgASgEOgEwEjYKCHNuYXBzaG90" + + "GAYgASgLMiQuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVudHMuU25hcHNob3Qi" + + "XQocVW5yZWdpc3RlckZyb21TZXJ2aWNlUmVxdWVzdBIqCgl0YXJnZXRfaWQY" + + "ASACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhEKCW9iamVjdF9pZBgC" + + "IAIoBCKqAQoIU25hcHNob3QSUQoUYWNoaWV2ZW1lbnRfc25hcHNob3QYASAD" + + "KAsyMy5ibmV0LnByb3RvY29sLmFjaGlldmVtZW50cy5BY2hpZXZlbWVudFVw" + + "ZGF0ZVJlY29yZBJLChFjcml0ZXJpYV9zbmFwc2hvdBgCIAMoCzIwLmJuZXQu" + + "cHJvdG9jb2wuYWNoaWV2ZW1lbnRzLkNyaXRlcmlhVXBkYXRlUmVjb3JkIlQK" + + "FlJlcXVlc3RTbmFwc2hvdFJlcXVlc3QSKgoJZW50aXR5X2lkGAEgAigLMhcu" + + "Ym5ldC5wcm90b2NvbC5FbnRpdHlJZBIOCgZmaWx0ZXIYAiACKA0iUQoXUmVx" + + "dWVzdFNuYXBzaG90UmVzcG9uc2USNgoIc25hcHNob3QYASABKAsyJC5ibmV0" + + "LnByb3RvY29sLmFjaGlldmVtZW50cy5TbmFwc2hvdCInChFJbml0aWFsaXpl" + + "UmVxdWVzdBISCgpwcm9ncmFtX2lkGAEgASgHIkoKEkluaXRpYWxpemVSZXNw" + + "b25zZRI0Cg5jb250ZW50X2hhbmRsZRgBIAIoCzIcLmJuZXQucHJvdG9jb2wu" + + "Q29udGVudEhhbmRsZSKAAQoaU25hcHNob3RVcGRhdGVOb3RpZmljYXRpb24S" + + "KgoJdGFyZ2V0X2lkGAEgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBI2" + + "CghzbmFwc2hvdBgCIAIoCzIkLmJuZXQucHJvdG9jb2wuYWNoaWV2ZW1lbnRz" + + "LlNuYXBzaG90Mv0EChNBY2hpZXZlbWVudHNTZXJ2aWNlEnEKClBvc3RVcGRh" + + "dGUSLS5ibmV0LnByb3RvY29sLmFjaGlldmVtZW50cy5Qb3N0VXBkYXRlUmVx" + + "dWVzdBouLmJuZXQucHJvdG9jb2wuYWNoaWV2ZW1lbnRzLlBvc3RVcGRhdGVS" + + "ZXNwb25zZSIEgLUYARKMAQoTUmVnaXN0ZXJXaXRoU2VydmljZRI2LmJuZXQu" + + "cHJvdG9jb2wuYWNoaWV2ZW1lbnRzLlJlZ2lzdGVyV2l0aFNlcnZpY2VSZXF1" + + "ZXN0GjcuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVudHMuUmVnaXN0ZXJXaXRo" + + "U2VydmljZVJlc3BvbnNlIgSAtRgCEoABCg9SZXF1ZXN0U25hcHNob3QSMi5i" + + "bmV0LnByb3RvY29sLmFjaGlldmVtZW50cy5SZXF1ZXN0U25hcHNob3RSZXF1" + + "ZXN0GjMuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVudHMuUmVxdWVzdFNuYXBz" + + "aG90UmVzcG9uc2UiBIC1GAMSbgoVVW5yZWdpc3RlckZyb21TZXJ2aWNlEjgu" + + "Ym5ldC5wcm90b2NvbC5hY2hpZXZlbWVudHMuVW5yZWdpc3RlckZyb21TZXJ2" + + "aWNlUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgEEnEKCklu" + + "aXRpYWxpemUSLS5ibmV0LnByb3RvY29sLmFjaGlldmVtZW50cy5Jbml0aWFs" + + "aXplUmVxdWVzdBouLmJuZXQucHJvdG9jb2wuYWNoaWV2ZW1lbnRzLkluaXRp" + + "YWxpemVSZXNwb25zZSIEgLUYBTKGAQoSQWNoaWV2ZW1lbnRzTm90aWZ5EnAK" + + "FE5vdGlmeVNuYXBzaG90VXBkYXRlEjYuYm5ldC5wcm90b2NvbC5hY2hpZXZl" + + "bWVudHMuU25hcHNob3RVcGRhdGVOb3RpZmljYXRpb24aGi5ibmV0LnByb3Rv" + + "Y29sLk5PX1JFU1BPTlNFIgSAtRgBQgOAAQA="); + 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[] { "CriteriaId", "StartTime", "Quantity", "Flags", }); + 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", }); + 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", }); + 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[] { "MaxRecordsPerUpdate", "MaxCriteriaPerRecord", "MaxAchievementsPerRecord", "MaxRegistrations", "FlushFrequency", "Snapshot", }); + 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", }); + 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", }); + 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", }); + 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", }); + 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", }); + internal__static_bnet_protocol_achievements_SnapshotUpdateNotification__Descriptor = Descriptor.MessageTypes[13]; + internal__static_bnet_protocol_achievements_SnapshotUpdateNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_achievements_SnapshotUpdateNotification__Descriptor, + new string[] { "TargetId", "Snapshot", }); + 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.Achievements.internal__static_bnet_protocol_achievements_AchievementUpdateRecord__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Achievements.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.Achievements.Descriptor, 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", "flags", "quantity", "start_time" }; + private static readonly uint[] _criteriaUpdateRecordFieldTags = new uint[] { 8, 32, 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.Achievements.internal__static_bnet_protocol_achievements_CriteriaUpdateRecord__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Achievements.internal__static_bnet_protocol_achievements_CriteriaUpdateRecord__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 StartTimeFieldNumber = 2; + private bool hasStartTime; + private ulong startTime_; + public bool HasStartTime { + get { return hasStartTime; } + } + public ulong StartTime { + get { return startTime_; } + } + + 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 (!hasCriteriaId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _criteriaUpdateRecordFieldNames; + if (hasCriteriaId) { + output.WriteUInt64(1, field_names[0], CriteriaId); + } + if (hasStartTime) { + output.WriteUInt64(2, field_names[3], StartTime); + } + if (hasQuantity) { + output.WriteUInt64(3, field_names[2], 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 (hasCriteriaId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, CriteriaId); + } + if (hasStartTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, StartTime); + } + 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 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.HasCriteriaId) { + CriteriaId = other.CriteriaId; + } + if (other.HasStartTime) { + StartTime = other.StartTime; + } + 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(_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.hasCriteriaId = input.ReadUInt64(ref result.criteriaId_); + break; + } + case 16: { + result.hasStartTime = input.ReadUInt64(ref result.startTime_); + 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 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 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 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 CriteriaUpdateRecord() { + object.ReferenceEquals(global::bnet.protocol.achievements.Achievements.Descriptor, 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.Achievements.internal__static_bnet_protocol_achievements_PostUpdateRecord__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Achievements.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.Achievements.Descriptor, 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[] { "post_update_record", "program_id" }; + private static readonly uint[] _postUpdateRequestFieldTags = new uint[] { 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.Achievements.internal__static_bnet_protocol_achievements_PostUpdateRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Achievements.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 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[0], postUpdateRecord_); + } + if (hasProgramId) { + output.WriteFixed32(2, field_names[1], ProgramId); + } + 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); + } + 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; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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; + } + } + static PostUpdateRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Achievements.Descriptor, 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.Achievements.internal__static_bnet_protocol_achievements_PostUpdateResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Achievements.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.Achievements.Descriptor, 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[] { "object_id", "program_id", "registration_flags", "target_id" }; + private static readonly uint[] _registerWithServiceRequestFieldTags = new uint[] { 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.Achievements.internal__static_bnet_protocol_achievements_RegisterWithServiceRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Achievements.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 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[3], TargetId); + } + if (hasObjectId) { + output.WriteUInt64(2, field_names[0], ObjectId); + } + if (hasRegistrationFlags) { + output.WriteUInt32(3, field_names[2], RegistrationFlags); + } + if (hasProgramId) { + output.WriteFixed32(4, field_names[1], ProgramId); + } + 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); + } + 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; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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; + } + } + static RegisterWithServiceRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Achievements.Descriptor, 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[] { "flush_frequency", "max_achievements_per_record", "max_criteria_per_record", "max_records_per_update", "max_registrations", "snapshot" }; + private static readonly uint[] _registerWithServiceResponseFieldTags = new uint[] { 40, 24, 16, 8, 32, 50 }; + 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.Achievements.internal__static_bnet_protocol_achievements_RegisterWithServiceResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Achievements.internal__static_bnet_protocol_achievements_RegisterWithServiceResponse__FieldAccessorTable; } + } + + public const int MaxRecordsPerUpdateFieldNumber = 1; + private bool hasMaxRecordsPerUpdate; + private uint maxRecordsPerUpdate_; + public bool HasMaxRecordsPerUpdate { + get { return hasMaxRecordsPerUpdate; } + } + public uint MaxRecordsPerUpdate { + get { return maxRecordsPerUpdate_; } + } + + public const int MaxCriteriaPerRecordFieldNumber = 2; + private bool hasMaxCriteriaPerRecord; + private uint maxCriteriaPerRecord_; + public bool HasMaxCriteriaPerRecord { + get { return hasMaxCriteriaPerRecord; } + } + public uint MaxCriteriaPerRecord { + get { return maxCriteriaPerRecord_; } + } + + public const int MaxAchievementsPerRecordFieldNumber = 3; + private bool hasMaxAchievementsPerRecord; + private uint maxAchievementsPerRecord_; + public bool HasMaxAchievementsPerRecord { + get { return hasMaxAchievementsPerRecord; } + } + public uint MaxAchievementsPerRecord { + get { return maxAchievementsPerRecord_; } + } + + public const int MaxRegistrationsFieldNumber = 4; + private bool hasMaxRegistrations; + private uint maxRegistrations_; + public bool HasMaxRegistrations { + get { return hasMaxRegistrations; } + } + public uint MaxRegistrations { + get { return maxRegistrations_; } + } + + public const int FlushFrequencyFieldNumber = 5; + private bool hasFlushFrequency; + private ulong flushFrequency_; + public bool HasFlushFrequency { + get { return hasFlushFrequency; } + } + public ulong FlushFrequency { + get { return flushFrequency_; } + } + + public const int SnapshotFieldNumber = 6; + 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 = _registerWithServiceResponseFieldNames; + if (hasMaxRecordsPerUpdate) { + output.WriteUInt32(1, field_names[3], MaxRecordsPerUpdate); + } + if (hasMaxCriteriaPerRecord) { + output.WriteUInt32(2, field_names[2], MaxCriteriaPerRecord); + } + if (hasMaxAchievementsPerRecord) { + output.WriteUInt32(3, field_names[1], MaxAchievementsPerRecord); + } + if (hasMaxRegistrations) { + output.WriteUInt32(4, field_names[4], MaxRegistrations); + } + if (hasFlushFrequency) { + output.WriteUInt64(5, field_names[0], FlushFrequency); + } + if (hasSnapshot) { + output.WriteMessage(6, field_names[5], Snapshot); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasMaxRecordsPerUpdate) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, MaxRecordsPerUpdate); + } + if (hasMaxCriteriaPerRecord) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, MaxCriteriaPerRecord); + } + if (hasMaxAchievementsPerRecord) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, MaxAchievementsPerRecord); + } + if (hasMaxRegistrations) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, MaxRegistrations); + } + if (hasFlushFrequency) { + size += pb::CodedOutputStream.ComputeUInt64Size(5, FlushFrequency); + } + if (hasSnapshot) { + size += pb::CodedOutputStream.ComputeMessageSize(6, Snapshot); + } + 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.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; + } + 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(_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 8: { + result.hasMaxRecordsPerUpdate = input.ReadUInt32(ref result.maxRecordsPerUpdate_); + break; + } + case 16: { + result.hasMaxCriteriaPerRecord = input.ReadUInt32(ref result.maxCriteriaPerRecord_); + break; + } + case 24: { + result.hasMaxAchievementsPerRecord = input.ReadUInt32(ref result.maxAchievementsPerRecord_); + break; + } + case 32: { + result.hasMaxRegistrations = input.ReadUInt32(ref result.maxRegistrations_); + break; + } + case 40: { + result.hasFlushFrequency = input.ReadUInt64(ref result.flushFrequency_); + break; + } + case 50: { + 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 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; + } + + 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 RegisterWithServiceResponse() { + object.ReferenceEquals(global::bnet.protocol.achievements.Achievements.Descriptor, 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[] { "object_id", "target_id" }; + private static readonly uint[] _unregisterFromServiceRequestFieldTags = new uint[] { 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.Achievements.internal__static_bnet_protocol_achievements_UnregisterFromServiceRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Achievements.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 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[1], TargetId); + } + 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 (hasTargetId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, TargetId); + } + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); + } + 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; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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; + } + } + static UnregisterFromServiceRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Achievements.Descriptor, 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" }; + private static readonly uint[] _snapshotFieldTags = new uint[] { 10, 18 }; + 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.Achievements.internal__static_bnet_protocol_achievements_Snapshot__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Achievements.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 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_); + } + 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); + } + 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_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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; + } + } + static Snapshot() { + object.ReferenceEquals(global::bnet.protocol.achievements.Achievements.Descriptor, 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" }; + private static readonly uint[] _requestSnapshotRequestFieldTags = new uint[] { 10, 16 }; + 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.Achievements.internal__static_bnet_protocol_achievements_RequestSnapshotRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Achievements.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 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); + } + 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); + } + 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; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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; + } + } + static RequestSnapshotRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Achievements.Descriptor, 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.Achievements.internal__static_bnet_protocol_achievements_RequestSnapshotResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Achievements.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.Achievements.Descriptor, 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[] { "program_id" }; + private static readonly uint[] _initializeRequestFieldTags = new uint[] { 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.Achievements.internal__static_bnet_protocol_achievements_InitializeRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Achievements.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 override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _initializeRequestFieldNames; + 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 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; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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 InitializeRequest() { + object.ReferenceEquals(global::bnet.protocol.achievements.Achievements.Descriptor, 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" }; + private static readonly uint[] _initializeResponseFieldTags = new uint[] { 10 }; + 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.Achievements.internal__static_bnet_protocol_achievements_InitializeResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Achievements.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 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); + } + 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); + } + 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); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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; + } + } + static InitializeResponse() { + object.ReferenceEquals(global::bnet.protocol.achievements.Achievements.Descriptor, 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.Achievements.internal__static_bnet_protocol_achievements_SnapshotUpdateNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.achievements.Achievements.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.Achievements.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 static pbd::ServiceDescriptor Descriptor { + get { return Achievements.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; + 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; + 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; + 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)); + } + } + } + [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 static pbd::ServiceDescriptor Descriptor { + get { return Achievements.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; + 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; + 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.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)); + } + } + } + #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..807a5f32 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/achievements/AchievementsStaticData.cs @@ -0,0 +1,3656 @@ +// 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( + "Cj5zZXJ2aWNlL2FjaGlldmVtZW50cy9kZWZpbml0aW9uL2FjaGlldmVtZW50" + + "c19zdGF0aWNfZGF0YS5wcm90bxIaYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVu" + + "dHMiJwoJQXR0cmlidXRlEgsKA2tleRgBIAIoCRINCgV2YWx1ZRgCIAIoCSJj" + + "ChBDcml0ZXJpYU1vZGlmaWVyEhsKE25lY2Vzc2FyeV9jb25kaXRpb24YASAC" + + "KAQSDgoGdGFyZ2V0GAIgAigHEg8KB29wZXJhbmQYAyACKA0SEQoJY29tcGFy" + + "YW5kGAQgAigEIokBCg1Dcml0ZXJpYUV2ZW50EgoKAmlkGAEgAigEEhQKCWNv" + + "bXBhcmFuZBgCIAEoBDoBMBI+Cghtb2RpZmllchgDIAMoCzIsLmJuZXQucHJv" + + "dG9jb2wuYWNoaWV2ZW1lbnRzLkNyaXRlcmlhTW9kaWZpZXISFgoOdGltZXJf" + + "ZHVyYXRpb24YBCABKA0isgEKGFN0YXRpY0NhdGVnb3J5RGVmaW5pdGlvbhIK" + + "CgJpZBgBIAIoDRIRCglwYXJlbnRfaWQYAiABKAQSKAogT0JTT0xFVEVfZmVh" + + "dHVyZWRfYWNoaWV2ZW1lbnRfaWQYAyABKAQSEgoKb3JkZXJfaGludBgEIAIo" + + "DRI5CgphdHRyaWJ1dGVzGAUgAygLMiUuYm5ldC5wcm90b2NvbC5hY2hpZXZl" + + "bWVudHMuQXR0cmlidXRlIp0CChtTdGF0aWNBY2hpZXZlbWVudERlZmluaXRp" + + "b24SCgoCaWQYASACKAQSIgoac3VwZXJzZWRpbmdfYWNoaWV2ZW1lbnRfaWQY" + + "AiABKAQSEwoLY2F0ZWdvcnlfaWQYAyACKA0SGAoQbWluaW11bV9jcml0ZXJp" + + "YRgEIAEoDRIUCgxwb2ludHNfdmFsdWUYBSACKA0SDQoFZmxhZ3MYBiACKA0S" + + "EgoKb3JkZXJfaGludBgHIAIoDRIrCiNjcml0ZXJpYV9zaGFyZWRfd2l0aF9h" + + "Y2hpZXZlbWVudF9pZBgIIAEoBBI5CgphdHRyaWJ1dGVzGAkgAygLMiUuYm5l" + + "dC5wcm90b2NvbC5hY2hpZXZlbWVudHMuQXR0cmlidXRlIqQDChhTdGF0aWND" + + "cml0ZXJpYURlZmluaXRpb24SEwoLY3JpdGVyaWFfaWQYASACKAQSHQoVcGFy" + + "ZW50X2FjaGlldmVtZW50X2lkGAIgAigEEj4KC3N0YXJ0X2V2ZW50GAMgASgL" + + "MikuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVudHMuQ3JpdGVyaWFFdmVudBJA" + + "Cg1hZHZhbmNlX2V2ZW50GAQgASgLMikuYm5ldC5wcm90b2NvbC5hY2hpZXZl" + + "bWVudHMuQ3JpdGVyaWFFdmVudBI9CgpmYWlsX2V2ZW50GAUgASgLMikuYm5l" + + "dC5wcm90b2NvbC5hY2hpZXZlbWVudHMuQ3JpdGVyaWFFdmVudBIaChJuZWNl" + + "c3NhcnlfcXVhbnRpdHkYBiACKAQSEgoKb3JkZXJfaGludBgHIAEoDRIZChFl" + + "dmFsdXRhdGlvbl9jbGFzcxgIIAIoBxINCgVmbGFncxgJIAIoDRI5CgphdHRy" + + "aWJ1dGVzGAogAygLMiUuYm5ldC5wcm90b2NvbC5hY2hpZXZlbWVudHMuQXR0" + + "cmlidXRlIu8BCg9BY2hpZXZlbWVudEZpbGUSRgoIY2F0ZWdvcnkYASADKAsy" + + "NC5ibmV0LnByb3RvY29sLmFjaGlldmVtZW50cy5TdGF0aWNDYXRlZ29yeURl" + + "ZmluaXRpb24STAoLYWNoaWV2ZW1lbnQYAiADKAsyNy5ibmV0LnByb3RvY29s" + + "LmFjaGlldmVtZW50cy5TdGF0aWNBY2hpZXZlbWVudERlZmluaXRpb24SRgoI" + + "Y3JpdGVyaWEYAyADKAsyNC5ibmV0LnByb3RvY29sLmFjaGlldmVtZW50cy5T" + + "dGF0aWNDcml0ZXJpYURlZmluaXRpb24qMwoRTW9kaWZlclRhcmdldFR5cGUS" + + "DwoHU1VCSkVDVBDqxNWbBRINCgZPQkpFQ1QQ6sS9Ag=="); + 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", }); + 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", "category", "criteria" }; + private static readonly uint[] _achievementFileFieldTags = new uint[] { 18, 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 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; + } + 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[1], category_); + } + if (achievement_.Count > 0) { + output.WriteMessageArray(2, field_names[0], achievement_); + } + if (criteria_.Count > 0) { + output.WriteMessageArray(3, field_names[2], criteria_); + } + 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); + } + 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(); + return this; + } + + public 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_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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; + } + } + 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..a1903bd6 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 @@ -31,24 +36,25 @@ 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="); + "LmF0dHJpYnV0ZRoZbGliL3Byb3RvY29sL2VudGl0eS5wcm90byLhAQoHVmFy" + + "aWFudBISCgpib29sX3ZhbHVlGAIgASgIEhEKCWludF92YWx1ZRgDIAEoAxIT" + + "CgtmbG9hdF92YWx1ZRgEIAEoARIUCgxzdHJpbmdfdmFsdWUYBSABKAkSEgoK" + + "YmxvYl92YWx1ZRgGIAEoDBIVCg1tZXNzYWdlX3ZhbHVlGAcgASgMEhQKDGZv" + + "dXJjY192YWx1ZRgIIAEoCRISCgp1aW50X3ZhbHVlGAkgASgEEi8KDmVudGl0" + + "eWlkX3ZhbHVlGAogASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCJKCglB" + + "dHRyaWJ1dGUSDAoEbmFtZRgBIAIoCRIvCgV2YWx1ZRgCIAIoCzIgLmJuZXQu" + + "cHJvdG9jb2wuYXR0cmlidXRlLlZhcmlhbnQi4AEKD0F0dHJpYnV0ZUZpbHRl" + + "chI+CgJvcBgBIAIoDjIyLmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJp" + + "YnV0ZUZpbHRlci5PcGVyYXRpb24SNQoJYXR0cmlidXRlGAIgAygLMiIuYm5l" + + "dC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlIlYKCU9wZXJhdGlvbhIO" + + "CgpNQVRDSF9OT05FEAASDQoJTUFUQ0hfQU5ZEAESDQoJTUFUQ0hfQUxMEAIS" + + "GwoXTUFUQ0hfQUxMX01PU1RfU1BFQ0lGSUMQAw=="); 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/Authentication.cs b/src/LibMooNet/bnet/protocol/authentication/Authentication.cs new file mode 100644 index 00000000..481473a1 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/authentication/Authentication.cs @@ -0,0 +1,2182 @@ +// 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 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; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static Authentication() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "CjZzZXJ2aWNlL2F1dGhlbnRpY2F0aW9uL2RlZmluaXRpb24vYXV0aGVudGlj" + + "YXRpb24ucHJvdG8SHGJuZXQucHJvdG9jb2wuYXV0aGVudGljYXRpb24aEWxp" + + "Yi9ycGMvcnBjLnByb3RvGiFsaWIvcHJvdG9jb2wvY29udGVudF9oYW5kbGUu" + + "cHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJvdG8iWQoRTW9kdWxlTG9h" + + "ZFJlcXVlc3QSMwoNbW9kdWxlX2hhbmRsZRgBIAIoCzIcLmJuZXQucHJvdG9j" + + "b2wuQ29udGVudEhhbmRsZRIPCgdtZXNzYWdlGAIgASgMIicKEk1vZHVsZUxv" + + "YWRSZXNwb25zZRIRCgltb2R1bGVfaWQYAiABKAUiOgoUTW9kdWxlTWVzc2Fn" + + "ZVJlcXVlc3QSEQoJbW9kdWxlX2lkGAEgAigFEg8KB21lc3NhZ2UYAiABKAwi" + + "kwEKDExvZ29uUmVxdWVzdBIPCgdwcm9ncmFtGAEgASgJEhAKCHBsYXRmb3Jt" + + "GAIgASgJEg4KBmxvY2FsZRgDIAEoCRINCgVlbWFpbBgEIAEoCRITCgtsaXN0" + + "ZW5lcl9pZBgFIAEoBBIPCgd2ZXJzaW9uGAYgASgJEhsKE2FwcGxpY2F0aW9u" + + "X3ZlcnNpb24YByABKAUiaAoNTG9nb25SZXNwb25zZRIoCgdhY2NvdW50GAEg" + + "AigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBItCgxnYW1lX2FjY291bnQY" + + "AiACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkMvYBChRBdXRoZW50aWNh" + + "dGlvbkNsaWVudBJ8CgpNb2R1bGVMb2FkEi8uYm5ldC5wcm90b2NvbC5hdXRo" + + "ZW50aWNhdGlvbi5Nb2R1bGVMb2FkUmVxdWVzdBowLmJuZXQucHJvdG9jb2wu" + + "YXV0aGVudGljYXRpb24uTW9kdWxlTG9hZFJlc3BvbnNlIguAtRgBlbUYAAA0" + + "QxJgCg1Nb2R1bGVNZXNzYWdlEjIuYm5ldC5wcm90b2NvbC5hdXRoZW50aWNh" + + "dGlvbi5Nb2R1bGVNZXNzYWdlUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9E" + + "YXRhIgSAtRgCMucBChRBdXRoZW50aWNhdGlvblNlcnZlchJtCgVMb2dvbhIq" + + "LmJuZXQucHJvdG9jb2wuYXV0aGVudGljYXRpb24uTG9nb25SZXF1ZXN0Gisu" + + "Ym5ldC5wcm90b2NvbC5hdXRoZW50aWNhdGlvbi5Mb2dvblJlc3BvbnNlIguA" + + "tRgBlbUYAAAWRBJgCg1Nb2R1bGVNZXNzYWdlEjIuYm5ldC5wcm90b2NvbC5h" + + "dXRoZW50aWNhdGlvbi5Nb2R1bGVNZXNzYWdlUmVxdWVzdBoVLmJuZXQucHJv" + + "dG9jb2wuTm9EYXRhIgSAtRgCQgOAAQA="); + 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", "ApplicationVersion", }); + 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", }); + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + 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.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.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_; + 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.Authentication.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ModuleLoadResponse : pb::GeneratedMessage { + private ModuleLoadResponse() { } + private static readonly ModuleLoadResponse defaultInstance = new ModuleLoadResponse().MakeReadOnly(); + private static readonly string[] _moduleLoadResponseFieldNames = new string[] { "module_id" }; + private static readonly uint[] _moduleLoadResponseFieldTags = new uint[] { 16 }; + 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_; + public bool HasModuleId { + get { return hasModuleId; } + } + public int ModuleId { + get { return moduleId_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _moduleLoadResponseFieldNames; + if (hasModuleId) { + output.WriteInt32(2, field_names[0], 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::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ModuleLoadResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ModuleLoadResponse MakeReadOnly() { + return this; + } + + public 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 new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ModuleLoadResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ModuleLoadResponse result; + + private ModuleLoadResponse PrepareBuilder() { + if (resultIsReadOnly) { + ModuleLoadResponse original = result; + result = new ModuleLoadResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ModuleLoadResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.ModuleLoadResponse.Descriptor; } + } + + public override ModuleLoadResponse DefaultInstanceForType { + get { return global::bnet.protocol.authentication.ModuleLoadResponse.DefaultInstance; } + } + + public override ModuleLoadResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + 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; + PrepareBuilder(); + if (other.HasModuleId) { + ModuleId = other.ModuleId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_moduleLoadResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _moduleLoadResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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; + } + } + } + + 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; + } + } + static ModuleLoadResponse() { + object.ReferenceEquals(global::bnet.protocol.authentication.Authentication.Descriptor, 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.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_; + 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.Authentication.Descriptor, 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", "email", "listener_id", "locale", "platform", "program", "version" }; + private static readonly uint[] _logonRequestFieldTags = new uint[] { 56, 34, 40, 26, 18, 10, 50 }; + 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_; + 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 const int ApplicationVersionFieldNumber = 7; + private bool hasApplicationVersion; + private int applicationVersion_; + public bool HasApplicationVersion { + get { return hasApplicationVersion; } + } + public int ApplicationVersion { + get { return applicationVersion_; } + } + + 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[1], Email); + } + if (hasListenerId) { + output.WriteUInt64(5, field_names[2], ListenerId); + } + if (hasVersion) { + output.WriteString(6, field_names[6], Version); + } + if (hasApplicationVersion) { + output.WriteInt32(7, field_names[0], ApplicationVersion); + } + 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); + } + if (hasApplicationVersion) { + size += pb::CodedOutputStream.ComputeInt32Size(7, ApplicationVersion); + } + 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.HasListenerId) { + ListenerId = other.ListenerId; + } + if (other.HasVersion) { + Version = other.Version; + } + if (other.HasApplicationVersion) { + ApplicationVersion = other.ApplicationVersion; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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 40: { + result.hasListenerId = input.ReadUInt64(ref result.listenerId_); + break; + } + case 50: { + result.hasVersion = input.ReadString(ref result.version_); + break; + } + case 56: { + result.hasApplicationVersion = input.ReadInt32(ref result.applicationVersion_); + 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 HasListenerId { + get { return result.hasListenerId; } + } + public ulong ListenerId { + get { return result.ListenerId; } + set { SetListenerId(value); } + } + public Builder SetListenerId(ulong value) { + PrepareBuilder(); + result.hasListenerId = true; + result.listenerId_ = value; + return this; + } + public Builder ClearListenerId() { + PrepareBuilder(); + 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"); + 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; + } + } + static LogonRequest() { + object.ReferenceEquals(global::bnet.protocol.authentication.Authentication.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class LogonResponse : pb::GeneratedMessage { + private LogonResponse() { } + private static readonly LogonResponse defaultInstance = new LogonResponse().MakeReadOnly(); + private static readonly string[] _logonResponseFieldNames = new string[] { "account", "game_account" }; + private static readonly uint[] _logonResponseFieldTags = new uint[] { 10, 18 }; + 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_; + public bool HasAccount { + get { return hasAccount; } + } + public global::bnet.protocol.EntityId Account { + get { return account_ ?? 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 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::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _logonResponseFieldNames; + if (hasAccount) { + output.WriteMessage(1, field_names[0], Account); + } + if (hasGameAccount) { + output.WriteMessage(2, field_names[1], 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::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static LogonResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private LogonResponse MakeReadOnly() { + return this; + } + + public 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 new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(LogonResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private LogonResponse result; + + private LogonResponse PrepareBuilder() { + if (resultIsReadOnly) { + LogonResponse original = result; + result = new LogonResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override LogonResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.LogonResponse.Descriptor; } + } + + public override LogonResponse DefaultInstanceForType { + get { return global::bnet.protocol.authentication.LogonResponse.DefaultInstance; } + } + + public override LogonResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + 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; + PrepareBuilder(); + if (other.HasAccount) { + MergeAccount(other.Account); + } + if (other.HasGameAccount) { + MergeGameAccount(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(_logonResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _logonResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.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 (result.hasGameAccount) { + subBuilder.MergeFrom(GameAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + GameAccount = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + 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 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; + } + } + static LogonResponse() { + object.ReferenceEquals(global::bnet.protocol.authentication.Authentication.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 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); + } + + [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.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)); + } + } + } + [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 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); + } + + [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.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 + +} + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/challenge/Challenge.cs b/src/LibMooNet/bnet/protocol/challenge/Challenge.cs new file mode 100644 index 00000000..de5d0aa7 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/challenge/Challenge.cs @@ -0,0 +1,2311 @@ +// 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 Challenge { + + #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 Challenge() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "CixzZXJ2aWNlL2NoYWxsZW5nZS9kZWZpbml0aW9uL2NoYWxsZW5nZS5wcm90" + + "bxIXYm5ldC5wcm90b2NvbC5jaGFsbGVuZ2UaHGxpYi9wcm90b2NvbC9hdHRy" + + "aWJ1dGUucHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJvdG8aEWxpYi9y" + + "cGMvcnBjLnByb3RvIjcKCUNoYWxsZW5nZRIMCgR0eXBlGAEgAigNEgwKBGlu" + + "Zm8YAiABKAkSDgoGYW5zd2VyGAMgASgJIisKFkNoYWxsZW5nZVBpY2tlZFJl" + + "cXVlc3QSEQoJY2hhbGxlbmdlGAEgAigNIioKGENoYWxsZW5nZUFuc3dlcmVk" + + "UmVxdWVzdBIOCgZhbnN3ZXIYASACKAkisQEKGlNlbmRDaGFsbGVuZ2VUb1Vz" + + "ZXJSZXF1ZXN0EikKB3BlZXJfaWQYASABKAsyGC5ibmV0LnByb3RvY29sLlBy" + + "b2Nlc3NJZBIwCg9nYW1lX2FjY291bnRfaWQYAiABKAsyFy5ibmV0LnByb3Rv" + + "Y29sLkVudGl0eUlkEjYKCmNoYWxsZW5nZXMYAyADKAsyIi5ibmV0LnByb3Rv" + + "Y29sLmNoYWxsZW5nZS5DaGFsbGVuZ2UiVAobU2VuZENoYWxsZW5nZVRvVXNl" + + "clJlc3BvbnNlEjUKCWNoYWxsZW5nZRgBIAIoCzIiLmJuZXQucHJvdG9jb2wu" + + "Y2hhbGxlbmdlLkNoYWxsZW5nZSJOChRDaGFsbGVuZ2VVc2VyUmVxdWVzdBI2" + + "CgpjaGFsbGVuZ2VzGAEgAygLMiIuYm5ldC5wcm90b2NvbC5jaGFsbGVuZ2Uu" + + "Q2hhbGxlbmdlMusCChBDaGFsbGVuZ2VTZXJ2aWNlEmQKD0NoYWxsZW5nZVBp" + + "Y2tlZBIvLmJuZXQucHJvdG9jb2wuY2hhbGxlbmdlLkNoYWxsZW5nZVBpY2tl" + + "ZFJlcXVlc3QaGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgBEmgK" + + "EUNoYWxsZW5nZUFuc3dlcmVkEjEuYm5ldC5wcm90b2NvbC5jaGFsbGVuZ2Uu" + + "Q2hhbGxlbmdlQW5zd2VyZWRSZXF1ZXN0GhouYm5ldC5wcm90b2NvbC5OT19S" + + "RVNQT05TRSIEgLUYAhKGAQoTU2VuZENoYWxsZW5nZVRvVXNlchIzLmJuZXQu" + + "cHJvdG9jb2wuY2hhbGxlbmdlLlNlbmRDaGFsbGVuZ2VUb1VzZXJSZXF1ZXN0" + + "GjQuYm5ldC5wcm90b2NvbC5jaGFsbGVuZ2UuU2VuZENoYWxsZW5nZVRvVXNl" + + "clJlc3BvbnNlIgSAtRgDMnMKD0NoYWxsZW5nZU5vdGlmeRJgCg1DaGFsbGVu" + + "Z2VVc2VyEi0uYm5ldC5wcm90b2NvbC5jaGFsbGVuZ2UuQ2hhbGxlbmdlVXNl" + + "clJlcXVlc3QaGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgBQgOA" + + "AQA="); + 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", }); + 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", }); + 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", }); + 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 Challenge : pb::GeneratedMessage { + private Challenge() { } + private static readonly Challenge defaultInstance = new Challenge().MakeReadOnly(); + private static readonly string[] _challengeFieldNames = new string[] { "answer", "info", "type" }; + private static readonly uint[] _challengeFieldTags = new uint[] { 26, 18, 8 }; + 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.Challenge.internal__static_bnet_protocol_challenge_Challenge__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.challenge.Proto.Challenge.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 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.WriteUInt32(1, field_names[2], Type); + } + if (hasInfo) { + output.WriteString(2, field_names[1], Info); + } + if (hasAnswer) { + output.WriteString(3, 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 (hasType) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Type); + } + if (hasInfo) { + size += pb::CodedOutputStream.ComputeStringSize(2, Info); + } + if (hasAnswer) { + size += pb::CodedOutputStream.ComputeStringSize(3, Answer); + } + 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; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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 8: { + result.hasType = input.ReadUInt32(ref result.type_); + break; + } + case 18: { + result.hasInfo = input.ReadString(ref result.info_); + break; + } + case 26: { + result.hasAnswer = input.ReadString(ref result.answer_); + 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; + } + } + static Challenge() { + object.ReferenceEquals(global::bnet.protocol.challenge.Proto.Challenge.Descriptor, 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[] { 8 }; + 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.Challenge.internal__static_bnet_protocol_challenge_ChallengePickedRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.challenge.Proto.Challenge.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.WriteUInt32(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.ComputeUInt32Size(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 8: { + result.hasChallenge = input.ReadUInt32(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.Challenge.Descriptor, 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.Challenge.internal__static_bnet_protocol_challenge_ChallengeAnsweredRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.challenge.Proto.Challenge.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.Challenge.Descriptor, 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", "game_account_id", "peer_id" }; + private static readonly uint[] _sendChallengeToUserRequestFieldTags = new uint[] { 26, 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.Challenge.internal__static_bnet_protocol_challenge_SendChallengeToUserRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.challenge.Proto.Challenge.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 override bool IsInitialized { + get { + 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[2], PeerId); + } + if (hasGameAccountId) { + output.WriteMessage(2, field_names[1], GameAccountId); + } + if (challenges_.Count > 0) { + output.WriteMessageArray(3, field_names[0], challenges_); + } + 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); + } + 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_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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; + } + } + static SendChallengeToUserRequest() { + object.ReferenceEquals(global::bnet.protocol.challenge.Proto.Challenge.Descriptor, 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.Challenge.internal__static_bnet_protocol_challenge_SendChallengeToUserResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.challenge.Proto.Challenge.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.Challenge.Descriptor, 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" }; + private static readonly uint[] _challengeUserRequestFieldTags = new uint[] { 10 }; + 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.Challenge.internal__static_bnet_protocol_challenge_ChallengeUserRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.challenge.Proto.Challenge.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 override bool IsInitialized { + get { + 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_); + } + 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); + } + 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_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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; + } + } + static ChallengeUserRequest() { + object.ReferenceEquals(global::bnet.protocol.challenge.Proto.Challenge.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 SendChallengeToUser( + pb::IRpcController controller, + global::bnet.protocol.challenge.SendChallengeToUserRequest request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return Proto.Challenge.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.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.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.NO_RESPONSE.DefaultInstance; + case 2: + 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.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[2], + 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.Challenge.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/source/D3Proto/bnet/protocol/channel/Channel.cs b/src/LibMooNet/bnet/protocol/channel/Channel.cs similarity index 71% rename from source/D3Proto/bnet/protocol/channel/Channel.cs rename to src/LibMooNet/bnet/protocol/channel/Channel.cs index af39c4c9..17d1223f 100644 --- a/source/D3Proto/bnet/protocol/channel/Channel.cs +++ b/src/LibMooNet/bnet/protocol/channel/Channel.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.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 Channel { #region Extension registration @@ -55,88 +60,78 @@ static Channel() { "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" + + "LnByb3RvGi5zZXJ2aWNlL2NoYW5uZWwvZGVmaW5pdGlvbi9jaGFubmVsX3R5" + + "cGVzLnByb3RvIrUBChBBZGRNZW1iZXJSZXF1ZXN0EikKCGFnZW50X2lkGAEg" + + "ASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIwCg9tZW1iZXJfaWRlbnRp" + + "dHkYAiACKAsyFy5ibmV0LnByb3RvY29sLklkZW50aXR5EjEKBXN0YXRlGAMg" + + "AigLMiIuYm5ldC5wcm90b2NvbC5jaGFubmVsLk1lbWJlclN0YXRlEhEKCW9i" + + "amVjdF9pZBgEIAIoBCJ8ChNSZW1vdmVNZW1iZXJSZXF1ZXN0EikKCGFnZW50" + + "X2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIqCgltZW1iZXJf" + + "aWQYAiACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEg4KBnJlYXNvbhgD" + + "IAEoDSKQAQoSU2VuZE1lc3NhZ2VSZXF1ZXN0EikKCGFnZW50X2lkGAEgASgL" + + "MhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIvCgdtZXNzYWdlGAIgAigLMh4u" + + "Ym5ldC5wcm90b2NvbC5jaGFubmVsLk1lc3NhZ2USHgoTcmVxdWlyZWRfcHJp" + + "dmlsZWdlcxgDIAEoBDoBMCKBAQoZVXBkYXRlQ2hhbm5lbFN0YXRlUmVxdWVz" + + "dBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + + "OQoMc3RhdGVfY2hhbmdlGAIgAigLMiMuYm5ldC5wcm90b2NvbC5jaGFubmVs" + + "LkNoYW5uZWxTdGF0ZSJ6ChhVcGRhdGVNZW1iZXJTdGF0ZVJlcXVlc3QSKQoI" + + "YWdlbnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEjMKDHN0" + + "YXRlX2NoYW5nZRgCIAMoCzIdLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5NZW1i" + + "ZXIiTAoPRGlzc29sdmVSZXF1ZXN0EikKCGFnZW50X2lkGAEgASgLMhcuYm5l" + + "dC5wcm90b2NvbC5FbnRpdHlJZBIOCgZyZWFzb24YAiABKA0iegoPU2V0Um9s" + + "ZXNSZXF1ZXN0EikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5F" + + "bnRpdHlJZBIQCgRyb2xlGAIgAygNQgIQARIqCgltZW1iZXJfaWQYAyADKAsy" + + "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkIqkBCg9BZGROb3RpZmljYXRpb24S" + + "KwoEc2VsZhgBIAEoCzIdLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5NZW1iZXIS" + + "LQoGbWVtYmVyGAIgAygLMh0uYm5ldC5wcm90b2NvbC5jaGFubmVsLk1lbWJl" + + "chI6Cg1jaGFubmVsX3N0YXRlGAMgAigLMiMuYm5ldC5wcm90b2NvbC5jaGFu" + + "bmVsLkNoYW5uZWxTdGF0ZSJBChBKb2luTm90aWZpY2F0aW9uEi0KBm1lbWJl" + + "chgBIAIoCzIdLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5NZW1iZXIiewoSUmVt" + + "b3ZlTm90aWZpY2F0aW9uEikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90" + + "b2NvbC5FbnRpdHlJZBIqCgltZW1iZXJfaWQYAiACKAsyFy5ibmV0LnByb3Rv" + + "Y29sLkVudGl0eUlkEg4KBnJlYXNvbhgDIAEoDSJqChFMZWF2ZU5vdGlmaWNh" + + "dGlvbhIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5" + + "SWQSKgoJbWVtYmVyX2lkGAIgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJ" + + "ZCKVAQoXU2VuZE1lc3NhZ2VOb3RpZmljYXRpb24SKQoIYWdlbnRfaWQYASAB" + + "KAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEi8KB21lc3NhZ2UYAiACKAsy" + + "Hi5ibmV0LnByb3RvY29sLmNoYW5uZWwuTWVzc2FnZRIeChNyZXF1aXJlZF9w" + + "cml2aWxlZ2VzGAMgASgEOgEwIoYBCh5VcGRhdGVDaGFubmVsU3RhdGVOb3Rp" + + "ZmljYXRpb24SKQoIYWdlbnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVu" + + "dGl0eUlkEjkKDHN0YXRlX2NoYW5nZRgCIAIoCzIjLmJuZXQucHJvdG9jb2wu" + + "Y2hhbm5lbC5DaGFubmVsU3RhdGUifwodVXBkYXRlTWVtYmVyU3RhdGVOb3Rp" + + "ZmljYXRpb24SKQoIYWdlbnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVu" + + "dGl0eUlkEjMKDHN0YXRlX2NoYW5nZRgCIAMoCzIdLmJuZXQucHJvdG9jb2wu" + + "Y2hhbm5lbC5NZW1iZXIy9gQKB0NoYW5uZWwSUQoJQWRkTWVtYmVyEicuYm5l" + + "dC5wcm90b2NvbC5jaGFubmVsLkFkZE1lbWJlclJlcXVlc3QaFS5ibmV0LnBy" + + "b3RvY29sLk5vRGF0YSIEgLUYARJXCgxSZW1vdmVNZW1iZXISKi5ibmV0LnBy" + + "b3RvY29sLmNoYW5uZWwuUmVtb3ZlTWVtYmVyUmVxdWVzdBoVLmJuZXQucHJv" + + "dG9jb2wuTm9EYXRhIgSAtRgCElUKC1NlbmRNZXNzYWdlEikuYm5ldC5wcm90" + + "b2NvbC5jaGFubmVsLlNlbmRNZXNzYWdlUmVxdWVzdBoVLmJuZXQucHJvdG9j" + + "b2wuTm9EYXRhIgSAtRgDEmMKElVwZGF0ZUNoYW5uZWxTdGF0ZRIwLmJuZXQu" + + "cHJvdG9jb2wuY2hhbm5lbC5VcGRhdGVDaGFubmVsU3RhdGVSZXF1ZXN0GhUu" + + "Ym5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAQSYQoRVXBkYXRlTWVtYmVyU3Rh" + + "dGUSLy5ibmV0LnByb3RvY29sLmNoYW5uZWwuVXBkYXRlTWVtYmVyU3RhdGVS" + + "ZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAUSTwoIRGlzc29s" + "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=="); + "Ym5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAYSTwoIU2V0Um9sZXMSJi5ibmV0" + + "LnByb3RvY29sLmNoYW5uZWwuU2V0Um9sZXNSZXF1ZXN0GhUuYm5ldC5wcm90" + + "b2NvbC5Ob0RhdGEiBIC1GAcyygUKEUNoYW5uZWxTdWJzY3JpYmVyElUKCU5v" + + "dGlmeUFkZBImLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5BZGROb3RpZmljYXRp" + + "b24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgBElcKCk5vdGlm" + + "eUpvaW4SJy5ibmV0LnByb3RvY29sLmNoYW5uZWwuSm9pbk5vdGlmaWNhdGlv" + + "bhoaLmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAISWwoMTm90aWZ5" + + "UmVtb3ZlEikuYm5ldC5wcm90b2NvbC5jaGFubmVsLlJlbW92ZU5vdGlmaWNh" + + "dGlvbhoaLmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAMSWQoLTm90" + + "aWZ5TGVhdmUSKC5ibmV0LnByb3RvY29sLmNoYW5uZWwuTGVhdmVOb3RpZmlj" + + "YXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgEEmUKEU5v" + + "dGlmeVNlbmRNZXNzYWdlEi4uYm5ldC5wcm90b2NvbC5jaGFubmVsLlNlbmRN" + + "ZXNzYWdlTm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05T" + + "RSIEgLUYBRJzChhOb3RpZnlVcGRhdGVDaGFubmVsU3RhdGUSNS5ibmV0LnBy" + + "b3RvY29sLmNoYW5uZWwuVXBkYXRlQ2hhbm5lbFN0YXRlTm90aWZpY2F0aW9u" + + "GhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRSIEgLUYBhJxChdOb3RpZnlV" + + "cGRhdGVNZW1iZXJTdGF0ZRI0LmJuZXQucHJvdG9jb2wuY2hhbm5lbC5VcGRh" + + "dGVNZW1iZXJTdGF0ZU5vdGlmaWNhdGlvbhoaLmJuZXQucHJvdG9jb2wuTk9f" + + "UkVTUE9OU0UiBIC1GAdCA4ABAA=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_channel_AddMemberRequest__Descriptor = Descriptor.MessageTypes[0]; @@ -195,7 +190,13 @@ static Channel() { internal__static_bnet_protocol_channel_UpdateMemberStateNotification__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_channel_UpdateMemberStateNotification__Descriptor, new string[] { "AgentId", "StateChange", }); - 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); + global::bnet.protocol.channel.ChannelTypes.RegisterAllExtensions(registry); + return registry; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { @@ -210,14 +211,20 @@ static Channel() { } } #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", "object_id", "state" }; + private static readonly uint[] _addMemberRequestFieldTags = new uint[] { 10, 18, 32, 26 }; public static AddMemberRequest DefaultInstance { get { return defaultInstance; } } public override AddMemberRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override AddMemberRequest ThisMessage { @@ -234,37 +241,37 @@ protected override AddMemberRequest ThisMessage { 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; + private global::bnet.protocol.channel.MemberState state_; public bool HasState { get { return hasState; } } public global::bnet.protocol.channel.MemberState State { - get { return state_; } + get { return state_ ?? 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; } } @@ -286,19 +293,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 = _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 (hasState) { + output.WriteMessage(3, field_names[3], State); } - if (HasObjectId) { - output.WriteUInt64(4, ObjectId); + if (hasObjectId) { + output.WriteUInt64(4, field_names[2], ObjectId); } UnknownFields.WriteTo(output); } @@ -310,16 +318,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) { + if (hasState) { size += pb::CodedOutputStream.ComputeMessageSize(3, State); } - if (HasObjectId) { + if (hasObjectId) { size += pb::CodedOutputStream.ComputeUInt64Size(4, ObjectId); } size += UnknownFields.SerializedSize; @@ -352,38 +360,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; + } + + private bool resultIsReadOnly; + private AddMemberRequest result; + + private AddMemberRequest PrepareBuilder() { + if (resultIsReadOnly) { + AddMemberRequest original = result; + result = new AddMemberRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - AddMemberRequest result = new AddMemberRequest(); + 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 +437,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,6 +455,7 @@ 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); } @@ -430,20 +472,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 +508,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 +522,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,7 +531,7 @@ 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) { + if (result.hasState) { subBuilder.MergeFrom(State); } input.ReadMessage(subBuilder, extensionRegistry); @@ -486,16 +539,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis 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 +561,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 +586,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 +601,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,13 +626,14 @@ 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; } + get { return result.hasState; } } public global::bnet.protocol.channel.MemberState State { get { return result.State; } @@ -575,19 +641,22 @@ public bool HasState { } 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"); - if (result.HasState && + 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 { @@ -597,24 +666,27 @@ public Builder MergeState(global::bnet.protocol.channel.MemberState value) { return this; } public Builder ClearState() { + PrepareBuilder(); result.hasState = false; - result.state_ = global::bnet.protocol.channel.MemberState.DefaultInstance; + result.state_ = 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; @@ -625,14 +697,20 @@ static AddMemberRequest() { } } + [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 { @@ -649,27 +727,27 @@ protected override RemoveMemberRequest ThisMessage { 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 +766,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 +788,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 +827,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; - RemoveMemberRequest result = new RemoveMemberRequest(); + private RemoveMemberRequest PrepareBuilder() { + if (resultIsReadOnly) { + RemoveMemberRequest original = result; + result = new RemoveMemberRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +904,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 +922,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 +936,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 +972,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 +986,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 +994,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 +1016,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 +1041,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 +1056,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,24 +1081,27 @@ 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; @@ -973,14 +1112,20 @@ static RemoveMemberRequest() { } } + [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 { @@ -997,27 +1142,27 @@ protected override SendMessageRequest ThisMessage { 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 +1181,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 +1203,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 +1242,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; - SendMessageRequest result = new SendMessageRequest(); + private SendMessageRequest PrepareBuilder() { + if (resultIsReadOnly) { + SendMessageRequest original = result; + result = new SendMessageRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +1319,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 +1337,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 +1351,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 +1387,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 +1401,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 +1409,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 +1431,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 +1456,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 +1471,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,24 +1496,27 @@ 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; @@ -1321,14 +1527,20 @@ static SendMessageRequest() { } } + [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 { @@ -1345,22 +1557,22 @@ protected override UpdateChannelStateRequest ThisMessage { 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 +1586,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 +1605,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 +1641,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 +1718,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 +1736,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 +1747,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 +1783,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 +1797,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 +1806,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 +1823,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 +1848,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 +1863,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,8 +1888,9 @@ 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; } } @@ -1628,14 +1899,20 @@ static UpdateChannelStateRequest() { } } + [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 { @@ -1652,12 +1929,12 @@ protected override UpdateMemberStateRequest ThisMessage { 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 +1961,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 +1980,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 +2016,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 +2094,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 +2112,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 +2159,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 +2172,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 +2194,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 +2219,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,29 +2236,35 @@ 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; } @@ -1938,14 +2274,20 @@ static UpdateMemberStateRequest() { } } + [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 { @@ -1962,17 +2304,17 @@ protected override DissolveRequest ThisMessage { 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 +2331,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 +2350,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 +2386,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; + } + + private bool resultIsReadOnly; + private DissolveRequest result; + + private DissolveRequest PrepareBuilder() { + if (resultIsReadOnly) { + DissolveRequest original = result; + result = new DissolveRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - DissolveRequest result = new DissolveRequest(); + 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 +2463,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 +2481,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 +2492,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 +2528,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 +2541,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 +2563,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,24 +2588,27 @@ 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; @@ -2220,14 +2619,20 @@ static DissolveRequest() { } } + [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 { @@ -2244,15 +2649,16 @@ protected override SetRolesRequest ThisMessage { 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 +2694,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 +2716,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } { @@ -2320,7 +2725,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 +2763,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 +2842,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 +2860,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 +2910,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 +2950,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 +2975,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 +2991,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,29 +3022,35 @@ 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; } @@ -2589,14 +3060,20 @@ static SetRolesRequest() { } } + [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 { @@ -2613,12 +3090,12 @@ protected override AddNotification ThisMessage { 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 +3112,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 +3134,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 +3156,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 +3195,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; + } + + private bool resultIsReadOnly; + private AddNotification result; + + private AddNotification PrepareBuilder() { + if (resultIsReadOnly) { + AddNotification original = result; + result = new AddNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - AddNotification result = new AddNotification(); + 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 +3273,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 +3291,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 +3305,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 +3341,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 +3354,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 +3368,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 +3385,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 +3410,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 +3427,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 +3469,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,8 +3494,9 @@ 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; } } @@ -2965,14 +3505,20 @@ static AddNotification() { } } + [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 { @@ -2989,12 +3535,12 @@ protected override JoinNotification ThisMessage { 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 +3551,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 +3567,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 +3600,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; + } + + private bool resultIsReadOnly; + private JoinNotification result; - JoinNotification result = new JoinNotification(); + 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 +3677,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 +3695,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 +3703,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 +3739,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 +3753,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 +3770,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,8 +3795,9 @@ 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; } } @@ -3205,14 +3806,20 @@ static JoinNotification() { } } + [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 { @@ -3229,27 +3836,27 @@ protected override RemoveNotification ThisMessage { 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 +3875,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 +3897,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 +3936,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 +4013,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 +4031,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 +4045,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 +4081,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 +4095,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 +4103,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 +4125,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 +4150,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 +4165,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,24 +4190,27 @@ 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; @@ -3553,14 +4221,20 @@ static RemoveNotification() { } } + [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" }; + private static readonly uint[] _leaveNotificationFieldTags = new uint[] { 10, 18 }; public static LeaveNotification DefaultInstance { get { return defaultInstance; } } public override LeaveNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override LeaveNotification ThisMessage { @@ -3577,22 +4251,22 @@ protected override LeaveNotification ThisMessage { 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 override bool IsInitialized { @@ -3606,13 +4280,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 = _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); } UnknownFields.WriteTo(output); } @@ -3624,10 +4299,10 @@ 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); } size += UnknownFields.SerializedSize; @@ -3660,38 +4335,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 +4412,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,6 +4430,7 @@ 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); } @@ -3732,20 +4441,31 @@ public override Builder MergeFrom(LeaveNotification 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(_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 +4477,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,7 +4491,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); @@ -3780,11 +4500,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; } @@ -3792,19 +4517,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 +4542,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 +4557,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,8 +4582,9 @@ 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; } } @@ -3860,14 +4593,20 @@ static LeaveNotification() { } } + [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 { @@ -3884,27 +4623,27 @@ protected override SendMessageNotification ThisMessage { 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 +4662,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 +4684,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 +4723,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 +4800,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 +4818,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 +4832,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 +4868,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 +4882,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 +4890,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 +4912,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 +4937,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 +4952,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,24 +4977,27 @@ 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; @@ -4208,14 +5008,20 @@ static SendMessageNotification() { } } + [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 { @@ -4232,22 +5038,22 @@ protected override UpdateChannelStateNotification ThisMessage { 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 +5067,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 +5086,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 +5122,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 +5199,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 +5217,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 +5228,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 +5264,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 +5278,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 +5287,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 +5304,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 +5329,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 +5344,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,8 +5369,9 @@ 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; } } @@ -4515,14 +5380,20 @@ static UpdateChannelStateNotification() { } } + [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 { @@ -4539,12 +5410,12 @@ protected override UpdateMemberStateNotification ThisMessage { 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 +5442,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 +5461,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 +5497,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 +5575,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 +5593,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 +5640,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 +5653,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 +5675,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 +5700,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,29 +5717,35 @@ 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; } @@ -4828,6 +5758,9 @@ static UpdateMemberStateNotification() { #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, @@ -4969,6 +5902,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 +5980,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 +6014,7 @@ public abstract void NotifyUpdateMemberState( global::System.Action done); public static pbd::ServiceDescriptor Descriptor { - get { return Proto.Channel.Descriptor.Services[2]; } + get { return Proto.Channel.Descriptor.Services[1]; } } public pbd::ServiceDescriptor DescriptorForType { get { return Descriptor; } @@ -5357,6 +6124,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 +6205,5 @@ public override void NotifyUpdateMemberState( #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..fb9f8bd5 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/channel/ChannelOwner.cs @@ -0,0 +1,3865 @@ +// 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( + "Ci5zZXJ2aWNlL2NoYW5uZWwvZGVmaW5pdGlvbi9jaGFubmVsX293bmVyLnBy" + + "b3RvEhVibmV0LnByb3RvY29sLmNoYW5uZWwaHGxpYi9wcm90b2NvbC9hdHRy" + + "aWJ1dGUucHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJvdG8aEWxpYi9y" + + "cGMvcnBjLnByb3RvGi5zZXJ2aWNlL2NoYW5uZWwvZGVmaW5pdGlvbi9jaGFu" + + "bmVsX3R5cGVzLnByb3RvIhUKE0dldENoYW5uZWxJZFJlcXVlc3QiQwoUR2V0" + + "Q2hhbm5lbElkUmVzcG9uc2USKwoKY2hhbm5lbF9pZBgBIAEoCzIXLmJuZXQu" + + "cHJvdG9jb2wuRW50aXR5SWQiuwEKFENyZWF0ZUNoYW5uZWxSZXF1ZXN0Ei8K" + + "DmFnZW50X2lkZW50aXR5GAEgASgLMhcuYm5ldC5wcm90b2NvbC5JZGVudGl0" + + "eRIyCgVzdGF0ZRgCIAEoCzIjLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5DaGFu" + + "bmVsU3RhdGUSKwoKY2hhbm5lbF9pZBgDIAEoCzIXLmJuZXQucHJvdG9jb2wu" + + "RW50aXR5SWQSEQoJb2JqZWN0X2lkGAQgASgEIlcKFUNyZWF0ZUNoYW5uZWxS" + + "ZXNwb25zZRIRCglvYmplY3RfaWQYASACKAQSKwoKY2hhbm5lbF9pZBgCIAEo" + + "CzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQiuQEKEkpvaW5DaGFubmVsUmVx" + + "dWVzdBIvCg5hZ2VudF9pZGVudGl0eRgBIAEoCzIXLmJuZXQucHJvdG9jb2wu" + + "SWRlbnRpdHkSKwoKY2hhbm5lbF9pZBgCIAIoCzIXLmJuZXQucHJvdG9jb2wu" + + "RW50aXR5SWQSEQoJb2JqZWN0X2lkGAMgAigEEjIKEWZyaWVuZF9hY2NvdW50" + + "X2lkGAQgAygLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCKHAQoTSm9pbkNo" + + "YW5uZWxSZXNwb25zZRIRCglvYmplY3RfaWQYASABKAQSKAoZcmVxdWlyZV9m" + + "cmllbmRfdmFsaWRhdGlvbhgCIAEoCDoFZmFsc2USMwoScHJpdmlsZWdlZF9h" + + "Y2NvdW50GAMgAygLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCJOChJGaW5k" + + "Q2hhbm5lbFJlcXVlc3QSOAoGZmlsdGVyGAEgAigLMiguYm5ldC5wcm90b2Nv" + + "bC5hdHRyaWJ1dGUuQXR0cmlidXRlRmlsdGVyIlEKE0ZpbmRDaGFubmVsUmVz" + + "cG9uc2USOgoHY2hhbm5lbBgBIAMoCzIpLmJuZXQucHJvdG9jb2wuY2hhbm5l" + + "bC5DaGFubmVsRGVzY3JpcHRpb24ibwoVR2V0Q2hhbm5lbEluZm9SZXF1ZXN0" + + "EikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIr" + + "CgpjaGFubmVsX2lkGAIgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCJS" + + "ChZHZXRDaGFubmVsSW5mb1Jlc3BvbnNlEjgKDGNoYW5uZWxfaW5mbxgBIAEo" + + "CzIiLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5DaGFubmVsSW5mbzK8BAoMQ2hh" + + "bm5lbE93bmVyEm0KDEdldENoYW5uZWxJZBIqLmJuZXQucHJvdG9jb2wuY2hh" + + "bm5lbC5HZXRDaGFubmVsSWRSZXF1ZXN0GisuYm5ldC5wcm90b2NvbC5jaGFu" + + "bmVsLkdldENoYW5uZWxJZFJlc3BvbnNlIgSAtRgBEnAKDUNyZWF0ZUNoYW5u" + + "ZWwSKy5ibmV0LnByb3RvY29sLmNoYW5uZWwuQ3JlYXRlQ2hhbm5lbFJlcXVl" + + "c3QaLC5ibmV0LnByb3RvY29sLmNoYW5uZWwuQ3JlYXRlQ2hhbm5lbFJlc3Bv" + + "bnNlIgSAtRgCEmoKC0pvaW5DaGFubmVsEikuYm5ldC5wcm90b2NvbC5jaGFu" + + "bmVsLkpvaW5DaGFubmVsUmVxdWVzdBoqLmJuZXQucHJvdG9jb2wuY2hhbm5l" + + "bC5Kb2luQ2hhbm5lbFJlc3BvbnNlIgSAtRgDEmoKC0ZpbmRDaGFubmVsEiku" + + "Ym5ldC5wcm90b2NvbC5jaGFubmVsLkZpbmRDaGFubmVsUmVxdWVzdBoqLmJu" + + "ZXQucHJvdG9jb2wuY2hhbm5lbC5GaW5kQ2hhbm5lbFJlc3BvbnNlIgSAtRgE" + + "EnMKDkdldENoYW5uZWxJbmZvEiwuYm5ldC5wcm90b2NvbC5jaGFubmVsLkdl" + + "dENoYW5uZWxJbmZvUmVxdWVzdBotLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5H" + + "ZXRDaGFubmVsSW5mb1Jlc3BvbnNlIgSAtRgFQgOAAQA="); + 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", "State", "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", "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[] { "Filter", }); + 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", "object_id", "state" }; + private static readonly uint[] _createChannelRequestFieldTags = new uint[] { 10, 26, 32, 18 }; + 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 StateFieldNumber = 2; + 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 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 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::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _createChannelRequestFieldNames; + if (hasAgentIdentity) { + output.WriteMessage(1, field_names[0], AgentIdentity); + } + if (hasState) { + output.WriteMessage(2, field_names[3], State); + } + if (hasChannelId) { + output.WriteMessage(3, field_names[1], ChannelId); + } + if (hasObjectId) { + output.WriteUInt64(4, 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 (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::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.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::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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.ChannelState.Builder subBuilder = global::bnet.protocol.channel.ChannelState.CreateBuilder(); + if (result.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 (result.hasChannelId) { + subBuilder.MergeFrom(ChannelId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ChannelId = subBuilder.BuildPartial(); + break; + } + case 32: { + 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 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; + } + + 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", "object_id" }; + private static readonly uint[] _joinChannelRequestFieldTags = new uint[] { 10, 18, 34, 24 }; + 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 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 const int ObjectIdFieldNumber = 3; + private bool hasObjectId; + private ulong objectId_; + 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::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _joinChannelRequestFieldNames; + if (hasAgentIdentity) { + output.WriteMessage(1, field_names[0], AgentIdentity); + } + if (hasChannelId) { + output.WriteMessage(2, field_names[1], ChannelId); + } + if (hasObjectId) { + output.WriteUInt64(3, field_names[3], ObjectId); + } + if (friendAccountId_.Count > 0) { + output.WriteMessageArray(4, 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 (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::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.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.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasChannelId) { + subBuilder.MergeFrom(ChannelId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ChannelId = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + break; + } + case 34: { + 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 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[] { "filter" }; + private static readonly uint[] _findChannelRequestFieldTags = new uint[] { 10 }; + 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 FilterFieldNumber = 1; + private bool hasFilter; + private global::bnet.protocol.attribute.AttributeFilter filter_; + public bool HasFilter { + get { return hasFilter; } + } + public global::bnet.protocol.attribute.AttributeFilter Filter { + get { return filter_ ?? global::bnet.protocol.attribute.AttributeFilter.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasFilter) return false; + if (!Filter.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _findChannelRequestFieldNames; + if (hasFilter) { + output.WriteMessage(1, field_names[0], 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::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.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(_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.attribute.AttributeFilter.Builder subBuilder = global::bnet.protocol.attribute.AttributeFilter.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 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"); + 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"); + 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 { + result.filter_ = value; + } + result.hasFilter = true; + return this; + } + public Builder ClearFilter() { + PrepareBuilder(); + result.hasFilter = false; + result.filter_ = 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/src/LibMooNet/bnet/protocol/channel/ChannelTypes.cs b/src/LibMooNet/bnet/protocol/channel/ChannelTypes.cs new file mode 100644 index 00000000..05436bc7 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/channel/ChannelTypes.cs @@ -0,0 +1,2851 @@ +// 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_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( + "Ci5zZXJ2aWNlL2NoYW5uZWwvZGVmaW5pdGlvbi9jaGFubmVsX3R5cGVzLnBy" + + "b3RvEhVibmV0LnByb3RvY29sLmNoYW5uZWwaHGxpYi9wcm90b2NvbC9hdHRy" + + "aWJ1dGUucHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJvdG8aHWxpYi9w" + + "cm90b2NvbC9pbnZpdGF0aW9uLnByb3RvIlUKB01lc3NhZ2USNQoJYXR0cmli" + + "dXRlGAEgAygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRl" + + "EgwKBHJvbGUYAiABKA0qBQhkEJFOIpUBChJDaGFubmVsRGVzY3JpcHRpb24S" + + "KwoKY2hhbm5lbF9pZBgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + + "FwoPY3VycmVudF9tZW1iZXJzGAIgASgNEjIKBXN0YXRlGAMgASgLMiMuYm5l" + + "dC5wcm90b2NvbC5jaGFubmVsLkNoYW5uZWxTdGF0ZSoFCGQQkU4igwEKC0No" + + "YW5uZWxJbmZvEj4KC2Rlc2NyaXB0aW9uGAEgAigLMikuYm5ldC5wcm90b2Nv" + + "bC5jaGFubmVsLkNoYW5uZWxEZXNjcmlwdGlvbhItCgZtZW1iZXIYAiADKAsy" + + "HS5ibmV0LnByb3RvY29sLmNoYW5uZWwuTWVtYmVyKgUIZBCRTiKeBAoMQ2hh" + + "bm5lbFN0YXRlEhMKC21heF9tZW1iZXJzGAEgASgNEhMKC21pbl9tZW1iZXJz" + + "GAIgASgNEjUKCWF0dHJpYnV0ZRgDIAMoCzIiLmJuZXQucHJvdG9jb2wuYXR0" + + "cmlidXRlLkF0dHJpYnV0ZRI4CgppbnZpdGF0aW9uGAQgAygLMiQuYm5ldC5w" + + "cm90b2NvbC5pbnZpdGF0aW9uLkludml0YXRpb24SFwoPbWF4X2ludml0YXRp" + + "b25zGAUgASgNEg4KBnJlYXNvbhgGIAEoDRJbCg1wcml2YWN5X2xldmVsGAcg" + + "ASgOMjAuYm5ldC5wcm90b2NvbC5jaGFubmVsLkNoYW5uZWxTdGF0ZS5Qcml2" + + "YWN5TGV2ZWw6ElBSSVZBQ1lfTEVWRUxfT1BFThIOCgZwdWJsaWMYCCABKAgS" + + "DAoEbmFtZRgJIAEoCRIVCg1kZWxlZ2F0ZV9uYW1lGAogASgJEh0KDGNoYW5u" + + "ZWxfdHlwZRgLIAEoCToHZGVmYXVsdCKRAQoMUHJpdmFjeUxldmVsEhYKElBS" + + "SVZBQ1lfTEVWRUxfT1BFThABEiwKKFBSSVZBQ1lfTEVWRUxfT1BFTl9JTlZJ" + + "VEFUSU9OX0FORF9GUklFTkQQAhIhCh1QUklWQUNZX0xFVkVMX09QRU5fSU5W" + + "SVRBVElPThADEhgKFFBSSVZBQ1lfTEVWRUxfQ0xPU0VEEAQqBQhkEJFOInQK" + + "C01lbWJlclN0YXRlEjUKCWF0dHJpYnV0ZRgBIAMoCzIiLmJuZXQucHJvdG9j" + + "b2wuYXR0cmlidXRlLkF0dHJpYnV0ZRIQCgRyb2xlGAIgAygNQgIQARIVCgpw" + + "cml2aWxlZ2VzGAMgASgEOgEwKgUIZBCRTiJmCgZNZW1iZXISKQoIaWRlbnRp" + + "dHkYASACKAsyFy5ibmV0LnByb3RvY29sLklkZW50aXR5EjEKBXN0YXRlGAIg" + + "AigLMiIuYm5ldC5wcm90b2NvbC5jaGFubmVsLk1lbWJlclN0YXRl"); + 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_ChannelState__Descriptor = Descriptor.MessageTypes[3]; + 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[4]; + 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[5]; + 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 + [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 ChannelDescription : pb::ExtendableMessage { + 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; + } + if (!ExtensionsAreInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _channelDescriptionFieldNames; + pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); + 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); + } + 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 (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::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::ExtendableBuilder { + 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.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(_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", "public", "reason" }; + private static readonly uint[] _channelStateFieldTags = new uint[] { 26, 90, 82, 34, 40, 8, 16, 74, 56, 64, 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 PublicFieldNumber = 8; + private bool hasPublic; + private bool public_; + 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::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[10], Reason); + } + if (hasPrivacyLevel) { + output.WriteEnum(7, field_names[8], (int) PrivacyLevel, PrivacyLevel); + } + if (hasPublic) { + output.WriteBool(8, field_names[9], Public); + } + if (hasName) { + output.WriteString(9, field_names[7], Name); + } + if (hasDelegateName) { + output.WriteString(10, field_names[2], DelegateName); + } + if (hasChannelType) { + output.WriteString(11, 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 (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::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.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::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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 64: { + result.hasPublic = input.ReadBool(ref result.public_); + break; + } + case 74: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 82: { + result.hasDelegateName = input.ReadString(ref result.delegateName_); + break; + } + case 90: { + 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 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 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", "privileges", "role" }; + private static readonly uint[] _memberStateFieldTags = new uint[] { 10, 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 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[2], roleMemoizedSerializedSize, role_); + } + if (hasPrivileges) { + output.WriteUInt64(3, field_names[1], Privileges); + } + 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); + } + 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; + } + 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; + } + } + } + + 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; + } + } + 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/ChannelInvitation.cs similarity index 71% rename from source/D3Proto/bnet/protocol/channel_invitation/ChannelInvitation.cs rename to src/LibMooNet/bnet/protocol/channel_invitation/ChannelInvitation.cs index 3455765c..01e773fb 100644 --- a/source/D3Proto/bnet/protocol/channel_invitation/ChannelInvitation.cs +++ b/src/LibMooNet/bnet/protocol/channel_invitation/ChannelInvitation.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.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 ChannelInvitation { #region Extension registration @@ -48,64 +53,66 @@ static ChannelInvitation() { "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=="); + "dmljZS9jaGFubmVsL2RlZmluaXRpb24vY2hhbm5lbC5wcm90bxpEc2Vydmlj" + + "ZS9jaGFubmVsX2ludml0YXRpb24vZGVmaW5pdGlvbi9jaGFubmVsX2ludml0" + + "YXRpb25fdHlwZXMucHJvdG8ibgoXQWNjZXB0SW52aXRhdGlvblJlcXVlc3QS" + + "KQoIYWdlbnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhUK" + + "DWludml0YXRpb25faWQYAiACKAYSEQoJb2JqZWN0X2lkGAMgAigEIi0KGEFj" + + "Y2VwdEludml0YXRpb25SZXNwb25zZRIRCglvYmplY3RfaWQYASACKAQiUAoQ" + + "U3Vic2NyaWJlUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJv" + + "dG9jb2wuRW50aXR5SWQSEQoJb2JqZWN0X2lkGAIgAigEIqIBChFTdWJzY3Jp" + + "YmVSZXNwb25zZRJKCgpjb2xsZWN0aW9uGAEgAygLMjYuYm5ldC5wcm90b2Nv" + + "bC5jaGFubmVsX2ludml0YXRpb24uSW52aXRhdGlvbkNvbGxlY3Rpb24SQQoT" + + "cmVjZWl2ZWRfaW52aXRhdGlvbhgCIAMoCzIkLmJuZXQucHJvdG9jb2wuaW52" + + "aXRhdGlvbi5JbnZpdGF0aW9uIj8KElVuc3Vic2NyaWJlUmVxdWVzdBIpCghh" + + "Z2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQizAEKGFN1" + + "Z2dlc3RJbnZpdGF0aW9uUmVxdWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJu" + + "ZXQucHJvdG9jb2wuRW50aXR5SWQSKwoKY2hhbm5lbF9pZBgCIAIoCzIXLmJu" + + "ZXQucHJvdG9jb2wuRW50aXR5SWQSKgoJdGFyZ2V0X2lkGAMgAigLMhcuYm5l" + + "dC5wcm90b2NvbC5FbnRpdHlJZBIsCgthcHByb3ZhbF9pZBgEIAEoCzIXLmJu" + + "ZXQucHJvdG9jb2wuRW50aXR5SWQitAEKF1Jldm9rZUludml0YXRpb25SZXF1" + + "ZXN0EikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJ" + + "ZBIqCgl0YXJnZXRfaWQYAiABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlk" + + "EhUKDWludml0YXRpb25faWQYAyACKAYSKwoKY2hhbm5lbF9pZBgEIAIoCzIX" + + "LmJuZXQucHJvdG9jb2wuRW50aXR5SWQiMwobSGFzUm9vbUZvckludml0YXRp" + + "b25SZXF1ZXN0EhQKDHNlcnZpY2VfdHlwZRgBIAIoDSJXChtJbnZpdGF0aW9u" + + "QWRkZWROb3RpZmljYXRpb24SOAoKaW52aXRhdGlvbhgBIAIoCzIkLmJuZXQu" + + "cHJvdG9jb2wuaW52aXRhdGlvbi5JbnZpdGF0aW9uImkKHUludml0YXRpb25S" + + "ZW1vdmVkTm90aWZpY2F0aW9uEjgKCmludml0YXRpb24YASACKAsyJC5ibmV0" + + "LnByb3RvY29sLmludml0YXRpb24uSW52aXRhdGlvbhIOCgZyZWFzb24YAiAB" + + "KA0iVwobU3VnZ2VzdGlvbkFkZGVkTm90aWZpY2F0aW9uEjgKCnN1Z2dlc3Rp" + + "b24YASACKAsyJC5ibmV0LnByb3RvY29sLmludml0YXRpb24uU3VnZ2VzdGlv" + + "bjK7BgoYQ2hhbm5lbEludml0YXRpb25TZXJ2aWNlEnoKCVN1YnNjcmliZRIy" + + "LmJuZXQucHJvdG9jb2wuY2hhbm5lbF9pbnZpdGF0aW9uLlN1YnNjcmliZVJl" + + "cXVlc3QaMy5ibmV0LnByb3RvY29sLmNoYW5uZWxfaW52aXRhdGlvbi5TdWJz" + + "Y3JpYmVSZXNwb25zZSIEgLUYARJgCgtVbnN1YnNjcmliZRI0LmJuZXQucHJv" + + "dG9jb2wuY2hhbm5lbF9pbnZpdGF0aW9uLlVuc3Vic2NyaWJlUmVxdWVzdBoV" + + "LmJuZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgCEnkKDlNlbmRJbnZpdGF0aW9u" + + "Ei8uYm5ldC5wcm90b2NvbC5pbnZpdGF0aW9uLlNlbmRJbnZpdGF0aW9uUmVx" + + "dWVzdBowLmJuZXQucHJvdG9jb2wuaW52aXRhdGlvbi5TZW5kSW52aXRhdGlv" + + "blJlc3BvbnNlIgSAtRgDEo8BChBBY2NlcHRJbnZpdGF0aW9uEjkuYm5ldC5w" + + "cm90b2NvbC5jaGFubmVsX2ludml0YXRpb24uQWNjZXB0SW52aXRhdGlvblJl" + + "cXVlc3QaOi5ibmV0LnByb3RvY29sLmNoYW5uZWxfaW52aXRhdGlvbi5BY2Nl" + + "cHRJbnZpdGF0aW9uUmVzcG9uc2UiBIC1GAQSWgoRRGVjbGluZUludml0YXRp" + + "b24SKC5ibmV0LnByb3RvY29sLmludml0YXRpb24uR2VuZXJpY1JlcXVlc3Qa" + + "FS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYBRJqChBSZXZva2VJbnZpdGF0" + + "aW9uEjkuYm5ldC5wcm90b2NvbC5jaGFubmVsX2ludml0YXRpb24uUmV2b2tl" + + "SW52aXRhdGlvblJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUY" + + "BhJsChFTdWdnZXN0SW52aXRhdGlvbhI6LmJuZXQucHJvdG9jb2wuY2hhbm5l" + + "bF9pbnZpdGF0aW9uLlN1Z2dlc3RJbnZpdGF0aW9uUmVxdWVzdBoVLmJuZXQu" + + "cHJvdG9jb2wuTm9EYXRhIgSAtRgHMpoEChdDaGFubmVsSW52aXRhdGlvbk5v" + + "dGlmeRKAAQodTm90aWZ5UmVjZWl2ZWRJbnZpdGF0aW9uQWRkZWQSPS5ibmV0" + + "LnByb3RvY29sLmNoYW5uZWxfaW52aXRhdGlvbi5JbnZpdGF0aW9uQWRkZWRO" + + "b3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgB" + + "EoQBCh9Ob3RpZnlSZWNlaXZlZEludml0YXRpb25SZW1vdmVkEj8uYm5ldC5w" + + "cm90b2NvbC5jaGFubmVsX2ludml0YXRpb24uSW52aXRhdGlvblJlbW92ZWRO" + + "b3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgC" + + "EoABCh1Ob3RpZnlSZWNlaXZlZFN1Z2dlc3Rpb25BZGRlZBI9LmJuZXQucHJv" + + "dG9jb2wuY2hhbm5lbF9pbnZpdGF0aW9uLlN1Z2dlc3Rpb25BZGRlZE5vdGlm" + + "aWNhdGlvbhoaLmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAMScgoU" + + "SGFzUm9vbUZvckludml0YXRpb24SPS5ibmV0LnByb3RvY29sLmNoYW5uZWxf" + + "aW52aXRhdGlvbi5IYXNSb29tRm9ySW52aXRhdGlvblJlcXVlc3QaFS5ibmV0" + + "LnByb3RvY29sLk5vRGF0YSIEgLUYBEIDgAEA"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_channel_invitation_AcceptInvitationRequest__Descriptor = Descriptor.MessageTypes[0]; @@ -152,7 +159,14 @@ static ChannelInvitation() { 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; + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.invitation.Proto.Invitation.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + global::bnet.protocol.channel.Proto.Channel.RegisterAllExtensions(registry); + global::bnet.protocol.channel_invitation.ChannelInvitationTypes.RegisterAllExtensions(registry); + return registry; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { @@ -167,14 +181,20 @@ static ChannelInvitation() { } #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", "object_id" }; + private static readonly uint[] _acceptInvitationRequestFieldTags = new uint[] { 10, 17, 24 }; public static AcceptInvitationRequest DefaultInstance { get { return defaultInstance; } } public override AcceptInvitationRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override AcceptInvitationRequest ThisMessage { @@ -191,17 +211,17 @@ protected override AcceptInvitationRequest ThisMessage { 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; private bool hasInvitationId; - private ulong invitationId_ = 0; + private ulong invitationId_; public bool HasInvitationId { get { return hasInvitationId; } } @@ -211,7 +231,7 @@ public ulong InvitationId { public const int ObjectIdFieldNumber = 3; private bool hasObjectId; - private ulong objectId_ = 0UL; + private ulong objectId_; public bool HasObjectId { get { return hasObjectId; } } @@ -230,16 +250,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 = _acceptInvitationRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasInvitationId) { - output.WriteFixed64(2, InvitationId); + if (hasInvitationId) { + output.WriteFixed64(2, field_names[1], InvitationId); } - if (HasObjectId) { - output.WriteUInt64(3, ObjectId); + if (hasObjectId) { + output.WriteUInt64(3, field_names[2], ObjectId); } UnknownFields.WriteTo(output); } @@ -251,13 +272,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasInvitationId) { + if (hasInvitationId) { size += pb::CodedOutputStream.ComputeFixed64Size(2, InvitationId); } - if (HasObjectId) { + if (hasObjectId) { size += pb::CodedOutputStream.ComputeUInt64Size(3, ObjectId); } size += UnknownFields.SerializedSize; @@ -290,38 +311,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 +388,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,6 +406,7 @@ 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); } @@ -365,20 +420,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,12 +456,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); @@ -403,20 +469,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 17: { - InvitationId = input.ReadFixed64(); + result.hasInvitationId = input.ReadFixed64(ref result.invitationId_); break; } case 24: { - 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; } @@ -424,19 +495,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,42 +520,47 @@ 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 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; @@ -492,14 +571,20 @@ static AcceptInvitationRequest() { } } + [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 { @@ -516,7 +601,7 @@ protected override AcceptInvitationResponse ThisMessage { public const int ObjectIdFieldNumber = 1; private bool hasObjectId; - private ulong objectId_ = 0UL; + private ulong objectId_; public bool HasObjectId { get { return hasObjectId; } } @@ -531,10 +616,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 +632,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 +665,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 +742,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 +760,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 +768,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,31 +804,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; } 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; @@ -708,14 +846,20 @@ static AcceptInvitationResponse() { } } + [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 { @@ -732,17 +876,17 @@ protected override SubscribeRequest ThisMessage { 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 +904,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 +923,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 +959,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 +1036,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 +1054,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 +1065,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 +1101,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 +1114,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 +1136,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,24 +1161,27 @@ 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; @@ -991,14 +1192,20 @@ static SubscribeRequest() { } } + [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 { @@ -1049,13 +1256,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 +1311,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 +1390,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 +1408,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 +1455,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 +1487,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,29 +1531,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; } @@ -1303,14 +1569,20 @@ static SubscribeResponse() { } } + [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 { @@ -1327,12 +1599,12 @@ protected override UnsubscribeRequest ThisMessage { 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 +1616,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 +1632,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 +1665,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 { @@ -1435,12 +1742,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 +1760,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 +1768,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 +1804,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 +1818,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 +1835,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,8 +1860,9 @@ 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; } } @@ -1544,14 +1871,20 @@ static UnsubscribeRequest() { } } + [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", "approval_id", "channel_id", "target_id" }; + private static readonly uint[] _suggestInvitationRequestFieldTags = new uint[] { 10, 34, 18, 26 }; public static SuggestInvitationRequest DefaultInstance { get { return defaultInstance; } } public override SuggestInvitationRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SuggestInvitationRequest ThisMessage { @@ -1568,42 +1901,42 @@ protected override SuggestInvitationRequest ThisMessage { 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 override bool IsInitialized { @@ -1622,19 +1955,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 = _suggestInvitationRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasChannelId) { - output.WriteMessage(2, ChannelId); + if (hasChannelId) { + output.WriteMessage(2, field_names[2], ChannelId); } - if (HasTargetId) { - output.WriteMessage(3, TargetId); + if (hasTargetId) { + output.WriteMessage(3, field_names[3], TargetId); } - if (HasApprovalId) { - output.WriteMessage(4, ApprovalId); + if (hasApprovalId) { + output.WriteMessage(4, field_names[1], ApprovalId); } UnknownFields.WriteTo(output); } @@ -1646,16 +1980,16 @@ 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); } size += UnknownFields.SerializedSize; @@ -1688,38 +2022,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 +2099,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 +2117,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); } @@ -1766,20 +2134,31 @@ public override Builder MergeFrom(SuggestInvitationRequest 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(_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 +2170,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 +2184,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 +2193,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,7 +2202,7 @@ 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); @@ -1832,11 +2211,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; } @@ -1844,19 +2228,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 +2253,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 +2268,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 +2293,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 +2308,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 +2333,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 +2348,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,8 +2373,9 @@ 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; } } @@ -1984,14 +2384,20 @@ static SuggestInvitationRequest() { } } + [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 { @@ -2008,27 +2414,27 @@ protected override RevokeInvitationRequest ThisMessage { 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 +2444,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 +2467,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 +2492,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 +2534,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; + } - RevokeInvitationRequest result = new RevokeInvitationRequest(); + private bool resultIsReadOnly; + private RevokeInvitationRequest result; + + private RevokeInvitationRequest PrepareBuilder() { + if (resultIsReadOnly) { + RevokeInvitationRequest original = result; + result = new RevokeInvitationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +2611,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 +2629,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 +2646,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 +2682,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 +2696,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 +2704,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 +2718,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 +2735,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 +2760,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 +2775,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 +2800,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 +2835,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,8 +2860,9 @@ 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; } } @@ -2400,14 +2871,20 @@ static RevokeInvitationRequest() { } } + [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 { @@ -2424,7 +2901,7 @@ protected override HasRoomForInvitationRequest ThisMessage { public const int ServiceTypeFieldNumber = 1; private bool hasServiceType; - private uint serviceType_ = 0; + private uint serviceType_; public bool HasServiceType { get { return hasServiceType; } } @@ -2439,10 +2916,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 +2932,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 +2965,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; + } - HasRoomForInvitationRequest result = new HasRoomForInvitationRequest(); + private bool resultIsReadOnly; + private HasRoomForInvitationRequest result; + + 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 +3042,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 +3060,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 +3068,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,31 +3104,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; } 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; @@ -2616,14 +3146,20 @@ static HasRoomForInvitationRequest() { } } + [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 { @@ -2640,12 +3176,12 @@ protected override InvitationAddedNotification ThisMessage { 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 +3192,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 +3208,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 +3241,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 +3318,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 +3336,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 +3344,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 +3380,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 +3394,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 +3411,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,8 +3436,9 @@ 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; } } @@ -2856,14 +3447,20 @@ static InvitationAddedNotification() { } } + [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 { @@ -2880,17 +3477,17 @@ protected override InvitationRemovedNotification ThisMessage { 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 +3503,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 +3522,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 +3558,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 +3635,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 +3653,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 +3664,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 +3700,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 +3713,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 +3735,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,24 +3760,27 @@ 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; @@ -3137,14 +3791,20 @@ static InvitationRemovedNotification() { } } + [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 { @@ -3161,12 +3821,12 @@ protected override SuggestionAddedNotification ThisMessage { 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 +3837,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 +3853,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 +3886,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 +3963,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 +3981,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 +3989,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 +4025,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 +4039,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 +4056,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,8 +4081,9 @@ 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; } } @@ -3380,6 +4095,9 @@ static SuggestionAddedNotification() { #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, @@ -3521,6 +4239,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 +4317,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, @@ -3698,6 +4422,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 +4476,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 69% rename from source/D3Proto/bnet/protocol/channel_invitation/ChannelInvitationTypes.cs rename to src/LibMooNet/bnet/protocol/channel_invitation/ChannelInvitationTypes.cs index 66c6dcfd..b9b4194b 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,6 +8,9 @@ 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 @@ -30,26 +35,27 @@ 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=="); + "CkRzZXJ2aWNlL2NoYW5uZWxfaW52aXRhdGlvbi9kZWZpbml0aW9uL2NoYW5u" + + "ZWxfaW52aXRhdGlvbl90eXBlcy5wcm90bxIgYm5ldC5wcm90b2NvbC5jaGFu" + + "bmVsX2ludml0YXRpb24aHWxpYi9wcm90b2NvbC9pbnZpdGF0aW9uLnByb3Rv" + + "GhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3RvGi5zZXJ2aWNlL2NoYW5uZWwv" + + "ZGVmaW5pdGlvbi9jaGFubmVsX3R5cGVzLnByb3RvIooCCgpJbnZpdGF0aW9u" + + "EkYKE2NoYW5uZWxfZGVzY3JpcHRpb24YASACKAsyKS5ibmV0LnByb3RvY29s" + + "LmNoYW5uZWwuQ2hhbm5lbERlc2NyaXB0aW9uEhcKCHJlc2VydmVkGAIgASgI" + + "OgVmYWxzZRIVCgZyZWpvaW4YAyABKAg6BWZhbHNlEhQKDHNlcnZpY2VfdHlw" + + "ZRgEIAIoDTJuChJjaGFubmVsX2ludml0YXRpb24SJC5ibmV0LnByb3RvY29s" + + "Lmludml0YXRpb24uSW52aXRhdGlvbhhpIAEoCzIsLmJuZXQucHJvdG9jb2wu" + + "Y2hhbm5lbF9pbnZpdGF0aW9uLkludml0YXRpb24igwIKFVNlbmRJbnZpdGF0" + + "aW9uUmVxdWVzdBIrCgpjaGFubmVsX2lkGAEgAigLMhcuYm5ldC5wcm90b2Nv" + + "bC5FbnRpdHlJZBIQCghyZXNlcnZlZBgCIAEoCBIOCgZyZWpvaW4YAyABKAgS" + + "FAoMc2VydmljZV90eXBlGAQgAigNMoQBChJjaGFubmVsX2ludml0YXRpb24S" + + "Ly5ibmV0LnByb3RvY29sLmludml0YXRpb24uU2VuZEludml0YXRpb25SZXF1" + + "ZXN0GGkgASgLMjcuYm5ldC5wcm90b2NvbC5jaGFubmVsX2ludml0YXRpb24u" + + "U2VuZEludml0YXRpb25SZXF1ZXN0IqQBChRJbnZpdGF0aW9uQ29sbGVjdGlv" + + "bhIUCgxzZXJ2aWNlX3R5cGUYASABKA0SIAoYbWF4X3JlY2VpdmVkX2ludml0" + + "YXRpb25zGAIgASgNEhEKCW9iamVjdF9pZBgDIAEoBBJBChNyZWNlaXZlZF9p" + + "bnZpdGF0aW9uGAQgAygLMiQuYm5ldC5wcm90b2NvbC5pbnZpdGF0aW9uLklu" + + "dml0YXRpb24="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_channel_invitation_Invitation__Descriptor = Descriptor.MessageTypes[0]; @@ -79,14 +85,20 @@ static ChannelInvitationTypes() { } #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::GeneratedMessage { - private static readonly Invitation defaultInstance = new Builder().BuildPartial(); + private Invitation() { } + private static readonly Invitation defaultInstance = new Invitation().MakeReadOnly(); + private static readonly string[] _invitationFieldNames = new string[] { "channel_description", "rejoin", "reserved", "service_type" }; + private static readonly uint[] _invitationFieldTags = new uint[] { 10, 24, 16, 32 }; public static Invitation DefaultInstance { get { return defaultInstance; } } public override Invitation DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Invitation ThisMessage { @@ -105,17 +117,17 @@ protected override Invitation ThisMessage { public static pb::GeneratedExtensionBase ChannelInvitation; 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 +137,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 +147,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 +158,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 = _invitationFieldNames; + 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 +189,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; @@ -217,38 +231,72 @@ public static Invitation ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Invitation ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Invitation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(Invitation cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - Invitation result = new Invitation(); + 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 result; } + 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 { @@ -260,12 +308,11 @@ public override Invitation DefaultInstanceForType { } public override Invitation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Invitation returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -279,6 +326,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Invitation other) { if (other == global::bnet.protocol.channel_invitation.Invitation.DefaultInstance) return this; + PrepareBuilder(); if (other.HasChannelDescription) { MergeChannelDescription(other.ChannelDescription); } @@ -295,20 +343,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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -320,12 +379,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 +392,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 +422,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,60 +447,67 @@ 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; @@ -444,14 +518,20 @@ static Invitation() { } } + [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 static readonly SendInvitationRequest defaultInstance = new Builder().BuildPartial(); + private SendInvitationRequest() { } + private static readonly SendInvitationRequest defaultInstance = new SendInvitationRequest().MakeReadOnly(); + private static readonly string[] _sendInvitationRequestFieldNames = new string[] { "channel_id", "rejoin", "reserved", "service_type" }; + private static readonly uint[] _sendInvitationRequestFieldTags = new uint[] { 10, 24, 16, 32 }; public static SendInvitationRequest DefaultInstance { get { return defaultInstance; } } public override SendInvitationRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SendInvitationRequest ThisMessage { @@ -470,17 +550,17 @@ protected override SendInvitationRequest ThisMessage { public static pb::GeneratedExtensionBase ChannelInvitation; 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 +570,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 +580,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 +590,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 = _sendInvitationRequestFieldNames; + 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 +622,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; @@ -583,38 +664,72 @@ public static SendInvitationRequest ParseDelimitedFrom(global::System.IO.Stream 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) { + public static SendInvitationRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - SendInvitationRequest result = new SendInvitationRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SendInvitationRequest MessageBeingBuilt { - get { return result; } + 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 { @@ -626,12 +741,11 @@ public override SendInvitationRequest DefaultInstanceForType { } public override SendInvitationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SendInvitationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -645,6 +759,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SendInvitationRequest other) { if (other == global::bnet.protocol.channel_invitation.SendInvitationRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasChannelId) { MergeChannelId(other.ChannelId); } @@ -661,20 +776,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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -686,12 +812,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 +825,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 +855,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,60 +880,67 @@ 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; @@ -810,14 +951,20 @@ static SendInvitationRequest() { } } + [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 +981,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 +991,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 +1001,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 +1030,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 +1055,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 +1097,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 +1175,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 +1193,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 +1204,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 +1246,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 +1346,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 +1387,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 67% rename from source/D3Proto/bnet/protocol/chat/ChatTypes.cs rename to src/LibMooNet/bnet/protocol/chat/ChatTypes.cs index 96e507e9..286ca5dd 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 @@ -26,11 +31,11 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static ChatTypes() { byte[] descriptorData = global::System.Convert.FromBase64String( "CihzZXJ2aWNlL2NoYXQvZGVmaW5pdGlvbi9jaGF0X3R5cGVzLnByb3RvEhJi" + - "bmV0LnByb3RvY29sLmNoYXQaI3NlcnZpY2UvY2hhbm5lbC9jaGFubmVsX3R5" + - "cGVzLnByb3RvIpYBCgxDaGFubmVsU3RhdGUSEAoIaWRlbnRpdHkYASABKAkS" + - "DwoHcHJvZ3JhbRgCIAEoBxIOCgZsb2NhbGUYAyABKAcyUwoEY2hhdBIjLmJu" + - "ZXQucHJvdG9jb2wuY2hhbm5lbC5DaGFubmVsU3RhdGUYZCABKAsyIC5ibmV0" + - "LnByb3RvY29sLmNoYXQuQ2hhbm5lbFN0YXRl"); + "bmV0LnByb3RvY29sLmNoYXQaLnNlcnZpY2UvY2hhbm5lbC9kZWZpbml0aW9u" + + "L2NoYW5uZWxfdHlwZXMucHJvdG8ilgEKDENoYW5uZWxTdGF0ZRIQCghpZGVu" + + "dGl0eRgBIAEoCRIPCgdwcm9ncmFtGAIgASgHEg4KBmxvY2FsZRgDIAEoBzJT" + + "CgRjaGF0EiMuYm5ldC5wcm90b2NvbC5jaGFubmVsLkNoYW5uZWxTdGF0ZRhk" + + "IAEoCzIgLmJuZXQucHJvdG9jb2wuY2hhdC5DaGFubmVsU3RhdGU="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_chat_ChannelState__Descriptor = Descriptor.MessageTypes[0]; @@ -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[] { "identity", "locale", "program" }; + private static readonly uint[] _channelStateFieldTags = new uint[] { 10, 29, 21 }; 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; } } @@ -109,16 +120,17 @@ public override bool IsInitialized { } } - 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[0], Identity); } - if (HasProgram) { - output.WriteFixed32(2, Program); + if (hasProgram) { + output.WriteFixed32(2, field_names[2], Program); } - if (HasLocale) { - output.WriteFixed32(3, Locale); + if (hasLocale) { + output.WriteFixed32(3, field_names[1], Locale); } UnknownFields.WriteTo(output); } @@ -130,13 +142,13 @@ 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); } size += UnknownFields.SerializedSize; @@ -169,38 +181,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 +258,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 +276,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; } @@ -244,20 +290,31 @@ public override Builder MergeFrom(ChannelState 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(_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 +326,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: { - 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; } } } + + 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,47 +360,53 @@ 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; @@ -352,3 +420,5 @@ static ChannelState() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/config/ProcessConfig.cs b/src/LibMooNet/bnet/protocol/config/ProcessConfig.cs similarity index 67% rename from source/D3Proto/bnet/protocol/config/ProcessConfig.cs rename to src/LibMooNet/bnet/protocol/config/ProcessConfig.cs index 70652ea1..25a14cb8 100644 --- a/source/D3Proto/bnet/protocol/config/ProcessConfig.cs +++ b/src/LibMooNet/bnet/protocol/config/ProcessConfig.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.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 ProcessConfig { #region Extension registration @@ -65,14 +70,16 @@ static ProcessConfig() { "LlNlcnZpY2VTaGFyZCKEAQoPUlBDU2VydmVyQ29uZmlnEgwKBG5hbWUYASAC" + "KAkSMQoGbGlzdGVuGAIgASgLMiEuYm5ldC5wcm90b2NvbC5jb25maWcuTGlz" + "dGVuUG9pbnQSMAoHY29ubmVjdBgDIAMoCzIfLmJuZXQucHJvdG9jb2wuY29u" + - "ZmlnLlNlcnZlclNldCK1AgoNUHJvY2Vzc0NvbmZpZxIUCgxwcm9jZXNzX25h" + - "bWUYASACKAkSNQoGc2VydmVyGAIgAygLMiUuYm5ldC5wcm90b2NvbC5jb25m" + - "aWcuUlBDU2VydmVyQ29uZmlnEjAKCHJlc291cmNlGAMgAygLMh4uYm5ldC5w" + - "cm90b2NvbC5jb25maWcuUmVzb3VyY2USNAoHc2VydmljZRgEIAMoCzIjLmJu" + - "ZXQucHJvdG9jb2wuY29uZmlnLlNlcnZpY2VDb25maWcSJgoDdmFyGAUgAygL" + - "MhkuYm5ldC5wcm90b2NvbC5jb25maWcuVmFyEkcKFHN1cHBsZW1lbnRhbF9z" + - "ZXJ2aWNlGAYgAygLMikuYm5ldC5wcm90b2NvbC5jb25maWcuU3VwcGxlbWVu" + - "dGFsU2VydmljZUIQQg5DUHJvY2Vzc0NvbmZpZw=="); + "ZmlnLlNlcnZlclNldCKWAwoNUHJvY2Vzc0NvbmZpZxIUCgxwcm9jZXNzX25h" + + "bWUYASACKAkSLQohY3B1X2FmZmluaXR5X21haW5fZXZlbnRfcHJvY2Vzc29y" + + "GAcgAygNQgIQARIwCiRjcHVfYWZmaW5pdHlfbmV0d29ya19ldmVudF9wcm9j" + + "ZXNzb3IYCCADKA1CAhABEjUKBnNlcnZlchgCIAMoCzIlLmJuZXQucHJvdG9j" + + "b2wuY29uZmlnLlJQQ1NlcnZlckNvbmZpZxIwCghyZXNvdXJjZRgDIAMoCzIe" + + "LmJuZXQucHJvdG9jb2wuY29uZmlnLlJlc291cmNlEjQKB3NlcnZpY2UYBCAD" + + "KAsyIy5ibmV0LnByb3RvY29sLmNvbmZpZy5TZXJ2aWNlQ29uZmlnEiYKA3Zh" + + "chgFIAMoCzIZLmJuZXQucHJvdG9jb2wuY29uZmlnLlZhchJHChRzdXBwbGVt" + + "ZW50YWxfc2VydmljZRgGIAMoCzIpLmJuZXQucHJvdG9jb2wuY29uZmlnLlN1" + + "cHBsZW1lbnRhbFNlcnZpY2U="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_config_Var__Descriptor = Descriptor.MessageTypes[0]; @@ -118,7 +125,7 @@ static ProcessConfig() { 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", }); + new string[] { "ProcessName", "CpuAffinityMainEventProcessor", "CpuAffinityNetworkEventProcessor", "Server", "Resource", "Service", "Var", "SupplementalService", }); return null; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, @@ -131,14 +138,20 @@ static ProcessConfig() { } } #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 Var : pb::GeneratedMessage { - private static readonly Var defaultInstance = new Builder().BuildPartial(); + private Var() { } + private static readonly Var defaultInstance = new Var().MakeReadOnly(); + private static readonly string[] _varFieldNames = new string[] { "name", "value" }; + private static readonly uint[] _varFieldTags = new uint[] { 10, 18 }; public static Var DefaultInstance { get { return defaultInstance; } } public override Var DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Var ThisMessage { @@ -181,13 +194,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 = _varFieldNames; + if (hasName) { + output.WriteString(1, field_names[0], Name); } - if (HasValue) { - output.WriteString(2, Value); + if (hasValue) { + output.WriteString(2, field_names[1], Value); } UnknownFields.WriteTo(output); } @@ -199,10 +213,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.ComputeStringSize(2, Value); } size += UnknownFields.SerializedSize; @@ -235,38 +249,72 @@ public static Var ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Var ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Var ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Var ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Var MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(Var cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - Var result = new Var(); + private bool resultIsReadOnly; + private Var result; + + private Var PrepareBuilder() { + if (resultIsReadOnly) { + Var original = result; + result = new Var(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Var MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Var(); + 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 { @@ -278,12 +326,11 @@ public override Var DefaultInstanceForType { } public override Var BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Var returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -297,6 +344,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Var other) { if (other == global::bnet.protocol.config.Var.DefaultInstance) return this; + PrepareBuilder(); if (other.HasName) { Name = other.Name; } @@ -307,20 +355,31 @@ public override Builder MergeFrom(Var 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(_varFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _varFieldTags[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)) { @@ -332,24 +391,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: { - Value = input.ReadString(); + result.hasValue = input.ReadString(ref result.value_); 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; } @@ -357,18 +421,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 string Value { get { return result.Value; } @@ -376,11 +442,13 @@ public string 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; @@ -391,14 +459,20 @@ static Var() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Resource : pb::GeneratedMessage { - private static readonly Resource defaultInstance = new Builder().BuildPartial(); + private Resource() { } + private static readonly Resource defaultInstance = new Resource().MakeReadOnly(); + private static readonly string[] _resourceFieldNames = new string[] { "name", "url" }; + private static readonly uint[] _resourceFieldTags = new uint[] { 10, 18 }; public static Resource DefaultInstance { get { return defaultInstance; } } public override Resource DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Resource ThisMessage { @@ -441,13 +515,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 = _resourceFieldNames; + 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); } @@ -459,10 +534,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; @@ -495,38 +570,72 @@ public static Resource ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Resource ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Resource ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Resource ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Resource MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(Resource cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Resource result; - Resource result = new Resource(); + private Resource PrepareBuilder() { + if (resultIsReadOnly) { + Resource original = result; + result = new Resource(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Resource MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Resource(); + 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 { @@ -538,12 +647,11 @@ public override Resource DefaultInstanceForType { } public override Resource BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Resource returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -557,6 +665,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Resource other) { if (other == global::bnet.protocol.config.Resource.DefaultInstance) return this; + PrepareBuilder(); if (other.HasName) { Name = other.Name; } @@ -567,20 +676,31 @@ public override Builder MergeFrom(Resource 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(_resourceFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _resourceFieldTags[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)) { @@ -592,24 +712,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; } @@ -617,18 +742,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; } @@ -636,11 +763,13 @@ 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; @@ -651,14 +780,20 @@ static Resource() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ProgramResources : pb::GeneratedMessage { - private static readonly ProgramResources defaultInstance = new Builder().BuildPartial(); + private ProgramResources() { } + private static readonly ProgramResources defaultInstance = new ProgramResources().MakeReadOnly(); + private static readonly string[] _programResourcesFieldNames = new string[] { "program" }; + private static readonly uint[] _programResourcesFieldTags = new uint[] { 10 }; public static ProgramResources DefaultInstance { get { return defaultInstance; } } public override ProgramResources DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ProgramResources ThisMessage { @@ -694,10 +829,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.config.Resource element in ProgramList) { - output.WriteMessage(1, element); + string[] field_names = _programResourcesFieldNames; + if (program_.Count > 0) { + output.WriteMessageArray(1, field_names[0], program_); } UnknownFields.WriteTo(output); } @@ -742,38 +878,73 @@ public static ProgramResources ParseDelimitedFrom(global::System.IO.Stream input 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) { + public static ProgramResources ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ProgramResources ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ProgramResources ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ProgramResources MakeReadOnly() { + program_.MakeReadOnly(); + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(ProgramResources cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ProgramResources result = new ProgramResources(); + private bool resultIsReadOnly; + private ProgramResources result; + + private ProgramResources PrepareBuilder() { + if (resultIsReadOnly) { + ProgramResources original = result; + result = new ProgramResources(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ProgramResources MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ProgramResources(); + 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 { @@ -785,13 +956,11 @@ public override ProgramResources DefaultInstanceForType { } public override ProgramResources BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.program_.MakeReadOnly(); - ProgramResources returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -805,27 +974,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ProgramResources other) { if (other == global::bnet.protocol.config.ProgramResources.DefaultInstance) return this; + PrepareBuilder(); if (other.program_.Count != 0) { - base.AddRange(other.program_, result.program_); + result.program_.Add(other.program_); } 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(_programResourcesFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _programResourcesFieldTags[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)) { @@ -837,22 +1018,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.config.Resource.Builder subBuilder = global::bnet.protocol.config.Resource.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddProgram(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.program_, global::bnet.protocol.config.Resource.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList ProgramList { - get { return result.program_; } + get { return PrepareBuilder().program_; } } public int ProgramCount { get { return result.ProgramCount; } @@ -862,29 +1046,35 @@ public int ProgramCount { } public Builder SetProgram(int index, global::bnet.protocol.config.Resource value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.program_[index] = value; return this; } public Builder SetProgram(int index, global::bnet.protocol.config.Resource.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.program_[index] = builderForValue.Build(); return this; } public Builder AddProgram(global::bnet.protocol.config.Resource value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.program_.Add(value); return this; } public Builder AddProgram(global::bnet.protocol.config.Resource.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.program_.Add(builderForValue.Build()); return this; } public Builder AddRangeProgram(scg::IEnumerable values) { - base.AddRange(values, result.program_); + PrepareBuilder(); + result.program_.Add(values); return this; } public Builder ClearProgram() { + PrepareBuilder(); result.program_.Clear(); return this; } @@ -894,14 +1084,20 @@ static ProgramResources() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ServerAddress : pb::GeneratedMessage { - private static readonly ServerAddress defaultInstance = new Builder().BuildPartial(); + private ServerAddress() { } + private static readonly ServerAddress defaultInstance = new ServerAddress().MakeReadOnly(); + private static readonly string[] _serverAddressFieldNames = new string[] { "address", "process_name", "server_name" }; + private static readonly uint[] _serverAddressFieldTags = new uint[] { 10, 18, 26 }; public static ServerAddress DefaultInstance { get { return defaultInstance; } } public override ServerAddress DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ServerAddress ThisMessage { @@ -918,12 +1114,12 @@ protected override ServerAddress ThisMessage { public const int AddressFieldNumber = 1; private bool hasAddress; - private global::bnet.protocol.Address address_ = global::bnet.protocol.Address.DefaultInstance; + private global::bnet.protocol.Address address_; public bool HasAddress { get { return hasAddress; } } public global::bnet.protocol.Address Address { - get { return address_; } + get { return address_ ?? global::bnet.protocol.Address.DefaultInstance; } } public const int ProcessNameFieldNumber = 2; @@ -955,16 +1151,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAddress) { - output.WriteMessage(1, Address); + string[] field_names = _serverAddressFieldNames; + if (hasAddress) { + output.WriteMessage(1, field_names[0], Address); } - if (HasProcessName) { - output.WriteString(2, ProcessName); + if (hasProcessName) { + output.WriteString(2, field_names[1], ProcessName); } - if (HasServerName) { - output.WriteString(3, ServerName); + if (hasServerName) { + output.WriteString(3, field_names[2], ServerName); } UnknownFields.WriteTo(output); } @@ -976,13 +1173,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAddress) { + if (hasAddress) { size += pb::CodedOutputStream.ComputeMessageSize(1, Address); } - if (HasProcessName) { + if (hasProcessName) { size += pb::CodedOutputStream.ComputeStringSize(2, ProcessName); } - if (HasServerName) { + if (hasServerName) { size += pb::CodedOutputStream.ComputeStringSize(3, ServerName); } size += UnknownFields.SerializedSize; @@ -1015,38 +1212,72 @@ public static ServerAddress ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static ServerAddress ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ServerAddress ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ServerAddress ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ServerAddress MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(ServerAddress cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ServerAddress result; - ServerAddress result = new ServerAddress(); + private ServerAddress PrepareBuilder() { + if (resultIsReadOnly) { + ServerAddress original = result; + result = new ServerAddress(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ServerAddress MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ServerAddress(); + 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 { @@ -1058,12 +1289,11 @@ public override ServerAddress DefaultInstanceForType { } public override ServerAddress BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ServerAddress returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1077,6 +1307,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ServerAddress other) { if (other == global::bnet.protocol.config.ServerAddress.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAddress) { MergeAddress(other.Address); } @@ -1090,20 +1321,31 @@ public override Builder MergeFrom(ServerAddress 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(_serverAddressFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverAddressFieldTags[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)) { @@ -1115,12 +1357,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.Address.Builder subBuilder = global::bnet.protocol.Address.CreateBuilder(); - if (HasAddress) { + if (result.hasAddress) { subBuilder.MergeFrom(Address); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1128,20 +1370,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 18: { - ProcessName = input.ReadString(); + result.hasProcessName = input.ReadString(ref result.processName_); break; } case 26: { - ServerName = input.ReadString(); + result.hasServerName = input.ReadString(ref result.serverName_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAddress { - get { return result.HasAddress; } + get { return result.hasAddress; } } public global::bnet.protocol.Address Address { get { return result.Address; } @@ -1149,19 +1396,22 @@ public bool HasAddress { } public Builder SetAddress(global::bnet.protocol.Address value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAddress = true; result.address_ = value; return this; } public Builder SetAddress(global::bnet.protocol.Address.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasAddress && result.address_ != global::bnet.protocol.Address.DefaultInstance) { result.address_ = global::bnet.protocol.Address.CreateBuilder(result.address_).MergeFrom(value).BuildPartial(); } else { @@ -1171,13 +1421,14 @@ public Builder MergeAddress(global::bnet.protocol.Address value) { return this; } public Builder ClearAddress() { + PrepareBuilder(); result.hasAddress = false; - result.address_ = global::bnet.protocol.Address.DefaultInstance; + result.address_ = null; return this; } public bool HasProcessName { - get { return result.HasProcessName; } + get { return result.hasProcessName; } } public string ProcessName { get { return result.ProcessName; } @@ -1185,18 +1436,20 @@ public string ProcessName { } public Builder SetProcessName(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasProcessName = true; result.processName_ = value; return this; } public Builder ClearProcessName() { + PrepareBuilder(); result.hasProcessName = false; result.processName_ = ""; return this; } public bool HasServerName { - get { return result.HasServerName; } + get { return result.hasServerName; } } public string ServerName { get { return result.ServerName; } @@ -1204,11 +1457,13 @@ public string ServerName { } public Builder SetServerName(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasServerName = true; result.serverName_ = value; return this; } public Builder ClearServerName() { + PrepareBuilder(); result.hasServerName = false; result.serverName_ = ""; return this; @@ -1219,14 +1474,20 @@ static ServerAddress() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ServerSet : pb::GeneratedMessage { - private static readonly ServerSet defaultInstance = new Builder().BuildPartial(); + private ServerSet() { } + private static readonly ServerSet defaultInstance = new ServerSet().MakeReadOnly(); + private static readonly string[] _serverSetFieldNames = new string[] { "exported_service", "imported_service", "server_address" }; + private static readonly uint[] _serverSetFieldTags = new uint[] { 18, 26, 10 }; public static ServerSet DefaultInstance { get { return defaultInstance; } } public override ServerSet DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ServerSet ThisMessage { @@ -1286,20 +1547,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.config.ServerAddress element in ServerAddressList) { - output.WriteMessage(1, element); + string[] field_names = _serverSetFieldNames; + if (serverAddress_.Count > 0) { + output.WriteMessageArray(1, field_names[2], serverAddress_); } if (exportedService_.Count > 0) { - foreach (string element in exportedService_) { - output.WriteString(2, element); - } + output.WriteStringArray(2, field_names[0], exportedService_); } if (importedService_.Count > 0) { - foreach (string element in importedService_) { - output.WriteString(3, element); - } + output.WriteStringArray(3, field_names[1], importedService_); } UnknownFields.WriteTo(output); } @@ -1360,38 +1618,75 @@ public static ServerSet ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static ServerSet ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ServerSet ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ServerSet ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ServerSet MakeReadOnly() { + serverAddress_.MakeReadOnly(); + exportedService_.MakeReadOnly(); + importedService_.MakeReadOnly(); + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(ServerSet cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ServerSet result = new ServerSet(); + private bool resultIsReadOnly; + private ServerSet result; + + private ServerSet PrepareBuilder() { + if (resultIsReadOnly) { + ServerSet original = result; + result = new ServerSet(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ServerSet MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ServerSet(); + 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 { @@ -1403,15 +1698,11 @@ public override ServerSet DefaultInstanceForType { } public override ServerSet BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.serverAddress_.MakeReadOnly(); - result.exportedService_.MakeReadOnly(); - result.importedService_.MakeReadOnly(); - ServerSet returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1425,33 +1716,45 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ServerSet other) { if (other == global::bnet.protocol.config.ServerSet.DefaultInstance) return this; + PrepareBuilder(); if (other.serverAddress_.Count != 0) { - base.AddRange(other.serverAddress_, result.serverAddress_); + result.serverAddress_.Add(other.serverAddress_); } if (other.exportedService_.Count != 0) { - base.AddRange(other.exportedService_, result.exportedService_); + result.exportedService_.Add(other.exportedService_); } if (other.importedService_.Count != 0) { - base.AddRange(other.importedService_, result.importedService_); + result.importedService_.Add(other.importedService_); } 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(_serverSetFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serverSetFieldTags[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)) { @@ -1463,30 +1766,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::bnet.protocol.config.ServerAddress.Builder subBuilder = global::bnet.protocol.config.ServerAddress.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddServerAddress(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.serverAddress_, global::bnet.protocol.config.ServerAddress.DefaultInstance, extensionRegistry); break; } case 18: { - AddExportedService(input.ReadString()); + input.ReadStringArray(tag, field_name, result.exportedService_); break; } case 26: { - AddImportedService(input.ReadString()); + input.ReadStringArray(tag, field_name, result.importedService_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList ServerAddressList { - get { return result.serverAddress_; } + get { return PrepareBuilder().serverAddress_; } } public int ServerAddressCount { get { return result.ServerAddressCount; } @@ -1496,35 +1802,41 @@ public int ServerAddressCount { } public Builder SetServerAddress(int index, global::bnet.protocol.config.ServerAddress value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.serverAddress_[index] = value; return this; } public Builder SetServerAddress(int index, global::bnet.protocol.config.ServerAddress.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.serverAddress_[index] = builderForValue.Build(); return this; } public Builder AddServerAddress(global::bnet.protocol.config.ServerAddress value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.serverAddress_.Add(value); return this; } public Builder AddServerAddress(global::bnet.protocol.config.ServerAddress.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.serverAddress_.Add(builderForValue.Build()); return this; } public Builder AddRangeServerAddress(scg::IEnumerable values) { - base.AddRange(values, result.serverAddress_); + PrepareBuilder(); + result.serverAddress_.Add(values); return this; } public Builder ClearServerAddress() { + PrepareBuilder(); result.serverAddress_.Clear(); return this; } public pbc::IPopsicleList ExportedServiceList { - get { return result.exportedService_; } + get { return PrepareBuilder().exportedService_; } } public int ExportedServiceCount { get { return result.ExportedServiceCount; } @@ -1534,25 +1846,29 @@ public string GetExportedService(int index) { } public Builder SetExportedService(int index, string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.exportedService_[index] = value; return this; } public Builder AddExportedService(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.exportedService_.Add(value); 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; } public pbc::IPopsicleList ImportedServiceList { - get { return result.importedService_; } + get { return PrepareBuilder().importedService_; } } public int ImportedServiceCount { get { return result.ImportedServiceCount; } @@ -1562,19 +1878,23 @@ public string GetImportedService(int index) { } public Builder SetImportedService(int index, string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.importedService_[index] = value; return this; } public Builder AddImportedService(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.importedService_.Add(value); return this; } public Builder AddRangeImportedService(scg::IEnumerable values) { - base.AddRange(values, result.importedService_); + PrepareBuilder(); + result.importedService_.Add(values); return this; } public Builder ClearImportedService() { + PrepareBuilder(); result.importedService_.Clear(); return this; } @@ -1584,14 +1904,20 @@ static ServerSet() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SupplementalService : pb::GeneratedMessage { - private static readonly SupplementalService defaultInstance = new Builder().BuildPartial(); + private SupplementalService() { } + private static readonly SupplementalService defaultInstance = new SupplementalService().MakeReadOnly(); + private static readonly string[] _supplementalServiceFieldNames = new string[] { "name", "port" }; + private static readonly uint[] _supplementalServiceFieldTags = new uint[] { 10, 16 }; public static SupplementalService DefaultInstance { get { return defaultInstance; } } public override SupplementalService DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SupplementalService ThisMessage { @@ -1618,7 +1944,7 @@ public string Name { public const int PortFieldNumber = 2; private bool hasPort; - private uint port_ = 0; + private uint port_; public bool HasPort { get { return hasPort; } } @@ -1634,13 +1960,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 = _supplementalServiceFieldNames; + if (hasName) { + output.WriteString(1, field_names[0], Name); } - if (HasPort) { - output.WriteUInt32(2, Port); + if (hasPort) { + output.WriteUInt32(2, field_names[1], Port); } UnknownFields.WriteTo(output); } @@ -1652,10 +1979,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasName) { + if (hasName) { size += pb::CodedOutputStream.ComputeStringSize(1, Name); } - if (HasPort) { + if (hasPort) { size += pb::CodedOutputStream.ComputeUInt32Size(2, Port); } size += UnknownFields.SerializedSize; @@ -1688,38 +2015,72 @@ public static SupplementalService ParseDelimitedFrom(global::System.IO.Stream in 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) { + public static SupplementalService ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SupplementalService ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SupplementalService ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SupplementalService MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(SupplementalService cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SupplementalService result; + + private SupplementalService PrepareBuilder() { + if (resultIsReadOnly) { + SupplementalService original = result; + result = new SupplementalService(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SupplementalService result = new SupplementalService(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SupplementalService MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SupplementalService(); + 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 +2092,11 @@ public override SupplementalService DefaultInstanceForType { } public override SupplementalService BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SupplementalService returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1750,6 +2110,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SupplementalService other) { if (other == global::bnet.protocol.config.SupplementalService.DefaultInstance) return this; + PrepareBuilder(); if (other.HasName) { Name = other.Name; } @@ -1760,20 +2121,31 @@ public override Builder MergeFrom(SupplementalService 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(_supplementalServiceFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _supplementalServiceFieldTags[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)) { @@ -1785,24 +2157,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 16: { - Port = input.ReadUInt32(); + result.hasPort = input.ReadUInt32(ref result.port_); 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; } @@ -1810,29 +2187,33 @@ 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 HasPort { - get { return result.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; @@ -1843,14 +2224,20 @@ static SupplementalService() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ListenPoint : pb::GeneratedMessage { - private static readonly ListenPoint defaultInstance = new Builder().BuildPartial(); + private ListenPoint() { } + private static readonly ListenPoint defaultInstance = new ListenPoint().MakeReadOnly(); + private static readonly string[] _listenPointFieldNames = new string[] { "accept", "address", "port" }; + private static readonly uint[] _listenPointFieldTags = new uint[] { 26, 18, 8 }; public static ListenPoint DefaultInstance { get { return defaultInstance; } } public override ListenPoint DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ListenPoint ThisMessage { @@ -1867,7 +2254,7 @@ protected override ListenPoint ThisMessage { public const int PortFieldNumber = 1; private bool hasPort; - private uint port_ = 0; + private uint port_; public bool HasPort { get { return hasPort; } } @@ -1907,16 +2294,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPort) { - output.WriteUInt32(1, Port); + string[] field_names = _listenPointFieldNames; + if (hasPort) { + output.WriteUInt32(1, field_names[2], Port); } - if (HasAddress) { - output.WriteString(2, Address); + if (hasAddress) { + output.WriteString(2, field_names[1], Address); } - foreach (global::bnet.protocol.config.ServerSet element in AcceptList) { - output.WriteMessage(3, element); + if (accept_.Count > 0) { + output.WriteMessageArray(3, field_names[0], accept_); } UnknownFields.WriteTo(output); } @@ -1928,10 +2316,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPort) { + if (hasPort) { size += pb::CodedOutputStream.ComputeUInt32Size(1, Port); } - if (HasAddress) { + if (hasAddress) { size += pb::CodedOutputStream.ComputeStringSize(2, Address); } foreach (global::bnet.protocol.config.ServerSet element in AcceptList) { @@ -1967,38 +2355,73 @@ public static ListenPoint ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static ListenPoint ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ListenPoint ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ListenPoint ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ListenPoint MakeReadOnly() { + accept_.MakeReadOnly(); + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(ListenPoint cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ListenPoint result; + + private ListenPoint PrepareBuilder() { + if (resultIsReadOnly) { + ListenPoint original = result; + result = new ListenPoint(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - ListenPoint result = new ListenPoint(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ListenPoint MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ListenPoint(); + 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 { @@ -2010,13 +2433,11 @@ public override ListenPoint DefaultInstanceForType { } public override ListenPoint BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.accept_.MakeReadOnly(); - ListenPoint returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2030,6 +2451,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ListenPoint other) { if (other == global::bnet.protocol.config.ListenPoint.DefaultInstance) return this; + PrepareBuilder(); if (other.HasPort) { Port = other.Port; } @@ -2037,26 +2459,37 @@ public override Builder MergeFrom(ListenPoint other) { Address = other.Address; } if (other.accept_.Count != 0) { - base.AddRange(other.accept_, result.accept_); + result.accept_.Add(other.accept_); } 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(_listenPointFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _listenPointFieldTags[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)) { @@ -2068,48 +2501,53 @@ 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: { - Port = input.ReadUInt32(); + result.hasPort = input.ReadUInt32(ref result.port_); break; } case 18: { - Address = input.ReadString(); + result.hasAddress = input.ReadString(ref result.address_); break; } case 26: { - global::bnet.protocol.config.ServerSet.Builder subBuilder = global::bnet.protocol.config.ServerSet.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAccept(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.accept_, global::bnet.protocol.config.ServerSet.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPort { - get { return result.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; } public bool HasAddress { - get { return result.HasAddress; } + get { return result.hasAddress; } } public string Address { get { return result.Address; } @@ -2117,18 +2555,20 @@ public string Address { } 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_ = "0.0.0.0"; return this; } public pbc::IPopsicleList AcceptList { - get { return result.accept_; } + get { return PrepareBuilder().accept_; } } public int AcceptCount { get { return result.AcceptCount; } @@ -2138,29 +2578,35 @@ public int AcceptCount { } public Builder SetAccept(int index, global::bnet.protocol.config.ServerSet value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.accept_[index] = value; return this; } public Builder SetAccept(int index, global::bnet.protocol.config.ServerSet.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.accept_[index] = builderForValue.Build(); return this; } public Builder AddAccept(global::bnet.protocol.config.ServerSet value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.accept_.Add(value); return this; } public Builder AddAccept(global::bnet.protocol.config.ServerSet.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.accept_.Add(builderForValue.Build()); return this; } public Builder AddRangeAccept(scg::IEnumerable values) { - base.AddRange(values, result.accept_); + PrepareBuilder(); + result.accept_.Add(values); return this; } public Builder ClearAccept() { + PrepareBuilder(); result.accept_.Clear(); return this; } @@ -2170,14 +2616,20 @@ static ListenPoint() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ServiceShard : pb::GeneratedMessage { - private static readonly ServiceShard defaultInstance = new Builder().BuildPartial(); + private ServiceShard() { } + private static readonly ServiceShard defaultInstance = new ServiceShard().MakeReadOnly(); + private static readonly string[] _serviceShardFieldNames = new string[] { "process_name" }; + private static readonly uint[] _serviceShardFieldTags = new uint[] { 10 }; public static ServiceShard DefaultInstance { get { return defaultInstance; } } public override ServiceShard DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ServiceShard ThisMessage { @@ -2209,10 +2661,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasProcessName) { - output.WriteString(1, ProcessName); + string[] field_names = _serviceShardFieldNames; + if (hasProcessName) { + output.WriteString(1, field_names[0], ProcessName); } UnknownFields.WriteTo(output); } @@ -2224,7 +2677,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasProcessName) { + if (hasProcessName) { size += pb::CodedOutputStream.ComputeStringSize(1, ProcessName); } size += UnknownFields.SerializedSize; @@ -2257,38 +2710,72 @@ public static ServiceShard ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static ServiceShard ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ServiceShard ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ServiceShard ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ServiceShard MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(ServiceShard cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ServiceShard result = new ServiceShard(); + private bool resultIsReadOnly; + private ServiceShard result; + + private ServiceShard PrepareBuilder() { + if (resultIsReadOnly) { + ServiceShard original = result; + result = new ServiceShard(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ServiceShard MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ServiceShard(); + 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 { @@ -2300,12 +2787,11 @@ public override ServiceShard DefaultInstanceForType { } public override ServiceShard BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ServiceShard returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2319,6 +2805,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ServiceShard other) { if (other == global::bnet.protocol.config.ServiceShard.DefaultInstance) return this; + PrepareBuilder(); if (other.HasProcessName) { ProcessName = other.ProcessName; } @@ -2326,20 +2813,31 @@ public override Builder MergeFrom(ServiceShard 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(_serviceShardFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serviceShardFieldTags[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)) { @@ -2351,20 +2849,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: { - ProcessName = input.ReadString(); + result.hasProcessName = input.ReadString(ref result.processName_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasProcessName { - get { return result.HasProcessName; } + get { return result.hasProcessName; } } public string ProcessName { get { return result.ProcessName; } @@ -2372,11 +2875,13 @@ public string ProcessName { } public Builder SetProcessName(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasProcessName = true; result.processName_ = value; return this; } public Builder ClearProcessName() { + PrepareBuilder(); result.hasProcessName = false; result.processName_ = ""; return this; @@ -2387,14 +2892,20 @@ static ServiceShard() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ServiceConfig : pb::GeneratedMessage { - private static readonly ServiceConfig defaultInstance = new Builder().BuildPartial(); + private ServiceConfig() { } + private static readonly ServiceConfig defaultInstance = new ServiceConfig().MakeReadOnly(); + private static readonly string[] _serviceConfigFieldNames = new string[] { "name", "shard", "url" }; + private static readonly uint[] _serviceConfigFieldTags = new uint[] { 10, 26, 18 }; public static ServiceConfig DefaultInstance { get { return defaultInstance; } } public override ServiceConfig DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ServiceConfig ThisMessage { @@ -2452,16 +2963,17 @@ 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 = _serviceConfigFieldNames; + if (hasName) { + output.WriteString(1, field_names[0], Name); } - if (HasUrl) { - output.WriteString(2, Url); + if (hasUrl) { + output.WriteString(2, field_names[2], Url); } - foreach (global::bnet.protocol.config.ServiceShard element in ShardList) { - output.WriteMessage(3, element); + if (shard_.Count > 0) { + output.WriteMessageArray(3, field_names[1], shard_); } UnknownFields.WriteTo(output); } @@ -2473,10 +2985,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); } foreach (global::bnet.protocol.config.ServiceShard element in ShardList) { @@ -2512,38 +3024,73 @@ public static ServiceConfig ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static ServiceConfig ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ServiceConfig ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ServiceConfig ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ServiceConfig MakeReadOnly() { + shard_.MakeReadOnly(); + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(ServiceConfig cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ServiceConfig result = new ServiceConfig(); + private bool resultIsReadOnly; + private ServiceConfig result; + + private ServiceConfig PrepareBuilder() { + if (resultIsReadOnly) { + ServiceConfig original = result; + result = new ServiceConfig(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ServiceConfig MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ServiceConfig(); + 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 { @@ -2555,13 +3102,11 @@ public override ServiceConfig DefaultInstanceForType { } public override ServiceConfig BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.shard_.MakeReadOnly(); - ServiceConfig returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2575,6 +3120,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ServiceConfig other) { if (other == global::bnet.protocol.config.ServiceConfig.DefaultInstance) return this; + PrepareBuilder(); if (other.HasName) { Name = other.Name; } @@ -2582,26 +3128,37 @@ public override Builder MergeFrom(ServiceConfig other) { Url = other.Url; } if (other.shard_.Count != 0) { - base.AddRange(other.shard_, result.shard_); + result.shard_.Add(other.shard_); } 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(_serviceConfigFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _serviceConfigFieldTags[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)) { @@ -2613,30 +3170,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: { - Name = input.ReadString(); + result.hasName = input.ReadString(ref result.name_); break; } case 18: { - Url = input.ReadString(); + result.hasUrl = input.ReadString(ref result.url_); break; } case 26: { - global::bnet.protocol.config.ServiceShard.Builder subBuilder = global::bnet.protocol.config.ServiceShard.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddShard(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.shard_, global::bnet.protocol.config.ServiceShard.DefaultInstance, extensionRegistry); 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; } @@ -2644,18 +3204,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; } @@ -2663,18 +3225,20 @@ 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; } public pbc::IPopsicleList ShardList { - get { return result.shard_; } + get { return PrepareBuilder().shard_; } } public int ShardCount { get { return result.ShardCount; } @@ -2684,29 +3248,35 @@ public int ShardCount { } public Builder SetShard(int index, global::bnet.protocol.config.ServiceShard value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.shard_[index] = value; return this; } public Builder SetShard(int index, global::bnet.protocol.config.ServiceShard.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.shard_[index] = builderForValue.Build(); return this; } public Builder AddShard(global::bnet.protocol.config.ServiceShard value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.shard_.Add(value); return this; } public Builder AddShard(global::bnet.protocol.config.ServiceShard.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.shard_.Add(builderForValue.Build()); return this; } public Builder AddRangeShard(scg::IEnumerable values) { - base.AddRange(values, result.shard_); + PrepareBuilder(); + result.shard_.Add(values); return this; } public Builder ClearShard() { + PrepareBuilder(); result.shard_.Clear(); return this; } @@ -2716,14 +3286,20 @@ static ServiceConfig() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class RPCServerConfig : pb::GeneratedMessage { - private static readonly RPCServerConfig defaultInstance = new Builder().BuildPartial(); + private RPCServerConfig() { } + private static readonly RPCServerConfig defaultInstance = new RPCServerConfig().MakeReadOnly(); + private static readonly string[] _rPCServerConfigFieldNames = new string[] { "connect", "listen", "name" }; + private static readonly uint[] _rPCServerConfigFieldTags = new uint[] { 26, 18, 10 }; public static RPCServerConfig DefaultInstance { get { return defaultInstance; } } public override RPCServerConfig DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override RPCServerConfig ThisMessage { @@ -2750,12 +3326,12 @@ public string Name { public const int ListenFieldNumber = 2; private bool hasListen; - private global::bnet.protocol.config.ListenPoint listen_ = global::bnet.protocol.config.ListenPoint.DefaultInstance; + private global::bnet.protocol.config.ListenPoint listen_; public bool HasListen { get { return hasListen; } } public global::bnet.protocol.config.ListenPoint Listen { - get { return listen_; } + get { return listen_ ?? global::bnet.protocol.config.ListenPoint.DefaultInstance; } } public const int ConnectFieldNumber = 3; @@ -2783,16 +3359,17 @@ 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 = _rPCServerConfigFieldNames; + if (hasName) { + output.WriteString(1, field_names[2], Name); } - if (HasListen) { - output.WriteMessage(2, Listen); + if (hasListen) { + output.WriteMessage(2, field_names[1], Listen); } - foreach (global::bnet.protocol.config.ServerSet element in ConnectList) { - output.WriteMessage(3, element); + if (connect_.Count > 0) { + output.WriteMessageArray(3, field_names[0], connect_); } UnknownFields.WriteTo(output); } @@ -2804,10 +3381,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasName) { + if (hasName) { size += pb::CodedOutputStream.ComputeStringSize(1, Name); } - if (HasListen) { + if (hasListen) { size += pb::CodedOutputStream.ComputeMessageSize(2, Listen); } foreach (global::bnet.protocol.config.ServerSet element in ConnectList) { @@ -2843,38 +3420,73 @@ public static RPCServerConfig ParseDelimitedFrom(global::System.IO.Stream input) 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) { + public static RPCServerConfig ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static RPCServerConfig ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static RPCServerConfig ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private RPCServerConfig MakeReadOnly() { + connect_.MakeReadOnly(); + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(RPCServerConfig cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - RPCServerConfig result = new RPCServerConfig(); + private bool resultIsReadOnly; + private RPCServerConfig result; + + private RPCServerConfig PrepareBuilder() { + if (resultIsReadOnly) { + RPCServerConfig original = result; + result = new RPCServerConfig(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override RPCServerConfig MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new RPCServerConfig(); + 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 { @@ -2886,13 +3498,11 @@ public override RPCServerConfig DefaultInstanceForType { } public override RPCServerConfig BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.connect_.MakeReadOnly(); - RPCServerConfig returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2906,6 +3516,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(RPCServerConfig other) { if (other == global::bnet.protocol.config.RPCServerConfig.DefaultInstance) return this; + PrepareBuilder(); if (other.HasName) { Name = other.Name; } @@ -2913,26 +3524,37 @@ public override Builder MergeFrom(RPCServerConfig other) { MergeListen(other.Listen); } if (other.connect_.Count != 0) { - base.AddRange(other.connect_, result.connect_); + result.connect_.Add(other.connect_); } 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(_rPCServerConfigFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _rPCServerConfigFieldTags[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)) { @@ -2944,16 +3566,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.config.ListenPoint.Builder subBuilder = global::bnet.protocol.config.ListenPoint.CreateBuilder(); - if (HasListen) { + if (result.hasListen) { subBuilder.MergeFrom(Listen); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2961,18 +3583,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 26: { - global::bnet.protocol.config.ServerSet.Builder subBuilder = global::bnet.protocol.config.ServerSet.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddConnect(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.connect_, global::bnet.protocol.config.ServerSet.DefaultInstance, extensionRegistry); 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; } @@ -2980,18 +3605,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 HasListen { - get { return result.HasListen; } + get { return result.hasListen; } } public global::bnet.protocol.config.ListenPoint Listen { get { return result.Listen; } @@ -2999,19 +3626,22 @@ public bool HasListen { } public Builder SetListen(global::bnet.protocol.config.ListenPoint value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasListen = true; result.listen_ = value; return this; } public Builder SetListen(global::bnet.protocol.config.ListenPoint.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -3021,13 +3651,14 @@ public Builder MergeListen(global::bnet.protocol.config.ListenPoint value) { return this; } public Builder ClearListen() { + PrepareBuilder(); result.hasListen = false; - result.listen_ = global::bnet.protocol.config.ListenPoint.DefaultInstance; + result.listen_ = null; return this; } public pbc::IPopsicleList ConnectList { - get { return result.connect_; } + get { return PrepareBuilder().connect_; } } public int ConnectCount { get { return result.ConnectCount; } @@ -3037,29 +3668,35 @@ public int ConnectCount { } public Builder SetConnect(int index, global::bnet.protocol.config.ServerSet value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.connect_[index] = value; return this; } public Builder SetConnect(int index, global::bnet.protocol.config.ServerSet.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.connect_[index] = builderForValue.Build(); return this; } public Builder AddConnect(global::bnet.protocol.config.ServerSet value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.connect_.Add(value); return this; } public Builder AddConnect(global::bnet.protocol.config.ServerSet.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.connect_.Add(builderForValue.Build()); return this; } public Builder AddRangeConnect(scg::IEnumerable values) { - base.AddRange(values, result.connect_); + PrepareBuilder(); + result.connect_.Add(values); return this; } public Builder ClearConnect() { + PrepareBuilder(); result.connect_.Clear(); return this; } @@ -3069,14 +3706,20 @@ static RPCServerConfig() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ProcessConfig : pb::GeneratedMessage { - private static readonly ProcessConfig defaultInstance = new Builder().BuildPartial(); + private ProcessConfig() { } + private static readonly ProcessConfig defaultInstance = new ProcessConfig().MakeReadOnly(); + private static readonly string[] _processConfigFieldNames = new string[] { "cpu_affinity_main_event_processor", "cpu_affinity_network_event_processor", "process_name", "resource", "server", "service", "supplemental_service", "var" }; + private static readonly uint[] _processConfigFieldTags = new uint[] { 58, 66, 10, 26, 18, 34, 50, 42 }; public static ProcessConfig DefaultInstance { get { return defaultInstance; } } public override ProcessConfig DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ProcessConfig ThisMessage { @@ -3101,6 +3744,32 @@ public string ProcessName { get { return processName_; } } + public const int CpuAffinityMainEventProcessorFieldNumber = 7; + private int cpuAffinityMainEventProcessorMemoizedSerializedSize; + private pbc::PopsicleList cpuAffinityMainEventProcessor_ = new pbc::PopsicleList(); + public scg::IList CpuAffinityMainEventProcessorList { + get { return pbc::Lists.AsReadOnly(cpuAffinityMainEventProcessor_); } + } + public int CpuAffinityMainEventProcessorCount { + get { return cpuAffinityMainEventProcessor_.Count; } + } + public uint GetCpuAffinityMainEventProcessor(int index) { + return cpuAffinityMainEventProcessor_[index]; + } + + public const int CpuAffinityNetworkEventProcessorFieldNumber = 8; + private int cpuAffinityNetworkEventProcessorMemoizedSerializedSize; + private pbc::PopsicleList cpuAffinityNetworkEventProcessor_ = new pbc::PopsicleList(); + public scg::IList CpuAffinityNetworkEventProcessorList { + get { return pbc::Lists.AsReadOnly(cpuAffinityNetworkEventProcessor_); } + } + public int CpuAffinityNetworkEventProcessorCount { + get { return cpuAffinityNetworkEventProcessor_.Count; } + } + public uint GetCpuAffinityNetworkEventProcessor(int index) { + return cpuAffinityNetworkEventProcessor_[index]; + } + public const int ServerFieldNumber = 2; private pbc::PopsicleList server_ = new pbc::PopsicleList(); public scg::IList ServerList { @@ -3183,25 +3852,32 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasProcessName) { - output.WriteString(1, ProcessName); + string[] field_names = _processConfigFieldNames; + if (hasProcessName) { + output.WriteString(1, field_names[2], ProcessName); + } + if (server_.Count > 0) { + output.WriteMessageArray(2, field_names[4], server_); } - foreach (global::bnet.protocol.config.RPCServerConfig element in ServerList) { - output.WriteMessage(2, element); + if (resource_.Count > 0) { + output.WriteMessageArray(3, field_names[3], resource_); } - foreach (global::bnet.protocol.config.Resource element in ResourceList) { - output.WriteMessage(3, element); + if (service_.Count > 0) { + output.WriteMessageArray(4, field_names[5], service_); } - foreach (global::bnet.protocol.config.ServiceConfig element in ServiceList) { - output.WriteMessage(4, element); + if (var_.Count > 0) { + output.WriteMessageArray(5, field_names[7], var_); } - foreach (global::bnet.protocol.config.Var element in VarList) { - output.WriteMessage(5, element); + if (supplementalService_.Count > 0) { + output.WriteMessageArray(6, field_names[6], supplementalService_); } - foreach (global::bnet.protocol.config.SupplementalService element in SupplementalServiceList) { - output.WriteMessage(6, element); + if (cpuAffinityMainEventProcessor_.Count > 0) { + output.WritePackedUInt32Array(7, field_names[0], cpuAffinityMainEventProcessorMemoizedSerializedSize, cpuAffinityMainEventProcessor_); + } + if (cpuAffinityNetworkEventProcessor_.Count > 0) { + output.WritePackedUInt32Array(8, field_names[1], cpuAffinityNetworkEventProcessorMemoizedSerializedSize, cpuAffinityNetworkEventProcessor_); } UnknownFields.WriteTo(output); } @@ -3213,9 +3889,31 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasProcessName) { + if (hasProcessName) { size += pb::CodedOutputStream.ComputeStringSize(1, ProcessName); } + { + int dataSize = 0; + foreach (uint element in CpuAffinityMainEventProcessorList) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + if (cpuAffinityMainEventProcessor_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + cpuAffinityMainEventProcessorMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + foreach (uint element in CpuAffinityNetworkEventProcessorList) { + dataSize += pb::CodedOutputStream.ComputeUInt32SizeNoTag(element); + } + size += dataSize; + if (cpuAffinityNetworkEventProcessor_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + cpuAffinityNetworkEventProcessorMemoizedSerializedSize = dataSize; + } foreach (global::bnet.protocol.config.RPCServerConfig element in ServerList) { size += pb::CodedOutputStream.ComputeMessageSize(2, element); } @@ -3261,38 +3959,79 @@ public static ProcessConfig ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static ProcessConfig ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ProcessConfig ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ProcessConfig ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ProcessConfig MakeReadOnly() { + cpuAffinityMainEventProcessor_.MakeReadOnly(); + cpuAffinityNetworkEventProcessor_.MakeReadOnly(); + server_.MakeReadOnly(); + resource_.MakeReadOnly(); + service_.MakeReadOnly(); + var_.MakeReadOnly(); + supplementalService_.MakeReadOnly(); + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(ProcessConfig cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ProcessConfig result = new ProcessConfig(); + private bool resultIsReadOnly; + private ProcessConfig result; + + private ProcessConfig PrepareBuilder() { + if (resultIsReadOnly) { + ProcessConfig original = result; + result = new ProcessConfig(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ProcessConfig MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ProcessConfig(); + 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 { @@ -3304,17 +4043,11 @@ public override ProcessConfig DefaultInstanceForType { } public override ProcessConfig BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.server_.MakeReadOnly(); - result.resource_.MakeReadOnly(); - result.service_.MakeReadOnly(); - result.var_.MakeReadOnly(); - result.supplementalService_.MakeReadOnly(); - ProcessConfig returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3328,42 +4061,60 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ProcessConfig other) { if (other == global::bnet.protocol.config.ProcessConfig.DefaultInstance) return this; + PrepareBuilder(); if (other.HasProcessName) { ProcessName = other.ProcessName; } + if (other.cpuAffinityMainEventProcessor_.Count != 0) { + result.cpuAffinityMainEventProcessor_.Add(other.cpuAffinityMainEventProcessor_); + } + if (other.cpuAffinityNetworkEventProcessor_.Count != 0) { + result.cpuAffinityNetworkEventProcessor_.Add(other.cpuAffinityNetworkEventProcessor_); + } if (other.server_.Count != 0) { - base.AddRange(other.server_, result.server_); + result.server_.Add(other.server_); } if (other.resource_.Count != 0) { - base.AddRange(other.resource_, result.resource_); + result.resource_.Add(other.resource_); } if (other.service_.Count != 0) { - base.AddRange(other.service_, result.service_); + result.service_.Add(other.service_); } if (other.var_.Count != 0) { - base.AddRange(other.var_, result.var_); + result.var_.Add(other.var_); } if (other.supplementalService_.Count != 0) { - base.AddRange(other.supplementalService_, result.supplementalService_); + result.supplementalService_.Add(other.supplementalService_); } 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(_processConfigFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _processConfigFieldTags[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)) { @@ -3375,50 +4126,55 @@ 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: { - ProcessName = input.ReadString(); + result.hasProcessName = input.ReadString(ref result.processName_); break; } case 18: { - global::bnet.protocol.config.RPCServerConfig.Builder subBuilder = global::bnet.protocol.config.RPCServerConfig.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddServer(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.server_, global::bnet.protocol.config.RPCServerConfig.DefaultInstance, extensionRegistry); break; } case 26: { - global::bnet.protocol.config.Resource.Builder subBuilder = global::bnet.protocol.config.Resource.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddResource(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.resource_, global::bnet.protocol.config.Resource.DefaultInstance, extensionRegistry); break; } case 34: { - global::bnet.protocol.config.ServiceConfig.Builder subBuilder = global::bnet.protocol.config.ServiceConfig.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddService(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.service_, global::bnet.protocol.config.ServiceConfig.DefaultInstance, extensionRegistry); break; } case 42: { - global::bnet.protocol.config.Var.Builder subBuilder = global::bnet.protocol.config.Var.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddVar(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.var_, global::bnet.protocol.config.Var.DefaultInstance, extensionRegistry); break; } case 50: { - global::bnet.protocol.config.SupplementalService.Builder subBuilder = global::bnet.protocol.config.SupplementalService.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddSupplementalService(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.supplementalService_, global::bnet.protocol.config.SupplementalService.DefaultInstance, extensionRegistry); + break; + } + case 58: + case 56: { + input.ReadUInt32Array(tag, field_name, result.cpuAffinityMainEventProcessor_); + break; + } + case 66: + case 64: { + input.ReadUInt32Array(tag, field_name, result.cpuAffinityNetworkEventProcessor_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasProcessName { - get { return result.HasProcessName; } + get { return result.hasProcessName; } } public string ProcessName { get { return result.ProcessName; } @@ -3426,18 +4182,80 @@ public string ProcessName { } public Builder SetProcessName(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasProcessName = true; result.processName_ = value; return this; } public Builder ClearProcessName() { + PrepareBuilder(); result.hasProcessName = false; result.processName_ = ""; return this; } + public pbc::IPopsicleList CpuAffinityMainEventProcessorList { + get { return PrepareBuilder().cpuAffinityMainEventProcessor_; } + } + public int CpuAffinityMainEventProcessorCount { + get { return result.CpuAffinityMainEventProcessorCount; } + } + public uint GetCpuAffinityMainEventProcessor(int index) { + return result.GetCpuAffinityMainEventProcessor(index); + } + public Builder SetCpuAffinityMainEventProcessor(int index, uint value) { + PrepareBuilder(); + result.cpuAffinityMainEventProcessor_[index] = value; + return this; + } + public Builder AddCpuAffinityMainEventProcessor(uint value) { + PrepareBuilder(); + result.cpuAffinityMainEventProcessor_.Add(value); + return this; + } + public Builder AddRangeCpuAffinityMainEventProcessor(scg::IEnumerable values) { + PrepareBuilder(); + result.cpuAffinityMainEventProcessor_.Add(values); + return this; + } + public Builder ClearCpuAffinityMainEventProcessor() { + PrepareBuilder(); + result.cpuAffinityMainEventProcessor_.Clear(); + return this; + } + + public pbc::IPopsicleList CpuAffinityNetworkEventProcessorList { + get { return PrepareBuilder().cpuAffinityNetworkEventProcessor_; } + } + public int CpuAffinityNetworkEventProcessorCount { + get { return result.CpuAffinityNetworkEventProcessorCount; } + } + public uint GetCpuAffinityNetworkEventProcessor(int index) { + return result.GetCpuAffinityNetworkEventProcessor(index); + } + public Builder SetCpuAffinityNetworkEventProcessor(int index, uint value) { + PrepareBuilder(); + result.cpuAffinityNetworkEventProcessor_[index] = value; + return this; + } + public Builder AddCpuAffinityNetworkEventProcessor(uint value) { + PrepareBuilder(); + result.cpuAffinityNetworkEventProcessor_.Add(value); + return this; + } + public Builder AddRangeCpuAffinityNetworkEventProcessor(scg::IEnumerable values) { + PrepareBuilder(); + result.cpuAffinityNetworkEventProcessor_.Add(values); + return this; + } + public Builder ClearCpuAffinityNetworkEventProcessor() { + PrepareBuilder(); + result.cpuAffinityNetworkEventProcessor_.Clear(); + return this; + } + public pbc::IPopsicleList ServerList { - get { return result.server_; } + get { return PrepareBuilder().server_; } } public int ServerCount { get { return result.ServerCount; } @@ -3447,35 +4265,41 @@ public int ServerCount { } public Builder SetServer(int index, global::bnet.protocol.config.RPCServerConfig value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.server_[index] = value; return this; } public Builder SetServer(int index, global::bnet.protocol.config.RPCServerConfig.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.server_[index] = builderForValue.Build(); return this; } public Builder AddServer(global::bnet.protocol.config.RPCServerConfig value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.server_.Add(value); return this; } public Builder AddServer(global::bnet.protocol.config.RPCServerConfig.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.server_.Add(builderForValue.Build()); return this; } public Builder AddRangeServer(scg::IEnumerable values) { - base.AddRange(values, result.server_); + PrepareBuilder(); + result.server_.Add(values); return this; } public Builder ClearServer() { + PrepareBuilder(); result.server_.Clear(); return this; } public pbc::IPopsicleList ResourceList { - get { return result.resource_; } + get { return PrepareBuilder().resource_; } } public int ResourceCount { get { return result.ResourceCount; } @@ -3485,35 +4309,41 @@ public int ResourceCount { } public Builder SetResource(int index, global::bnet.protocol.config.Resource value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.resource_[index] = value; return this; } public Builder SetResource(int index, global::bnet.protocol.config.Resource.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.resource_[index] = builderForValue.Build(); return this; } public Builder AddResource(global::bnet.protocol.config.Resource value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.resource_.Add(value); return this; } public Builder AddResource(global::bnet.protocol.config.Resource.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.resource_.Add(builderForValue.Build()); return this; } public Builder AddRangeResource(scg::IEnumerable values) { - base.AddRange(values, result.resource_); + PrepareBuilder(); + result.resource_.Add(values); return this; } public Builder ClearResource() { + PrepareBuilder(); result.resource_.Clear(); return this; } public pbc::IPopsicleList ServiceList { - get { return result.service_; } + get { return PrepareBuilder().service_; } } public int ServiceCount { get { return result.ServiceCount; } @@ -3523,35 +4353,41 @@ public int ServiceCount { } public Builder SetService(int index, global::bnet.protocol.config.ServiceConfig value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.service_[index] = value; return this; } public Builder SetService(int index, global::bnet.protocol.config.ServiceConfig.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.service_[index] = builderForValue.Build(); return this; } public Builder AddService(global::bnet.protocol.config.ServiceConfig value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.service_.Add(value); return this; } public Builder AddService(global::bnet.protocol.config.ServiceConfig.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.service_.Add(builderForValue.Build()); return this; } public Builder AddRangeService(scg::IEnumerable values) { - base.AddRange(values, result.service_); + PrepareBuilder(); + result.service_.Add(values); return this; } public Builder ClearService() { + PrepareBuilder(); result.service_.Clear(); return this; } public pbc::IPopsicleList VarList { - get { return result.var_; } + get { return PrepareBuilder().var_; } } public int VarCount { get { return result.VarCount; } @@ -3561,35 +4397,41 @@ public int VarCount { } public Builder SetVar(int index, global::bnet.protocol.config.Var value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.var_[index] = value; return this; } public Builder SetVar(int index, global::bnet.protocol.config.Var.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.var_[index] = builderForValue.Build(); return this; } public Builder AddVar(global::bnet.protocol.config.Var value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.var_.Add(value); return this; } public Builder AddVar(global::bnet.protocol.config.Var.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.var_.Add(builderForValue.Build()); return this; } public Builder AddRangeVar(scg::IEnumerable values) { - base.AddRange(values, result.var_); + PrepareBuilder(); + result.var_.Add(values); return this; } public Builder ClearVar() { + PrepareBuilder(); result.var_.Clear(); return this; } public pbc::IPopsicleList SupplementalServiceList { - get { return result.supplementalService_; } + get { return PrepareBuilder().supplementalService_; } } public int SupplementalServiceCount { get { return result.SupplementalServiceCount; } @@ -3599,29 +4441,35 @@ public int SupplementalServiceCount { } public Builder SetSupplementalService(int index, global::bnet.protocol.config.SupplementalService value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.supplementalService_[index] = value; return this; } public Builder SetSupplementalService(int index, global::bnet.protocol.config.SupplementalService.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.supplementalService_[index] = builderForValue.Build(); return this; } public Builder AddSupplementalService(global::bnet.protocol.config.SupplementalService value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.supplementalService_.Add(value); return this; } public Builder AddSupplementalService(global::bnet.protocol.config.SupplementalService.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.supplementalService_.Add(builderForValue.Build()); return this; } public Builder AddRangeSupplementalService(scg::IEnumerable values) { - base.AddRange(values, result.supplementalService_); + PrepareBuilder(); + result.supplementalService_.Add(values); return this; } public Builder ClearSupplementalService() { + PrepareBuilder(); result.supplementalService_.Clear(); return this; } @@ -3634,3 +4482,5 @@ static ProcessConfig() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/connection/Connection.cs b/src/LibMooNet/bnet/protocol/connection/Connection.cs similarity index 69% rename from source/D3Proto/bnet/protocol/connection/Connection.cs rename to src/LibMooNet/bnet/protocol/connection/Connection.cs index c0c34f36..309762ec 100644 --- a/source/D3Proto/bnet/protocol/connection/Connection.cs +++ b/src/LibMooNet/bnet/protocol/connection/Connection.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.connection { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class Connection { #region Extension registration @@ -59,21 +64,22 @@ static Connection() { "ZRIMCgR0aW1lGAEgASgGEg8KB3BheWxvYWQYAiABKAwiJwoRRGlzY29ubmVj" + "dFJlcXVlc3QSEgoKZXJyb3JfY29kZRgBIAIoDSI8ChZEaXNjb25uZWN0Tm90" + "aWZpY2F0aW9uEhIKCmVycm9yX2NvZGUYASACKA0SDgoGcmVhc29uGAIgASgJ" + - "Ig0KC051bGxSZXF1ZXN0IhAKDkVuY3J5cHRSZXF1ZXN0MvcEChFDb25uZWN0" + - "aW9uU2VydmljZRJeCgdDb25uZWN0EiguYm5ldC5wcm90b2NvbC5jb25uZWN0" + + "Ig0KC051bGxSZXF1ZXN0IhAKDkVuY3J5cHRSZXF1ZXN0MqEFChFDb25uZWN0" + + "aW9uU2VydmljZRJkCgdDb25uZWN0EiguYm5ldC5wcm90b2NvbC5jb25uZWN0" + "aW9uLkNvbm5lY3RSZXF1ZXN0GikuYm5ldC5wcm90b2NvbC5jb25uZWN0aW9u" + - "LkNvbm5lY3RSZXNwb25zZRJVCgRCaW5kEiUuYm5ldC5wcm90b2NvbC5jb25u" + - "ZWN0aW9uLkJpbmRSZXF1ZXN0GiYuYm5ldC5wcm90b2NvbC5jb25uZWN0aW9u" + - "LkJpbmRSZXNwb25zZRJVCgRFY2hvEiUuYm5ldC5wcm90b2NvbC5jb25uZWN0" + - "aW9uLkVjaG9SZXF1ZXN0GiYuYm5ldC5wcm90b2NvbC5jb25uZWN0aW9uLkVj" + - "aG9SZXNwb25zZRJfCg9Gb3JjZURpc2Nvbm5lY3QSMC5ibmV0LnByb3RvY29s" + - "LmNvbm5lY3Rpb24uRGlzY29ubmVjdE5vdGlmaWNhdGlvbhoaLmJuZXQucHJv" + - "dG9jb2wuTk9fUkVTUE9OU0USSQoETnVsbBIlLmJuZXQucHJvdG9jb2wuY29u" + - "bmVjdGlvbi5OdWxsUmVxdWVzdBoaLmJuZXQucHJvdG9jb2wuTk9fUkVTUE9O" + - "U0USSgoHRW5jcnlwdBIoLmJuZXQucHJvdG9jb2wuY29ubmVjdGlvbi5FbmNy" + - "eXB0UmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhElwKEVJlcXVlc3RE" + - "aXNjb25uZWN0EisuYm5ldC5wcm90b2NvbC5jb25uZWN0aW9uLkRpc2Nvbm5l" + - "Y3RSZXF1ZXN0GhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRUIDgAEB"); + "LkNvbm5lY3RSZXNwb25zZSIEgLUYARJbCgRCaW5kEiUuYm5ldC5wcm90b2Nv" + + "bC5jb25uZWN0aW9uLkJpbmRSZXF1ZXN0GiYuYm5ldC5wcm90b2NvbC5jb25u" + + "ZWN0aW9uLkJpbmRSZXNwb25zZSIEgLUYAhJbCgRFY2hvEiUuYm5ldC5wcm90" + + "b2NvbC5jb25uZWN0aW9uLkVjaG9SZXF1ZXN0GiYuYm5ldC5wcm90b2NvbC5j" + + "b25uZWN0aW9uLkVjaG9SZXNwb25zZSIEgLUYAxJlCg9Gb3JjZURpc2Nvbm5l" + + "Y3QSMC5ibmV0LnByb3RvY29sLmNvbm5lY3Rpb24uRGlzY29ubmVjdE5vdGlm" + + "aWNhdGlvbhoaLmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAQSTwoE" + + "TnVsbBIlLmJuZXQucHJvdG9jb2wuY29ubmVjdGlvbi5OdWxsUmVxdWVzdBoa" + + "LmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAUSUAoHRW5jcnlwdBIo" + + "LmJuZXQucHJvdG9jb2wuY29ubmVjdGlvbi5FbmNyeXB0UmVxdWVzdBoVLmJu" + + "ZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgGEmIKEVJlcXVlc3REaXNjb25uZWN0" + + "EisuYm5ldC5wcm90b2NvbC5jb25uZWN0aW9uLkRpc2Nvbm5lY3RSZXF1ZXN0" + + "GhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRSIEgLUYB0IDgAEA"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_connection_ConnectRequest__Descriptor = Descriptor.MessageTypes[0]; @@ -120,7 +126,10 @@ static Connection() { internal__static_bnet_protocol_connection_EncryptRequest__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_connection_EncryptRequest__Descriptor, new string[] { }); - return null; + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + return registry; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { @@ -131,14 +140,20 @@ static Connection() { } #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[] { "client_id" }; + private static readonly uint[] _connectRequestFieldTags = new uint[] { 10 }; public static ConnectRequest DefaultInstance { get { return defaultInstance; } } public override ConnectRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ConnectRequest ThisMessage { @@ -155,12 +170,12 @@ protected override ConnectRequest ThisMessage { 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 override bool IsInitialized { @@ -172,10 +187,11 @@ public override bool IsInitialized { } } - 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[0], ClientId); } UnknownFields.WriteTo(output); } @@ -187,7 +203,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasClientId) { + if (hasClientId) { size += pb::CodedOutputStream.ComputeMessageSize(1, ClientId); } size += UnknownFields.SerializedSize; @@ -220,38 +236,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; + } + + private bool resultIsReadOnly; + private ConnectRequest result; + + private ConnectRequest PrepareBuilder() { + if (resultIsReadOnly) { + ConnectRequest original = result; + result = new ConnectRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - ConnectRequest result = new ConnectRequest(); + 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 +313,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,6 +331,7 @@ 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); } @@ -289,20 +339,31 @@ public override Builder MergeFrom(ConnectRequest 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(_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,12 +375,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 (HasClientId) { + if (result.hasClientId) { subBuilder.MergeFrom(ClientId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -328,11 +389,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + 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 +406,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,8 +431,9 @@ 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; } } @@ -372,14 +442,20 @@ static ConnectRequest() { } } + [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[] { "client_id", "server_id" }; + private static readonly uint[] _connectResponseFieldTags = new uint[] { 18, 10 }; public static ConnectResponse DefaultInstance { get { return defaultInstance; } } public override ConnectResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ConnectResponse ThisMessage { @@ -396,22 +472,22 @@ protected override ConnectResponse ThisMessage { 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 override bool IsInitialized { @@ -425,13 +501,14 @@ public override bool IsInitialized { } } - 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[1], ServerId); } - if (HasClientId) { - output.WriteMessage(2, ClientId); + if (hasClientId) { + output.WriteMessage(2, field_names[0], ClientId); } UnknownFields.WriteTo(output); } @@ -443,10 +520,10 @@ 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); } size += UnknownFields.SerializedSize; @@ -479,38 +556,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; + } - ConnectResponse result = new ConnectResponse(); + private bool resultIsReadOnly; + private ConnectResponse result; + + private ConnectResponse PrepareBuilder() { + if (resultIsReadOnly) { + ConnectResponse original = result; + result = new ConnectResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +633,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,6 +651,7 @@ 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); } @@ -551,20 +662,31 @@ public override Builder MergeFrom(ConnectResponse 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(_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 +698,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,7 +712,7 @@ 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); @@ -599,11 +721,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + 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 +738,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 +763,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 +778,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,8 +803,9 @@ 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; } } @@ -679,14 +814,20 @@ static ConnectResponse() { } } + [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 { @@ -703,7 +844,7 @@ protected override BoundService ThisMessage { public const int HashFieldNumber = 1; private bool hasHash; - private uint hash_ = 0; + private uint hash_; public bool HasHash { get { return hasHash; } } @@ -713,7 +854,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 +870,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 +889,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 +925,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 +1002,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 +1020,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 +1031,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,53 +1067,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 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; @@ -937,14 +1133,20 @@ static BoundService() { } } + [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 { @@ -993,17 +1195,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 +1256,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 +1335,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 +1353,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 +1400,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 +1432,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,29 +1463,35 @@ 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; } @@ -1248,14 +1501,20 @@ static BindRequest() { } } + [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 { @@ -1289,14 +1548,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 +1605,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; - BindResponse result = new BindResponse(); + private BindResponse PrepareBuilder() { + if (resultIsReadOnly) { + BindResponse original = result; + result = new BindResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +1683,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 +1701,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 +1745,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,18 +1773,22 @@ 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; } @@ -1492,14 +1798,20 @@ static BindResponse() { } } + [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 { @@ -1516,7 +1828,7 @@ protected override EchoRequest ThisMessage { public const int TimeFieldNumber = 1; private bool hasTime; - private ulong time_ = 0; + private ulong time_; public bool HasTime { get { return hasTime; } } @@ -1526,7 +1838,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 +1862,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 +1884,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 +1923,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; + } - EchoRequest result = new EchoRequest(); + private bool resultIsReadOnly; + private EchoRequest result; + + private EchoRequest PrepareBuilder() { + if (resultIsReadOnly) { + EchoRequest original = result; + result = new EchoRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +2000,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 +2018,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 +2032,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 +2068,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,11 +2142,13 @@ 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; @@ -1790,14 +2159,20 @@ static EchoRequest() { } } + [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 { @@ -1814,7 +2189,7 @@ protected override EchoResponse ThisMessage { public const int TimeFieldNumber = 1; private bool hasTime; - private ulong time_ = 0; + private ulong time_; public bool HasTime { get { return hasTime; } } @@ -1838,13 +2213,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 +2232,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 +2268,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; + } - EchoResponse result = new EchoResponse(); + private bool resultIsReadOnly; + private EchoResponse result; + + private EchoResponse PrepareBuilder() { + if (resultIsReadOnly) { + EchoResponse original = result; + result = new EchoResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +2345,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 +2363,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 +2374,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 +2410,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,11 +2460,13 @@ 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; @@ -2047,14 +2477,20 @@ static EchoResponse() { } } + [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 { @@ -2071,7 +2507,7 @@ protected override DisconnectRequest ThisMessage { public const int ErrorCodeFieldNumber = 1; private bool hasErrorCode; - private uint errorCode_ = 0; + private uint errorCode_; public bool HasErrorCode { get { return hasErrorCode; } } @@ -2086,10 +2522,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 +2538,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 +2571,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 +2648,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 +2666,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 +2674,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,31 +2710,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; } 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; @@ -2263,14 +2752,20 @@ static DisconnectRequest() { } } + [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 { @@ -2287,7 +2782,7 @@ protected override DisconnectNotification ThisMessage { public const int ErrorCodeFieldNumber = 1; private bool hasErrorCode; - private uint errorCode_ = 0; + private uint errorCode_; public bool HasErrorCode { get { return hasErrorCode; } } @@ -2312,13 +2807,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 +2826,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 +2862,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 +2939,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 +2957,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 +2968,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 +3004,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,11 +3054,13 @@ 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; @@ -2521,14 +3071,20 @@ static DisconnectNotification() { } } + [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 { @@ -2549,8 +3105,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 +3148,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; + } - NullRequest result = new NullRequest(); + private bool resultIsReadOnly; + private NullRequest result; + + private NullRequest PrepareBuilder() { + if (resultIsReadOnly) { + NullRequest original = result; + result = new NullRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +3225,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 +3243,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,11 +3284,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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } @@ -2695,14 +3302,20 @@ static NullRequest() { } } + [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 { @@ -2723,8 +3336,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 +3379,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 +3456,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 +3474,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,11 +3515,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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } @@ -2872,6 +3536,9 @@ static EncryptRequest() { #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, @@ -3013,6 +3680,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 +3761,5 @@ public override void RequestDisconnect( #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/exchange/Exchange.cs b/src/LibMooNet/bnet/protocol/exchange/Exchange.cs similarity index 68% rename from source/D3Proto/bnet/protocol/exchange/Exchange.cs rename to src/LibMooNet/bnet/protocol/exchange/Exchange.cs index 6e2d5316..e49ae007 100644 --- a/source/D3Proto/bnet/protocol/exchange/Exchange.cs +++ b/src/LibMooNet/bnet/protocol/exchange/Exchange.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.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 @@ -36,7 +41,7 @@ static Exchange() { "KAwSEgoKZXh0cmFfZGF0YRgDIAEoDCI8CgpCbG9iT2ZUeXBlEgwKBHR5cGUY" + "ASACKAkSDAoEZGF0YRgCIAEoDBISCgpleHRyYV9kYXRhGAMgASgMIjwKDkJs" + "b2JGcm9tT2ZUeXBlEg4KBnNvdXJjZRgBIAIoBxIMCgR0eXBlGAIgAigJEgwK" + - "BGRhdGEYAyACKAxCEUIMQ0V4Y2hhbmdlTGligAEB"); + "BGRhdGEYAyACKAxCA4ABAA=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_exchange_PartitionId__Descriptor = Descriptor.MessageTypes[0]; @@ -65,14 +70,20 @@ static Exchange() { } #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 static readonly PartitionId defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override PartitionId ThisMessage { @@ -89,7 +100,7 @@ protected override PartitionId ThisMessage { public const int HighFieldNumber = 1; private bool hasHigh; - private ulong high_ = 0; + private ulong high_; public bool HasHigh { get { return hasHigh; } } @@ -99,7 +110,7 @@ public ulong High { public const int LowFieldNumber = 2; private bool hasLow; - private ulong low_ = 0; + private ulong low_; public bool HasLow { get { return hasLow; } } @@ -115,13 +126,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasHigh) { - output.WriteFixed64(1, High); + string[] field_names = _partitionIdFieldNames; + if (hasHigh) { + output.WriteFixed64(1, field_names[0], High); } - if (HasLow) { - output.WriteFixed64(2, Low); + if (hasLow) { + output.WriteFixed64(2, field_names[1], Low); } UnknownFields.WriteTo(output); } @@ -133,10 +145,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasHigh) { + if (hasHigh) { size += pb::CodedOutputStream.ComputeFixed64Size(1, High); } - if (HasLow) { + if (hasLow) { size += pb::CodedOutputStream.ComputeFixed64Size(2, Low); } size += UnknownFields.SerializedSize; @@ -169,38 +181,72 @@ public static PartitionId ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static PartitionId ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PartitionId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(PartitionId cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - PartitionId result = new PartitionId(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PartitionId(); + 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 +258,11 @@ public override PartitionId DefaultInstanceForType { } public override PartitionId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - PartitionId returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -231,6 +276,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PartitionId other) { if (other == global::bnet.protocol.exchange.PartitionId.DefaultInstance) return this; + PrepareBuilder(); if (other.HasHigh) { High = other.High; } @@ -241,20 +287,31 @@ public override Builder MergeFrom(PartitionId 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -266,53 +323,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: { - High = input.ReadFixed64(); + result.hasHigh = input.ReadFixed64(ref result.high_); break; } case 17: { - Low = input.ReadFixed64(); + result.hasLow = input.ReadFixed64(ref result.low_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasHigh { - get { return result.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; } + 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; @@ -323,14 +389,20 @@ static PartitionId() { } } + [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 static readonly BlobFrom defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override BlobFrom ThisMessage { @@ -347,7 +419,7 @@ protected override BlobFrom ThisMessage { public const int SourceFieldNumber = 1; private bool hasSource; - private uint source_ = 0; + private uint source_; public bool HasSource { get { return hasSource; } } @@ -383,16 +455,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSource) { - output.WriteFixed32(1, Source); + string[] field_names = _blobFromFieldNames; + if (hasSource) { + output.WriteFixed32(1, field_names[2], Source); } - if (HasData) { - output.WriteBytes(2, Data); + if (hasData) { + output.WriteBytes(2, field_names[0], Data); } - if (HasExtraData) { - output.WriteBytes(3, ExtraData); + if (hasExtraData) { + output.WriteBytes(3, field_names[1], ExtraData); } UnknownFields.WriteTo(output); } @@ -404,13 +477,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSource) { + if (hasSource) { size += pb::CodedOutputStream.ComputeFixed32Size(1, Source); } - if (HasData) { + if (hasData) { size += pb::CodedOutputStream.ComputeBytesSize(2, Data); } - if (HasExtraData) { + if (hasExtraData) { size += pb::CodedOutputStream.ComputeBytesSize(3, ExtraData); } size += UnknownFields.SerializedSize; @@ -443,38 +516,72 @@ public static BlobFrom ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static BlobFrom ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static BlobFrom ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(BlobFrom cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - BlobFrom result = new BlobFrom(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new BlobFrom(); + 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 { @@ -486,12 +593,11 @@ public override BlobFrom DefaultInstanceForType { } public override BlobFrom BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - BlobFrom returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -505,6 +611,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(BlobFrom other) { if (other == global::bnet.protocol.exchange.BlobFrom.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSource) { Source = other.Source; } @@ -518,20 +625,31 @@ public override Builder MergeFrom(BlobFrom 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -543,46 +661,53 @@ 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: { - Source = input.ReadFixed32(); + result.hasSource = input.ReadFixed32(ref result.source_); break; } case 18: { - Data = input.ReadBytes(); + result.hasData = input.ReadBytes(ref result.data_); break; } case 26: { - ExtraData = input.ReadBytes(); + result.hasExtraData = input.ReadBytes(ref result.extraData_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSource { - get { return result.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; } + get { return result.hasData; } } public pb::ByteString Data { get { return result.Data; } @@ -590,18 +715,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 bool HasExtraData { - get { return result.HasExtraData; } + get { return result.hasExtraData; } } public pb::ByteString ExtraData { get { return result.ExtraData; } @@ -609,11 +736,13 @@ public bool HasExtraData { } 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; @@ -624,14 +753,20 @@ static BlobFrom() { } } + [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 static readonly BlobOfType defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override BlobOfType ThisMessage { @@ -683,16 +818,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.WriteString(1, Type); + string[] field_names = _blobOfTypeFieldNames; + if (hasType) { + output.WriteString(1, field_names[2], Type); } - if (HasData) { - output.WriteBytes(2, Data); + if (hasData) { + output.WriteBytes(2, field_names[0], Data); } - if (HasExtraData) { - output.WriteBytes(3, ExtraData); + if (hasExtraData) { + output.WriteBytes(3, field_names[1], ExtraData); } UnknownFields.WriteTo(output); } @@ -704,13 +840,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasType) { + if (hasType) { size += pb::CodedOutputStream.ComputeStringSize(1, Type); } - if (HasData) { + if (hasData) { size += pb::CodedOutputStream.ComputeBytesSize(2, Data); } - if (HasExtraData) { + if (hasExtraData) { size += pb::CodedOutputStream.ComputeBytesSize(3, ExtraData); } size += UnknownFields.SerializedSize; @@ -743,38 +879,72 @@ public static BlobOfType ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static BlobOfType ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static BlobOfType ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(BlobOfType cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - BlobOfType result = new BlobOfType(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new BlobOfType(); + 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 { @@ -786,12 +956,11 @@ public override BlobOfType DefaultInstanceForType { } public override BlobOfType BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - BlobOfType returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -805,6 +974,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(BlobOfType other) { if (other == global::bnet.protocol.exchange.BlobOfType.DefaultInstance) return this; + PrepareBuilder(); if (other.HasType) { Type = other.Type; } @@ -818,20 +988,31 @@ public override Builder MergeFrom(BlobOfType 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -843,28 +1024,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: { - Type = input.ReadString(); + result.hasType = input.ReadString(ref result.type_); break; } case 18: { - Data = input.ReadBytes(); + result.hasData = input.ReadBytes(ref result.data_); break; } case 26: { - ExtraData = input.ReadBytes(); + result.hasExtraData = input.ReadBytes(ref result.extraData_); 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; } @@ -872,18 +1058,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 HasData { - get { return result.HasData; } + get { return result.hasData; } } public pb::ByteString Data { get { return result.Data; } @@ -891,18 +1079,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 bool HasExtraData { - get { return result.HasExtraData; } + get { return result.hasExtraData; } } public pb::ByteString ExtraData { get { return result.ExtraData; } @@ -910,11 +1100,13 @@ public bool HasExtraData { } 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; @@ -925,14 +1117,20 @@ static BlobOfType() { } } + [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 static readonly BlobFromOfType defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override BlobFromOfType ThisMessage { @@ -949,7 +1147,7 @@ protected override BlobFromOfType ThisMessage { public const int SourceFieldNumber = 1; private bool hasSource; - private uint source_ = 0; + private uint source_; public bool HasSource { get { return hasSource; } } @@ -986,16 +1184,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSource) { - output.WriteFixed32(1, Source); + string[] field_names = _blobFromOfTypeFieldNames; + if (hasSource) { + output.WriteFixed32(1, field_names[1], Source); } - if (HasType) { - output.WriteString(2, Type); + if (hasType) { + output.WriteString(2, field_names[2], Type); } - if (HasData) { - output.WriteBytes(3, Data); + if (hasData) { + output.WriteBytes(3, field_names[0], Data); } UnknownFields.WriteTo(output); } @@ -1007,13 +1206,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSource) { + if (hasSource) { size += pb::CodedOutputStream.ComputeFixed32Size(1, Source); } - if (HasType) { + if (hasType) { size += pb::CodedOutputStream.ComputeStringSize(2, Type); } - if (HasData) { + if (hasData) { size += pb::CodedOutputStream.ComputeBytesSize(3, Data); } size += UnknownFields.SerializedSize; @@ -1046,38 +1245,72 @@ public static BlobFromOfType ParseDelimitedFrom(global::System.IO.Stream input) 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) { + public static BlobFromOfType ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static BlobFromOfType ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(BlobFromOfType cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - BlobFromOfType result = new BlobFromOfType(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new BlobFromOfType(); + 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 { @@ -1089,12 +1322,11 @@ public override BlobFromOfType DefaultInstanceForType { } public override BlobFromOfType BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - BlobFromOfType returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1108,6 +1340,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(BlobFromOfType other) { if (other == global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSource) { Source = other.Source; } @@ -1121,20 +1354,31 @@ public override Builder MergeFrom(BlobFromOfType 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1146,46 +1390,53 @@ 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: { - Source = input.ReadFixed32(); + result.hasSource = input.ReadFixed32(ref result.source_); break; } case 18: { - Type = input.ReadString(); + result.hasType = input.ReadString(ref result.type_); break; } case 26: { - Data = input.ReadBytes(); + result.hasData = input.ReadBytes(ref result.data_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSource { - get { return result.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; } + get { return result.hasType; } } public string Type { get { return result.Type; } @@ -1193,18 +1444,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 HasData { - get { return result.HasData; } + get { return result.hasData; } } public pb::ByteString Data { get { return result.Data; } @@ -1212,11 +1465,13 @@ 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; @@ -1230,3 +1485,5 @@ static BlobFromOfType() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/exchange/ExchangeService.cs b/src/LibMooNet/bnet/protocol/exchange/ExchangeService.cs similarity index 60% rename from source/D3Proto/bnet/protocol/exchange/ExchangeService.cs rename to src/LibMooNet/bnet/protocol/exchange/ExchangeService.cs index 5de1729a..8681773f 100644 --- a/source/D3Proto/bnet/protocol/exchange/ExchangeService.cs +++ b/src/LibMooNet/bnet/protocol/exchange/ExchangeService.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.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 @@ -55,10 +60,6 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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; @@ -87,6 +88,18 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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_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; #endregion #region Descriptor public static pbd::FileDescriptor Descriptor { @@ -96,195 +109,234 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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="); + "CipzZXJ2aWNlL2V4Y2hhbmdlL2RlZmluaXRpb24vZXhjaGFuZ2UucHJvdG8S" + + "FmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UaJGdvb2dsZS9wcm90b2J1Zi9jc2hh" + + "cnBfb3B0aW9ucy5wcm90bxoRbGliL3JwYy9ycGMucHJvdG8aG2xpYi9wcm90" + + "b2NvbC9leGNoYW5nZS5wcm90bxorbGliL3Byb3RvY29sL2V4Y2hhbmdlX29i" + + "amVjdF9wcm92aWRlci5wcm90bxogbGliL3Byb3RvY29sL2V4Y2hhbmdlX3Jp" + + "c2sucHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJvdG8aMHNlcnZpY2Uv" + + "ZXhjaGFuZ2UvZGVmaW5pdGlvbi9leGNoYW5nZV90eXBlcy5wcm90byKKAQoW" + + "Q3JlYXRlT3JkZXJCb29rUmVxdWVzdBI5CgxwYXJ0aXRpb25faWQYASACKAsy" + + "Iy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBhcnRpdGlvbklkEjUKCm9yZGVy" + + "X2Jvb2sYAiACKAsyIS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLk9yZGVyQm9v" + + "ayIwChdDcmVhdGVPcmRlckJvb2tSZXNwb25zZRIVCg1vcmRlcl9ib29rX2lk" + + "GAEgASgEIpgBChxQbGFjZU9mZmVyT25PcmRlckJvb2tSZXF1ZXN0EjkKDHBh" + + "cnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFy" + + "dGl0aW9uSWQSPQoOb2ZmZXJfY3JlYXRpb24YAiACKAsyJS5ibmV0LnByb3Rv" + + "Y29sLmV4Y2hhbmdlLk9mZmVyQ3JlYXRpb24iSAodUGxhY2VPZmZlck9uT3Jk" + + "ZXJCb29rUmVzcG9uc2USFQoNb3JkZXJfYm9va19pZBgBIAEoBBIQCghvZmZl" + + "cl9pZBgCIAEoBCLbAQooUGxhY2VPZmZlckNyZWF0ZU9yZGVyQm9va0lmTmVl" + + "ZGVkUmVxdWVzdBI5CgxwYXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnByb3Rv" + + "Y29sLmV4Y2hhbmdlLlBhcnRpdGlvbklkEjUKCm9yZGVyX2Jvb2sYAiACKAsy" + + "IS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLk9yZGVyQm9vaxI9Cg5vZmZlcl9j" + + "cmVhdGlvbhgDIAIoCzIlLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuT2ZmZXJD" + + "cmVhdGlvbiJUCilQbGFjZU9mZmVyQ3JlYXRlT3JkZXJCb29rSWZOZWVkZWRS" + + "ZXNwb25zZRIVCg1vcmRlcl9ib29rX2lkGAEgASgEEhAKCG9mZmVyX2lkGAIg" + + "ASgEIpIBChpQbGFjZUJpZE9uT3JkZXJCb29rUmVxdWVzdBI5CgxwYXJ0aXRp" + + "b25faWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBhcnRpdGlv" + + "bklkEjkKDGJpZF9jcmVhdGlvbhgCIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhj" + + "aGFuZ2UuQmlkQ3JlYXRpb24iRAobUGxhY2VCaWRPbk9yZGVyQm9va1Jlc3Bv" + + "bnNlEhUKDW9yZGVyX2Jvb2tfaWQYASABKAQSDgoGYmlkX2lkGAIgASgEItUB" + + "CiZQbGFjZUJpZENyZWF0ZU9yZGVyQm9va0lmTmVlZGVkUmVxdWVzdBI5Cgxw" + + "YXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBh" + + "cnRpdGlvbklkEjUKCm9yZGVyX2Jvb2sYAiACKAsyIS5ibmV0LnByb3RvY29s" + + "LmV4Y2hhbmdlLk9yZGVyQm9vaxI5CgxiaWRfY3JlYXRpb24YAyACKAsyIy5i" + + "bmV0LnByb3RvY29sLmV4Y2hhbmdlLkJpZENyZWF0aW9uIlAKJ1BsYWNlQmlk" + + "Q3JlYXRlT3JkZXJCb29rSWZOZWVkZWRSZXNwb25zZRIVCg1vcmRlcl9ib29r" + + "X2lkGAEgASgEEg4KBmJpZF9pZBgCIAEoBCKoAQodUXVlcnlPZmZlcnNCeU9y" + + "ZGVyQm9va1JlcXVlc3QSOQoMcGFydGl0aW9uX2lkGAEgAigLMiMuYm5ldC5w" + + "cm90b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBI8CgZmaWx0ZXIYAiACKAsy" + + "LC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlF1ZXJ5RmlsdGVyQnlPcmRlcklk" + + "Eg4KBnN0YXR1cxgDIAIoBSJsCh5RdWVyeU9mZmVyc0J5T3JkZXJCb29rUmVz" + + "cG9uc2USNQoGb2ZmZXJzGAEgAygLMiUuYm5ldC5wcm90b2NvbC5leGNoYW5n" + + "ZS5PZmZlckV4dGVuZGVkEhMKC3RvdGFsX2NvdW50GAIgAigNIqYBChtRdWVy" + + "eUJpZHNCeU9yZGVyQm9va1JlcXVlc3QSOQoMcGFydGl0aW9uX2lkGAEgAigL" + + "MiMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBI8CgZmaWx0" + + "ZXIYAiACKAsyLC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlF1ZXJ5RmlsdGVy" + + "QnlPcmRlcklkEg4KBnN0YXR1cxgDIAIoBSJmChxRdWVyeUJpZHNCeU9yZGVy" + + "Qm9va1Jlc3BvbnNlEjEKBGJpZHMYASADKAsyIy5ibmV0LnByb3RvY29sLmV4" + + "Y2hhbmdlLkJpZEV4dGVuZGVkEhMKC3RvdGFsX2NvdW50GAIgAigNItEBCiJR" + + "dWVyeU9mZmVyc0J5QWNjb3VudEZvckl0ZW1SZXF1ZXN0EjoKEGFjY291bnRf" + + "Zm9yX2l0ZW0YASACKAsyIC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkJsb2JG" + + "cm9tEkAKBmZpbHRlchgCIAIoCzIwLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Uu" + + "UXVlcnlGaWx0ZXJCeUNyZWF0ZWRUaW1lEi0KDGJuZXRfYWNjb3VudBgDIAEo" + + "CzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQicQojUXVlcnlPZmZlcnNCeUFj" + + "Y291bnRGb3JJdGVtUmVzcG9uc2USNQoGb2ZmZXJzGAEgAygLMiUuYm5ldC5w" + + "cm90b2NvbC5leGNoYW5nZS5PZmZlckV4dGVuZGVkEhMKC3RvdGFsX2NvdW50" + + "GAIgAigNIs8BCiBRdWVyeUJpZHNCeUFjY291bnRGb3JJdGVtUmVxdWVzdBI6" + + "ChBhY2NvdW50X2Zvcl9pdGVtGAEgAigLMiAuYm5ldC5wcm90b2NvbC5leGNo" + + "YW5nZS5CbG9iRnJvbRJACgZmaWx0ZXIYAiACKAsyMC5ibmV0LnByb3RvY29s" + + "LmV4Y2hhbmdlLlF1ZXJ5RmlsdGVyQnlDcmVhdGVkVGltZRItCgxibmV0X2Fj" + + "Y291bnQYAyABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkImsKIVF1ZXJ5" + + "Qmlkc0J5QWNjb3VudEZvckl0ZW1SZXNwb25zZRIxCgRiaWRzGAEgAygLMiMu" + + "Ym5ldC5wcm90b2NvbC5leGNoYW5nZS5CaWRFeHRlbmRlZBITCgt0b3RhbF9j" + + "b3VudBgCIAIoDSJZCh1RdWVyeU9yZGVyQm9va3NTdW1tYXJ5UmVxdWVzdBI4" + + "CgdoYW5kbGVzGAEgAygLMicuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5PcmRl" + + "ckJvb2tIYW5kbGUiXwoeUXVlcnlPcmRlckJvb2tzU3VtbWFyeVJlc3BvbnNl" + + "Ej0KC29yZGVyX2Jvb2tzGAEgAygLMiguYm5ldC5wcm90b2NvbC5leGNoYW5n" + + "ZS5PcmRlckJvb2tTdW1tYXJ5IrkCCiVTdWJzY3JpYmVPcmRlckJvb2tTdGF0" + + "dXNDaGFuZ2VSZXF1ZXN0EhEKCW9iamVjdF9pZBgBIAIoBBI9ChBtaW5fcGFy" + + "dGl0aW9uX2lkGAIgAigLMiMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0" + + "aXRpb25JZBI9ChBtYXhfcGFydGl0aW9uX2lkGAMgAigLMiMuYm5ldC5wcm90" + + "b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBIPCgdwcm9ncmFtGAQgAigHEg4K" + + "BnN0YXR1cxgFIAIoBRIQCghjdXJyZW5jeRgGIAEoCRISCgpzcGVjaWFsaXN0" + + "GAcgASgFEhEKCWJvb3RzdHJhcBgIIAEoCBIlCh1ib290c3RyYXBfb2xkZXN0" + + "X2NyZWF0ZWRfdGltZRgJIAEoBCIpCidVbnN1YnNjcmliZU9yZGVyQm9va1N0" + + "YXR1c0NoYW5nZVJlcXVlc3QiYQohU3Vic2NyaWJlT3JkZXJTdGF0dXNDaGFu" + + "Z2VSZXF1ZXN0EikKCGFnZW50X2lkGAEgAigLMhcuYm5ldC5wcm90b2NvbC5F" + + "bnRpdHlJZBIRCglvYmplY3RfaWQYAiACKAQiYwojVW5zdWJzY3JpYmVPcmRl" + + "clN0YXR1c0NoYW5nZVJlcXVlc3QSKQoIYWdlbnRfaWQYASACKAsyFy5ibmV0" + + "LnByb3RvY29sLkVudGl0eUlkEhEKCW9iamVjdF9pZBgCIAIoBCKbAQoMQ2xh" + + "aW1SZXF1ZXN0EjkKDHBhcnRpdGlvbl9pZBgBIAEoCzIjLmJuZXQucHJvdG9j" + + "b2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQSEAoIb3JkZXJfaWQYAiABKAQSDwoH" + + "cHJvZ3JhbRgDIAEoBxItCgxibmV0X2FjY291bnQYBCABKAsyFy5ibmV0LnBy" + + "b3RvY29sLkVudGl0eUlkIpsBCg1DYW5jZWxSZXF1ZXN0EjkKDHBhcnRpdGlv" + + "bl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9u" + + "SWQSEAoIb3JkZXJfaWQYAiACKAQSDgoGcmVhc29uGAMgASgNEi0KDGJuZXRf" + + "YWNjb3VudBgEIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQiKgoXR2V0" + + "Q29uZmlndXJhdGlvblJlcXVlc3QSDwoHcHJvZ3JhbRgBIAIoByJVChhHZXRD" + + "b25maWd1cmF0aW9uUmVzcG9uc2USOQoHY29uZmlncxgBIAMoCzIoLmJuZXQu" + + "cHJvdG9jb2wuZXhjaGFuZ2UuU3BlY2lhbGlzdENvbmZpZyKSAQocR2V0T2Zm" + + "ZXJGZWVFc3RpbWF0aW9uUmVxdWVzdBI5CgxwYXJ0aXRpb25faWQYASACKAsy" + + "Iy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBhcnRpdGlvbklkEjcKBGRhdGEY" + + "AiACKAsyKS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkZlZUVzdGltYXRpb25E" + + "YXRhIpABChpHZXRCaWRGZWVFc3RpbWF0aW9uUmVxdWVzdBI5CgxwYXJ0aXRp" + + "b25faWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBhcnRpdGlv" + + "bklkEjcKBGRhdGEYAiACKAsyKS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkZl" + + "ZUVzdGltYXRpb25EYXRhImYKGEdldEZlZUVzdGltYXRpb25SZXNwb25zZRIS" + + "CgpmZWVfYW1vdW50GAEgAigEEjYKC2ZlZV9kZXRhaWxzGAIgAygLMiEuYm5l" + + "dC5wcm90b2NvbC5leGNoYW5nZS5GZWVEZXRhaWwifQocT3JkZXJCb29rTm90" + + "aWZpY2F0aW9uUmVxdWVzdBJECg1ub3RpZmljYXRpb25zGAEgAygLMi0uYm5l" + + "dC5wcm90b2NvbC5leGNoYW5nZS5PcmRlckJvb2tOb3RpZmljYXRpb24SFwoP" + + "Ym9vdF9zdHJhcF9sYXN0GAIgASgIIpUBChhPZmZlck5vdGlmaWNhdGlvblJl" + + "cXVlc3QSNAoFb2ZmZXIYASACKAsyJS5ibmV0LnByb3RvY29sLmV4Y2hhbmdl" + + "Lk9mZmVyRXh0ZW5kZWQSDQoFZXZlbnQYAiACKA0SNAoKZXh0cmFfaW5mbxgD" + + "IAEoCzIgLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQmxvYkZyb20ijwEKFkJp" + + "ZE5vdGlmaWNhdGlvblJlcXVlc3QSMAoDYmlkGAEgAigLMiMuYm5ldC5wcm90" + + "b2NvbC5leGNoYW5nZS5CaWRFeHRlbmRlZBINCgVldmVudBgCIAIoDRI0Cgpl" + + "eHRyYV9pbmZvGAMgASgLMiAuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5CbG9i" + + "RnJvbSLJAQoiUXVlcnlPcmRlcnNCeUFjY291bnRGb3JJdGVtUmVxdWVzdBI6" + + "ChBhY2NvdW50X2Zvcl9pdGVtGAEgAigLMiAuYm5ldC5wcm90b2NvbC5leGNo" + + "YW5nZS5CbG9iRnJvbRItCgxibmV0X2FjY291bnQYAiABKAsyFy5ibmV0LnBy" + + "b3RvY29sLkVudGl0eUlkEjgKBmZpbHRlchgDIAIoCzIoLmJuZXQucHJvdG9j" + + "b2wuZXhjaGFuZ2UuUXVlcnlPcmRlckZpbHRlciJxCiNRdWVyeU9yZGVyc0J5" + + "QWNjb3VudEZvckl0ZW1SZXNwb25zZRI1CgZvcmRlcnMYASADKAsyJS5ibmV0" + + "LnByb3RvY29sLmV4Y2hhbmdlLk9yZGVyRXh0ZW5kZWQSEwoLdG90YWxfY291" + + "bnQYAiACKA0ikgEKFEdldEZlZURldGFpbHNSZXF1ZXN0EjkKDHBhcnRpdGlv" + + "bl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9u" + + "SWQSEAoIb3JkZXJfaWQYAiACKAQSLQoMYm5ldF9hY2NvdW50GAMgASgLMhcu" + + "Ym5ldC5wcm90b2NvbC5FbnRpdHlJZCKOAQoVR2V0RmVlRGV0YWlsc1Jlc3Bv" + + "bnNlEjkKDmZlZV9kZXRhaWxzX2luGAEgAygLMiEuYm5ldC5wcm90b2NvbC5l" + + "eGNoYW5nZS5GZWVEZXRhaWwSOgoPZmVlX2RldGFpbHNfb3V0GAIgAygLMiEu" + + "Ym5ldC5wcm90b2NvbC5leGNoYW5nZS5GZWVEZXRhaWwiqAEKHUdldE9yZGVy" + + "Qm9va1N0YXRpc3RpY3NSZXF1ZXN0EjkKDHBhcnRpdGlvbl9pZBgBIAIoCzIj" + + "LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQSEgoKb3JkZXJf" + + "dHlwZRgCIAIoDRIQCghxdWFudGl0eRgDIAIoBBITCgtsYXN0X3RyYWRlcxgE" + + "IAIoDRIRCglsYXN0X2RheXMYBSACKA0ilAEKHkdldE9yZGVyQm9va1N0YXRp" + + "c3RpY3NSZXNwb25zZRI6Cg1wcmljZV9kZXRhaWxzGAEgAygLMiMuYm5ldC5w" + + "cm90b2NvbC5leGNoYW5nZS5QcmljZURldGFpbBIbChNsYXN0X3RyYWRlc19h" + + "dmVyYWdlGAIgAigEEhkKEWxhc3RfZGF5c19hdmVyYWdlGAMgAigEMrggCg9F" + + "eGNoYW5nZVNlcnZpY2USeAoPQ3JlYXRlT3JkZXJCb29rEi4uYm5ldC5wcm90" + + "b2NvbC5leGNoYW5nZS5DcmVhdGVPcmRlckJvb2tSZXF1ZXN0Gi8uYm5ldC5w" + + "cm90b2NvbC5leGNoYW5nZS5DcmVhdGVPcmRlckJvb2tSZXNwb25zZSIEgLUY" + + "ARKKAQoVUGxhY2VPZmZlck9uT3JkZXJCb29rEjQuYm5ldC5wcm90b2NvbC5l" + + "eGNoYW5nZS5QbGFjZU9mZmVyT25PcmRlckJvb2tSZXF1ZXN0GjUuYm5ldC5w" + + "cm90b2NvbC5leGNoYW5nZS5QbGFjZU9mZmVyT25PcmRlckJvb2tSZXNwb25z" + + "ZSIEgLUYAhKuAQohUGxhY2VPZmZlckNyZWF0ZU9yZGVyQm9va0lmTmVlZGVk" + + "EkAuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QbGFjZU9mZmVyQ3JlYXRlT3Jk" + + "ZXJCb29rSWZOZWVkZWRSZXF1ZXN0GkEuYm5ldC5wcm90b2NvbC5leGNoYW5n" + + "ZS5QbGFjZU9mZmVyQ3JlYXRlT3JkZXJCb29rSWZOZWVkZWRSZXNwb25zZSIE" + + "gLUYAxKEAQoTUGxhY2VCaWRPbk9yZGVyQm9vaxIyLmJuZXQucHJvdG9jb2wu" + + "ZXhjaGFuZ2UuUGxhY2VCaWRPbk9yZGVyQm9va1JlcXVlc3QaMy5ibmV0LnBy" + + "b3RvY29sLmV4Y2hhbmdlLlBsYWNlQmlkT25PcmRlckJvb2tSZXNwb25zZSIE" + + "gLUYBBKoAQofUGxhY2VCaWRDcmVhdGVPcmRlckJvb2tJZk5lZWRlZBI+LmJu" + + "ZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGxhY2VCaWRDcmVhdGVPcmRlckJvb2tJ" + + "Zk5lZWRlZFJlcXVlc3QaPy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBsYWNl" + + "QmlkQ3JlYXRlT3JkZXJCb29rSWZOZWVkZWRSZXNwb25zZSIEgLUYBRKNAQoW" + + "UXVlcnlPZmZlcnNCeU9yZGVyQm9vaxI1LmJuZXQucHJvdG9jb2wuZXhjaGFu" + + "Z2UuUXVlcnlPZmZlcnNCeU9yZGVyQm9va1JlcXVlc3QaNi5ibmV0LnByb3Rv" + + "Y29sLmV4Y2hhbmdlLlF1ZXJ5T2ZmZXJzQnlPcmRlckJvb2tSZXNwb25zZSIE" + + "gLUYBhKHAQoUUXVlcnlCaWRzQnlPcmRlckJvb2sSMy5ibmV0LnByb3RvY29s" + + "LmV4Y2hhbmdlLlF1ZXJ5Qmlkc0J5T3JkZXJCb29rUmVxdWVzdBo0LmJuZXQu" + + "cHJvdG9jb2wuZXhjaGFuZ2UuUXVlcnlCaWRzQnlPcmRlckJvb2tSZXNwb25z" + + "ZSIEgLUYBxKcAQobUXVlcnlPZmZlcnNCeUFjY291bnRGb3JJdGVtEjouYm5l" + + "dC5wcm90b2NvbC5leGNoYW5nZS5RdWVyeU9mZmVyc0J5QWNjb3VudEZvckl0" + + "ZW1SZXF1ZXN0GjsuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5RdWVyeU9mZmVy" + + "c0J5QWNjb3VudEZvckl0ZW1SZXNwb25zZSIEgLUYCBKWAQoZUXVlcnlCaWRz" + + "QnlBY2NvdW50Rm9ySXRlbRI4LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUXVl" + + "cnlCaWRzQnlBY2NvdW50Rm9ySXRlbVJlcXVlc3QaOS5ibmV0LnByb3RvY29s" + + "LmV4Y2hhbmdlLlF1ZXJ5Qmlkc0J5QWNjb3VudEZvckl0ZW1SZXNwb25zZSIE" + + "gLUYCRKNAQoWUXVlcnlPcmRlckJvb2tzU3VtbWFyeRI1LmJuZXQucHJvdG9j" + + "b2wuZXhjaGFuZ2UuUXVlcnlPcmRlckJvb2tzU3VtbWFyeVJlcXVlc3QaNi5i" + + "bmV0LnByb3RvY29sLmV4Y2hhbmdlLlF1ZXJ5T3JkZXJCb29rc1N1bW1hcnlS" + + "ZXNwb25zZSIEgLUYCxJuCg9SZXBvcnRBdXRob3JpemUSPi5ibmV0LnByb3Rv" + + "Y29sLmV4Y2hhbmdlX29iamVjdF9wcm92aWRlci5SZXBvcnRBdXRob3JpemVS" + + "ZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GA0SaAoMUmVwb3J0" + + "U2V0dGxlEjsuYm5ldC5wcm90b2NvbC5leGNoYW5nZV9vYmplY3RfcHJvdmlk" + + "ZXIuUmVwb3J0U2V0dGxlUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRh" + + "IgSAtRgOEmgKDFJlcG9ydENhbmNlbBI7LmJuZXQucHJvdG9jb2wuZXhjaGFu" + + "Z2Vfb2JqZWN0X3Byb3ZpZGVyLlJlcG9ydENhbmNlbFJlcXVlc3QaFS5ibmV0" + + "LnByb3RvY29sLk5vRGF0YSIEgLUYDxJ8Ch5TdWJzY3JpYmVPcmRlckJvb2tT" + + "dGF0dXNDaGFuZ2USPS5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlN1YnNjcmli" + + "ZU9yZGVyQm9va1N0YXR1c0NoYW5nZVJlcXVlc3QaFS5ibmV0LnByb3RvY29s" + + "Lk5vRGF0YSIEgLUYEBKAAQogVW5zdWJzY3JpYmVPcmRlckJvb2tTdGF0dXND" + + "aGFuZ2USPy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlVuc3Vic2NyaWJlT3Jk" + + "ZXJCb29rU3RhdHVzQ2hhbmdlUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9E" + + "YXRhIgSAtRgREnQKGlN1YnNjcmliZU9yZGVyU3RhdHVzQ2hhbmdlEjkuYm5l" + + "dC5wcm90b2NvbC5leGNoYW5nZS5TdWJzY3JpYmVPcmRlclN0YXR1c0NoYW5n" + + "ZVJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYEhJ4ChxVbnN1" + + "YnNjcmliZU9yZGVyU3RhdHVzQ2hhbmdlEjsuYm5ldC5wcm90b2NvbC5leGNo" + + "YW5nZS5VbnN1YnNjcmliZU9yZGVyU3RhdHVzQ2hhbmdlUmVxdWVzdBoVLmJu" + + "ZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgTEp4BChFHZXRQYXltZW50TWV0aG9k" + + "cxJALmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Vfb2JqZWN0X3Byb3ZpZGVyLkdl" + + "dFBheW1lbnRNZXRob2RzUmVxdWVzdBpBLmJuZXQucHJvdG9jb2wuZXhjaGFu" + + "Z2Vfb2JqZWN0X3Byb3ZpZGVyLkdldFBheW1lbnRNZXRob2RzUmVzcG9uc2Ui" + + "BIC1GBQSUQoMQ2xhaW1CaWRJdGVtEiQuYm5ldC5wcm90b2NvbC5leGNoYW5n" + + "ZS5DbGFpbVJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYFRJS" + + "Cg1DbGFpbUJpZE1vbmV5EiQuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5DbGFp" + + "bVJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYFhJTCg5DbGFp" + + "bU9mZmVySXRlbRIkLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQ2xhaW1SZXF1" + + "ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GBcSVAoPQ2xhaW1PZmZl" + + "ck1vbmV5EiQuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5DbGFpbVJlcXVlc3Qa" + + "FS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYGBJPCglDYW5jZWxCaWQSJS5i" + + "bmV0LnByb3RvY29sLmV4Y2hhbmdlLkNhbmNlbFJlcXVlc3QaFS5ibmV0LnBy" + + "b3RvY29sLk5vRGF0YSIEgLUYGRJRCgtDYW5jZWxPZmZlchIlLmJuZXQucHJv" + + "dG9jb2wuZXhjaGFuZ2UuQ2FuY2VsUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wu" + + "Tm9EYXRhIgSAtRgaEnsKEEdldENvbmZpZ3VyYXRpb24SLy5ibmV0LnByb3Rv" + + "Y29sLmV4Y2hhbmdlLkdldENvbmZpZ3VyYXRpb25SZXF1ZXN0GjAuYm5ldC5w" + + "cm90b2NvbC5leGNoYW5nZS5HZXRDb25maWd1cmF0aW9uUmVzcG9uc2UiBIC1" + + "GBsSgQEKE0dldEJpZEZlZUVzdGltYXRpb24SMi5ibmV0LnByb3RvY29sLmV4" + + "Y2hhbmdlLkdldEJpZEZlZUVzdGltYXRpb25SZXF1ZXN0GjAuYm5ldC5wcm90" + + "b2NvbC5leGNoYW5nZS5HZXRGZWVFc3RpbWF0aW9uUmVzcG9uc2UiBIC1GBwS" + + "hQEKFUdldE9mZmVyRmVlRXN0aW1hdGlvbhI0LmJuZXQucHJvdG9jb2wuZXhj" + + "aGFuZ2UuR2V0T2ZmZXJGZWVFc3RpbWF0aW9uUmVxdWVzdBowLmJuZXQucHJv" + + "dG9jb2wuZXhjaGFuZ2UuR2V0RmVlRXN0aW1hdGlvblJlc3BvbnNlIgSAtRgd" + + "EpwBChtRdWVyeU9yZGVyc0J5QWNjb3VudEZvckl0ZW0SOi5ibmV0LnByb3Rv" + + "Y29sLmV4Y2hhbmdlLlF1ZXJ5T3JkZXJzQnlBY2NvdW50Rm9ySXRlbVJlcXVl" + + "c3QaOy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlF1ZXJ5T3JkZXJzQnlBY2Nv" + + "dW50Rm9ySXRlbVJlc3BvbnNlIgSAtRgeEnkKGlJlcG9ydEF1dGhvcml6ZVJp" + + "c2tWZXJkaWN0Ej4uYm5ldC5wcm90b2NvbC5leGNoYW5nZV9yaXNrLlJlcG9y" + + "dEF1dGhvcml6ZVJpc2tWZXJkaWN0UmVxdWVzdBoVLmJuZXQucHJvdG9jb2wu" + + "Tm9EYXRhIgSAtRgfEnMKF1JlcG9ydFNldHRsZVJpc2tWZXJkaWN0EjsuYm5l" + + "dC5wcm90b2NvbC5leGNoYW5nZV9yaXNrLlJlcG9ydFNldHRsZVJpc2tWZXJk" + + "aWN0UmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhIgSAtRggEnEKFkRl" + + "bGF5U2V0dGxlUmlza1ZlcmRpY3QSOi5ibmV0LnByb3RvY29sLmV4Y2hhbmdl" + + "X3Jpc2suRGVsYXlTZXR0bGVSaXNrVmVyZGljdFJlcXVlc3QaFS5ibmV0LnBy" + + "b3RvY29sLk5vRGF0YSIEgLUYIRJyCg1HZXRGZWVEZXRhaWxzEiwuYm5ldC5w" + + "cm90b2NvbC5leGNoYW5nZS5HZXRGZWVEZXRhaWxzUmVxdWVzdBotLmJuZXQu" + + "cHJvdG9jb2wuZXhjaGFuZ2UuR2V0RmVlRGV0YWlsc1Jlc3BvbnNlIgSAtRgi" + + "Eo0BChZHZXRPcmRlckJvb2tTdGF0aXN0aWNzEjUuYm5ldC5wcm90b2NvbC5l" + + "eGNoYW5nZS5HZXRPcmRlckJvb2tTdGF0aXN0aWNzUmVxdWVzdBo2LmJuZXQu" + + "cHJvdG9jb2wuZXhjaGFuZ2UuR2V0T3JkZXJCb29rU3RhdGlzdGljc1Jlc3Bv" + + "bnNlIgSAtRgjMuECCg5FeGNoYW5nZU5vdGlmeRJ1ChtOb3RpZnlPcmRlckJv" + + "b2tTdGF0dXNDaGFuZ2USNC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLk9yZGVy" + + "Qm9va05vdGlmaWNhdGlvblJlcXVlc3QaGi5ibmV0LnByb3RvY29sLk5PX1JF" + + "U1BPTlNFIgSAtRgBEm0KF05vdGlmeU9mZmVyU3RhdHVzQ2hhbmdlEjAuYm5l" + + "dC5wcm90b2NvbC5leGNoYW5nZS5PZmZlck5vdGlmaWNhdGlvblJlcXVlc3Qa" + + "Gi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgCEmkKFU5vdGlmeUJp" + + "ZFN0YXR1c0NoYW5nZRIuLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQmlkTm90" + + "aWZpY2F0aW9uUmVxdWVzdBoaLmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0Ui" + + "BIC1GANCF4ABAMI+ERIPRXhjaGFuZ2VTZXJ2aWNl"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_exchange_CreateOrderBookRequest__Descriptor = Descriptor.MessageTypes[0]; @@ -367,76 +419,93 @@ static ExchangeService() { 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__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", }); - internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__Descriptor = Descriptor.MessageTypes[23]; + 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_SubscribeOrderStatusChangeRequest__Descriptor = Descriptor.MessageTypes[24]; + internal__static_bnet_protocol_exchange_SubscribeOrderStatusChangeRequest__Descriptor = Descriptor.MessageTypes[22]; 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__Descriptor = Descriptor.MessageTypes[23]; 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__Descriptor = Descriptor.MessageTypes[24]; 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]; + new string[] { "PartitionId", "OrderId", "Program", "BnetAccount", }); + internal__static_bnet_protocol_exchange_CancelRequest__Descriptor = Descriptor.MessageTypes[25]; 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__Descriptor = Descriptor.MessageTypes[26]; 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__Descriptor = Descriptor.MessageTypes[27]; 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__Descriptor = Descriptor.MessageTypes[28]; 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__Descriptor = Descriptor.MessageTypes[29]; 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__Descriptor = Descriptor.MessageTypes[30]; 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]; + new string[] { "FeeAmount", "FeeDetails", }); + internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__Descriptor = Descriptor.MessageTypes[31]; 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__Descriptor = Descriptor.MessageTypes[32]; 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]; + new string[] { "Offer", "Event", "ExtraInfo", }); + internal__static_bnet_protocol_exchange_BidNotificationRequest__Descriptor = Descriptor.MessageTypes[33]; internal__static_bnet_protocol_exchange_BidNotificationRequest__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_BidNotificationRequest__Descriptor, - new string[] { "Bid", "Event", }); + new string[] { "Bid", "Event", "ExtraInfo", }); + internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemRequest__Descriptor = Descriptor.MessageTypes[34]; + 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[35]; + 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[36]; + 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[37]; + 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[38]; + 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[39]; + internal__static_bnet_protocol_exchange_GetOrderBookStatisticsResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_GetOrderBookStatisticsResponse__Descriptor, + new string[] { "PriceDetails", "LastTradesAverage", "LastDaysAverage", }); 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.exchange_risk.ExchangeRisk.RegisterAllExtensions(registry); global::bnet.protocol.Entity.RegisterAllExtensions(registry); global::bnet.protocol.exchange.ExchangeTypes.RegisterAllExtensions(registry); return registry; @@ -447,6 +516,7 @@ static ExchangeService() { global::bnet.protocol.Rpc.Descriptor, global::bnet.protocol.exchange.Exchange.Descriptor, global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.Descriptor, + global::bnet.protocol.exchange_risk.ExchangeRisk.Descriptor, global::bnet.protocol.Entity.Descriptor, global::bnet.protocol.exchange.ExchangeTypes.Descriptor, }, assigner); @@ -456,14 +526,20 @@ static ExchangeService() { } } #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 static readonly CreateOrderBookRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override CreateOrderBookRequest ThisMessage { @@ -480,22 +556,22 @@ protected override CreateOrderBookRequest ThisMessage { public const int PartitionIdFieldNumber = 1; private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId partitionId_; public bool HasPartitionId { get { return hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return 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_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; + private global::bnet.protocol.exchange.OrderBook orderBook_; public bool HasOrderBook { get { return hasOrderBook; } } public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return orderBook_; } + get { return orderBook_ ?? global::bnet.protocol.exchange.OrderBook.DefaultInstance; } } public override bool IsInitialized { @@ -508,13 +584,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _createOrderBookRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); } - if (HasOrderBook) { - output.WriteMessage(2, OrderBook); + if (hasOrderBook) { + output.WriteMessage(2, field_names[0], OrderBook); } UnknownFields.WriteTo(output); } @@ -526,10 +603,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { + if (hasPartitionId) { size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasOrderBook) { + if (hasOrderBook) { size += pb::CodedOutputStream.ComputeMessageSize(2, OrderBook); } size += UnknownFields.SerializedSize; @@ -562,38 +639,72 @@ public static CreateOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream 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) { + public static CreateOrderBookRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CreateOrderBookRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(CreateOrderBookRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - CreateOrderBookRequest result = new CreateOrderBookRequest(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new CreateOrderBookRequest(); + 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 { @@ -605,12 +716,11 @@ public override CreateOrderBookRequest DefaultInstanceForType { } public override CreateOrderBookRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - CreateOrderBookRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -624,6 +734,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(CreateOrderBookRequest other) { if (other == global::bnet.protocol.exchange.CreateOrderBookRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasPartitionId) { MergePartitionId(other.PartitionId); } @@ -634,20 +745,31 @@ public override Builder MergeFrom(CreateOrderBookRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -659,12 +781,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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { + if (result.hasPartitionId) { subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -673,7 +795,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); - if (HasOrderBook) { + if (result.hasOrderBook) { subBuilder.MergeFrom(OrderBook); } input.ReadMessage(subBuilder, extensionRegistry); @@ -682,11 +804,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPartitionId { - get { return result.HasPartitionId; } + get { return result.hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { get { return result.PartitionId; } @@ -694,19 +821,22 @@ public bool HasPartitionId { } 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"); - if (result.HasPartitionId && + 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 { @@ -716,13 +846,14 @@ public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value return this; } public Builder ClearPartitionId() { + PrepareBuilder(); result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.partitionId_ = null; return this; } public bool HasOrderBook { - get { return result.HasOrderBook; } + get { return result.hasOrderBook; } } public global::bnet.protocol.exchange.OrderBook OrderBook { get { return result.OrderBook; } @@ -730,19 +861,22 @@ public bool HasOrderBook { } 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"); - if (result.HasOrderBook && + 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 { @@ -752,8 +886,9 @@ public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { return this; } public Builder ClearOrderBook() { + PrepareBuilder(); result.hasOrderBook = false; - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; + result.orderBook_ = null; return this; } } @@ -762,14 +897,20 @@ static CreateOrderBookRequest() { } } + [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 static readonly CreateOrderBookResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override CreateOrderBookResponse ThisMessage { @@ -786,7 +927,7 @@ protected override CreateOrderBookResponse ThisMessage { public const int OrderBookIdFieldNumber = 1; private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; + private ulong orderBookId_; public bool HasOrderBookId { get { return hasOrderBookId; } } @@ -800,10 +941,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOrderBookId) { - output.WriteUInt64(1, OrderBookId); + string[] field_names = _createOrderBookResponseFieldNames; + if (hasOrderBookId) { + output.WriteUInt64(1, field_names[0], OrderBookId); } UnknownFields.WriteTo(output); } @@ -815,7 +957,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOrderBookId) { + if (hasOrderBookId) { size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); } size += UnknownFields.SerializedSize; @@ -848,38 +990,72 @@ public static CreateOrderBookResponse ParseDelimitedFrom(global::System.IO.Strea 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) { + public static CreateOrderBookResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CreateOrderBookResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - CreateOrderBookResponse result = new CreateOrderBookResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override CreateOrderBookResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new CreateOrderBookResponse(); + 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 { @@ -891,12 +1067,11 @@ public override CreateOrderBookResponse DefaultInstanceForType { } public override CreateOrderBookResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - CreateOrderBookResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -910,6 +1085,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(CreateOrderBookResponse other) { if (other == global::bnet.protocol.exchange.CreateOrderBookResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOrderBookId) { OrderBookId = other.OrderBookId; } @@ -917,20 +1093,31 @@ public override Builder MergeFrom(CreateOrderBookResponse 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -942,31 +1129,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; } case 8: { - OrderBookId = input.ReadUInt64(); + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasOrderBookId { - get { return result.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; @@ -977,14 +1171,20 @@ static CreateOrderBookResponse() { } } + [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 static readonly PlaceOfferOnOrderBookRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override PlaceOfferOnOrderBookRequest ThisMessage { @@ -1001,22 +1201,22 @@ protected override PlaceOfferOnOrderBookRequest ThisMessage { public const int PartitionIdFieldNumber = 1; private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId partitionId_; public bool HasPartitionId { get { return hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return 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_ = global::bnet.protocol.exchange.OfferCreation.DefaultInstance; + private global::bnet.protocol.exchange.OfferCreation offerCreation_; public bool HasOfferCreation { get { return hasOfferCreation; } } public global::bnet.protocol.exchange.OfferCreation OfferCreation { - get { return offerCreation_; } + get { return offerCreation_ ?? global::bnet.protocol.exchange.OfferCreation.DefaultInstance; } } public override bool IsInitialized { @@ -1029,13 +1229,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _placeOfferOnOrderBookRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); } - if (HasOfferCreation) { - output.WriteMessage(2, OfferCreation); + if (hasOfferCreation) { + output.WriteMessage(2, field_names[0], OfferCreation); } UnknownFields.WriteTo(output); } @@ -1047,10 +1248,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { + if (hasPartitionId) { size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasOfferCreation) { + if (hasOfferCreation) { size += pb::CodedOutputStream.ComputeMessageSize(2, OfferCreation); } size += UnknownFields.SerializedSize; @@ -1083,38 +1284,72 @@ public static PlaceOfferOnOrderBookRequest ParseDelimitedFrom(global::System.IO. 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) { + public static PlaceOfferOnOrderBookRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PlaceOfferOnOrderBookRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - PlaceOfferOnOrderBookRequest result = new PlaceOfferOnOrderBookRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override PlaceOfferOnOrderBookRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PlaceOfferOnOrderBookRequest(); + 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 { @@ -1126,12 +1361,11 @@ public override PlaceOfferOnOrderBookRequest DefaultInstanceForType { } public override PlaceOfferOnOrderBookRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - PlaceOfferOnOrderBookRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1145,6 +1379,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PlaceOfferOnOrderBookRequest other) { if (other == global::bnet.protocol.exchange.PlaceOfferOnOrderBookRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasPartitionId) { MergePartitionId(other.PartitionId); } @@ -1155,20 +1390,31 @@ public override Builder MergeFrom(PlaceOfferOnOrderBookRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1180,12 +1426,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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { + if (result.hasPartitionId) { subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1194,7 +1440,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.OfferCreation.Builder subBuilder = global::bnet.protocol.exchange.OfferCreation.CreateBuilder(); - if (HasOfferCreation) { + if (result.hasOfferCreation) { subBuilder.MergeFrom(OfferCreation); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1203,11 +1449,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPartitionId { - get { return result.HasPartitionId; } + get { return result.hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { get { return result.PartitionId; } @@ -1215,19 +1466,22 @@ public bool HasPartitionId { } 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"); - if (result.HasPartitionId && + 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 { @@ -1237,13 +1491,14 @@ public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value return this; } public Builder ClearPartitionId() { + PrepareBuilder(); result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.partitionId_ = null; return this; } public bool HasOfferCreation { - get { return result.HasOfferCreation; } + get { return result.hasOfferCreation; } } public global::bnet.protocol.exchange.OfferCreation OfferCreation { get { return result.OfferCreation; } @@ -1251,19 +1506,22 @@ public bool HasOfferCreation { } 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"); - if (result.HasOfferCreation && + 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 { @@ -1273,8 +1531,9 @@ public Builder MergeOfferCreation(global::bnet.protocol.exchange.OfferCreation v return this; } public Builder ClearOfferCreation() { + PrepareBuilder(); result.hasOfferCreation = false; - result.offerCreation_ = global::bnet.protocol.exchange.OfferCreation.DefaultInstance; + result.offerCreation_ = null; return this; } } @@ -1283,14 +1542,20 @@ static PlaceOfferOnOrderBookRequest() { } } + [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 static readonly PlaceOfferOnOrderBookResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override PlaceOfferOnOrderBookResponse ThisMessage { @@ -1307,7 +1572,7 @@ protected override PlaceOfferOnOrderBookResponse ThisMessage { public const int OrderBookIdFieldNumber = 1; private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; + private ulong orderBookId_; public bool HasOrderBookId { get { return hasOrderBookId; } } @@ -1317,7 +1582,7 @@ public ulong OrderBookId { public const int OfferIdFieldNumber = 2; private bool hasOfferId; - private ulong offerId_ = 0UL; + private ulong offerId_; public bool HasOfferId { get { return hasOfferId; } } @@ -1331,13 +1596,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOrderBookId) { - output.WriteUInt64(1, OrderBookId); + string[] field_names = _placeOfferOnOrderBookResponseFieldNames; + if (hasOrderBookId) { + output.WriteUInt64(1, field_names[1], OrderBookId); } - if (HasOfferId) { - output.WriteUInt64(2, OfferId); + if (hasOfferId) { + output.WriteUInt64(2, field_names[0], OfferId); } UnknownFields.WriteTo(output); } @@ -1349,10 +1615,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOrderBookId) { + if (hasOrderBookId) { size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); } - if (HasOfferId) { + if (hasOfferId) { size += pb::CodedOutputStream.ComputeUInt64Size(2, OfferId); } size += UnknownFields.SerializedSize; @@ -1385,38 +1651,72 @@ public static PlaceOfferOnOrderBookResponse ParseDelimitedFrom(global::System.IO 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) { + public static PlaceOfferOnOrderBookResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PlaceOfferOnOrderBookResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(PlaceOfferOnOrderBookResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - PlaceOfferOnOrderBookResponse result = new PlaceOfferOnOrderBookResponse(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PlaceOfferOnOrderBookResponse(); + 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 { @@ -1428,12 +1728,11 @@ public override PlaceOfferOnOrderBookResponse DefaultInstanceForType { } public override PlaceOfferOnOrderBookResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - PlaceOfferOnOrderBookResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1447,6 +1746,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PlaceOfferOnOrderBookResponse other) { if (other == global::bnet.protocol.exchange.PlaceOfferOnOrderBookResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOrderBookId) { OrderBookId = other.OrderBookId; } @@ -1457,20 +1757,31 @@ public override Builder MergeFrom(PlaceOfferOnOrderBookResponse 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1482,53 +1793,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: { - OrderBookId = input.ReadUInt64(); + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); break; } case 16: { - OfferId = input.ReadUInt64(); + result.hasOfferId = input.ReadUInt64(ref result.offerId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasOrderBookId { - get { return result.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; } + 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; @@ -1539,14 +1859,20 @@ static PlaceOfferOnOrderBookResponse() { } } + [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 static readonly PlaceOfferCreateOrderBookIfNeededRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override PlaceOfferCreateOrderBookIfNeededRequest ThisMessage { @@ -1563,32 +1889,32 @@ protected override PlaceOfferCreateOrderBookIfNeededRequest ThisMessage { public const int PartitionIdFieldNumber = 1; private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId partitionId_; public bool HasPartitionId { get { return hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return 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_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; + private global::bnet.protocol.exchange.OrderBook orderBook_; public bool HasOrderBook { get { return hasOrderBook; } } public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return 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_ = global::bnet.protocol.exchange.OfferCreation.DefaultInstance; + private global::bnet.protocol.exchange.OfferCreation offerCreation_; public bool HasOfferCreation { get { return hasOfferCreation; } } public global::bnet.protocol.exchange.OfferCreation OfferCreation { - get { return offerCreation_; } + get { return offerCreation_ ?? global::bnet.protocol.exchange.OfferCreation.DefaultInstance; } } public override bool IsInitialized { @@ -1603,16 +1929,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _placeOfferCreateOrderBookIfNeededRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[2], PartitionId); } - if (HasOrderBook) { - output.WriteMessage(2, OrderBook); + if (hasOrderBook) { + output.WriteMessage(2, field_names[1], OrderBook); } - if (HasOfferCreation) { - output.WriteMessage(3, OfferCreation); + if (hasOfferCreation) { + output.WriteMessage(3, field_names[0], OfferCreation); } UnknownFields.WriteTo(output); } @@ -1624,13 +1951,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { + if (hasPartitionId) { size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasOrderBook) { + if (hasOrderBook) { size += pb::CodedOutputStream.ComputeMessageSize(2, OrderBook); } - if (HasOfferCreation) { + if (hasOfferCreation) { size += pb::CodedOutputStream.ComputeMessageSize(3, OfferCreation); } size += UnknownFields.SerializedSize; @@ -1663,38 +1990,72 @@ public static PlaceOfferCreateOrderBookIfNeededRequest ParseDelimitedFrom(global 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) { + public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PlaceOfferCreateOrderBookIfNeededRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - PlaceOfferCreateOrderBookIfNeededRequest result = new PlaceOfferCreateOrderBookIfNeededRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override PlaceOfferCreateOrderBookIfNeededRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PlaceOfferCreateOrderBookIfNeededRequest(); + 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 { @@ -1706,12 +2067,11 @@ public override PlaceOfferCreateOrderBookIfNeededRequest DefaultInstanceForType } public override PlaceOfferCreateOrderBookIfNeededRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - PlaceOfferCreateOrderBookIfNeededRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1725,6 +2085,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PlaceOfferCreateOrderBookIfNeededRequest other) { if (other == global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasPartitionId) { MergePartitionId(other.PartitionId); } @@ -1738,20 +2099,31 @@ public override Builder MergeFrom(PlaceOfferCreateOrderBookIfNeededRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1763,12 +2135,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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { + if (result.hasPartitionId) { subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1777,7 +2149,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); - if (HasOrderBook) { + if (result.hasOrderBook) { subBuilder.MergeFrom(OrderBook); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1786,7 +2158,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.exchange.OfferCreation.Builder subBuilder = global::bnet.protocol.exchange.OfferCreation.CreateBuilder(); - if (HasOfferCreation) { + if (result.hasOfferCreation) { subBuilder.MergeFrom(OfferCreation); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1795,11 +2167,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPartitionId { - get { return result.HasPartitionId; } + get { return result.hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { get { return result.PartitionId; } @@ -1807,19 +2184,22 @@ public bool HasPartitionId { } 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"); - if (result.HasPartitionId && + 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 { @@ -1829,13 +2209,14 @@ public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value return this; } public Builder ClearPartitionId() { + PrepareBuilder(); result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.partitionId_ = null; return this; } public bool HasOrderBook { - get { return result.HasOrderBook; } + get { return result.hasOrderBook; } } public global::bnet.protocol.exchange.OrderBook OrderBook { get { return result.OrderBook; } @@ -1843,19 +2224,22 @@ public bool HasOrderBook { } 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"); - if (result.HasOrderBook && + 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 { @@ -1865,13 +2249,14 @@ public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { return this; } public Builder ClearOrderBook() { + PrepareBuilder(); result.hasOrderBook = false; - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; + result.orderBook_ = null; return this; } public bool HasOfferCreation { - get { return result.HasOfferCreation; } + get { return result.hasOfferCreation; } } public global::bnet.protocol.exchange.OfferCreation OfferCreation { get { return result.OfferCreation; } @@ -1879,19 +2264,22 @@ public bool HasOfferCreation { } 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"); - if (result.HasOfferCreation && + 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 { @@ -1901,8 +2289,9 @@ public Builder MergeOfferCreation(global::bnet.protocol.exchange.OfferCreation v return this; } public Builder ClearOfferCreation() { + PrepareBuilder(); result.hasOfferCreation = false; - result.offerCreation_ = global::bnet.protocol.exchange.OfferCreation.DefaultInstance; + result.offerCreation_ = null; return this; } } @@ -1911,14 +2300,20 @@ static PlaceOfferCreateOrderBookIfNeededRequest() { } } + [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 static readonly PlaceOfferCreateOrderBookIfNeededResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override PlaceOfferCreateOrderBookIfNeededResponse ThisMessage { @@ -1935,7 +2330,7 @@ protected override PlaceOfferCreateOrderBookIfNeededResponse ThisMessage { public const int OrderBookIdFieldNumber = 1; private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; + private ulong orderBookId_; public bool HasOrderBookId { get { return hasOrderBookId; } } @@ -1945,7 +2340,7 @@ public ulong OrderBookId { public const int OfferIdFieldNumber = 2; private bool hasOfferId; - private ulong offerId_ = 0UL; + private ulong offerId_; public bool HasOfferId { get { return hasOfferId; } } @@ -1959,13 +2354,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOrderBookId) { - output.WriteUInt64(1, OrderBookId); + string[] field_names = _placeOfferCreateOrderBookIfNeededResponseFieldNames; + if (hasOrderBookId) { + output.WriteUInt64(1, field_names[1], OrderBookId); } - if (HasOfferId) { - output.WriteUInt64(2, OfferId); + if (hasOfferId) { + output.WriteUInt64(2, field_names[0], OfferId); } UnknownFields.WriteTo(output); } @@ -1977,10 +2373,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOrderBookId) { + if (hasOrderBookId) { size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); } - if (HasOfferId) { + if (hasOfferId) { size += pb::CodedOutputStream.ComputeUInt64Size(2, OfferId); } size += UnknownFields.SerializedSize; @@ -2013,38 +2409,72 @@ public static PlaceOfferCreateOrderBookIfNeededResponse ParseDelimitedFrom(globa 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) { + public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PlaceOfferCreateOrderBookIfNeededResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - PlaceOfferCreateOrderBookIfNeededResponse result = new PlaceOfferCreateOrderBookIfNeededResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override PlaceOfferCreateOrderBookIfNeededResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PlaceOfferCreateOrderBookIfNeededResponse(); + 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 { @@ -2056,12 +2486,11 @@ public override PlaceOfferCreateOrderBookIfNeededResponse DefaultInstanceForType } public override PlaceOfferCreateOrderBookIfNeededResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - PlaceOfferCreateOrderBookIfNeededResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2075,6 +2504,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PlaceOfferCreateOrderBookIfNeededResponse other) { if (other == global::bnet.protocol.exchange.PlaceOfferCreateOrderBookIfNeededResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOrderBookId) { OrderBookId = other.OrderBookId; } @@ -2085,20 +2515,31 @@ public override Builder MergeFrom(PlaceOfferCreateOrderBookIfNeededResponse othe 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2110,53 +2551,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: { - OrderBookId = input.ReadUInt64(); + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); break; } case 16: { - OfferId = input.ReadUInt64(); + result.hasOfferId = input.ReadUInt64(ref result.offerId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasOrderBookId { - get { return result.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; } + 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; @@ -2167,14 +2617,20 @@ static PlaceOfferCreateOrderBookIfNeededResponse() { } } + [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 static readonly PlaceBidOnOrderBookRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override PlaceBidOnOrderBookRequest ThisMessage { @@ -2191,22 +2647,22 @@ protected override PlaceBidOnOrderBookRequest ThisMessage { public const int PartitionIdFieldNumber = 1; private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId partitionId_; public bool HasPartitionId { get { return hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return 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_ = global::bnet.protocol.exchange.BidCreation.DefaultInstance; + private global::bnet.protocol.exchange.BidCreation bidCreation_; public bool HasBidCreation { get { return hasBidCreation; } } public global::bnet.protocol.exchange.BidCreation BidCreation { - get { return bidCreation_; } + get { return bidCreation_ ?? global::bnet.protocol.exchange.BidCreation.DefaultInstance; } } public override bool IsInitialized { @@ -2219,13 +2675,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _placeBidOnOrderBookRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); } - if (HasBidCreation) { - output.WriteMessage(2, BidCreation); + if (hasBidCreation) { + output.WriteMessage(2, field_names[0], BidCreation); } UnknownFields.WriteTo(output); } @@ -2237,10 +2694,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { + if (hasPartitionId) { size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasBidCreation) { + if (hasBidCreation) { size += pb::CodedOutputStream.ComputeMessageSize(2, BidCreation); } size += UnknownFields.SerializedSize; @@ -2273,38 +2730,72 @@ public static PlaceBidOnOrderBookRequest ParseDelimitedFrom(global::System.IO.St 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) { + public static PlaceBidOnOrderBookRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PlaceBidOnOrderBookRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - PlaceBidOnOrderBookRequest result = new PlaceBidOnOrderBookRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override PlaceBidOnOrderBookRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PlaceBidOnOrderBookRequest(); + 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 { @@ -2316,12 +2807,11 @@ public override PlaceBidOnOrderBookRequest DefaultInstanceForType { } public override PlaceBidOnOrderBookRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - PlaceBidOnOrderBookRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2335,6 +2825,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PlaceBidOnOrderBookRequest other) { if (other == global::bnet.protocol.exchange.PlaceBidOnOrderBookRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasPartitionId) { MergePartitionId(other.PartitionId); } @@ -2345,20 +2836,31 @@ public override Builder MergeFrom(PlaceBidOnOrderBookRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2370,12 +2872,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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { + if (result.hasPartitionId) { subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2384,7 +2886,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.BidCreation.Builder subBuilder = global::bnet.protocol.exchange.BidCreation.CreateBuilder(); - if (HasBidCreation) { + if (result.hasBidCreation) { subBuilder.MergeFrom(BidCreation); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2393,11 +2895,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPartitionId { - get { return result.HasPartitionId; } + get { return result.hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { get { return result.PartitionId; } @@ -2405,19 +2912,22 @@ public bool HasPartitionId { } 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"); - if (result.HasPartitionId && + 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 { @@ -2427,13 +2937,14 @@ public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value return this; } public Builder ClearPartitionId() { + PrepareBuilder(); result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.partitionId_ = null; return this; } public bool HasBidCreation { - get { return result.HasBidCreation; } + get { return result.hasBidCreation; } } public global::bnet.protocol.exchange.BidCreation BidCreation { get { return result.BidCreation; } @@ -2441,19 +2952,22 @@ public bool HasBidCreation { } 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"); - if (result.HasBidCreation && + 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 { @@ -2463,8 +2977,9 @@ public Builder MergeBidCreation(global::bnet.protocol.exchange.BidCreation value return this; } public Builder ClearBidCreation() { + PrepareBuilder(); result.hasBidCreation = false; - result.bidCreation_ = global::bnet.protocol.exchange.BidCreation.DefaultInstance; + result.bidCreation_ = null; return this; } } @@ -2473,14 +2988,20 @@ static PlaceBidOnOrderBookRequest() { } } + [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 static readonly PlaceBidOnOrderBookResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override PlaceBidOnOrderBookResponse ThisMessage { @@ -2497,7 +3018,7 @@ protected override PlaceBidOnOrderBookResponse ThisMessage { public const int OrderBookIdFieldNumber = 1; private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; + private ulong orderBookId_; public bool HasOrderBookId { get { return hasOrderBookId; } } @@ -2507,7 +3028,7 @@ public ulong OrderBookId { public const int BidIdFieldNumber = 2; private bool hasBidId; - private ulong bidId_ = 0UL; + private ulong bidId_; public bool HasBidId { get { return hasBidId; } } @@ -2521,13 +3042,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOrderBookId) { - output.WriteUInt64(1, OrderBookId); + string[] field_names = _placeBidOnOrderBookResponseFieldNames; + if (hasOrderBookId) { + output.WriteUInt64(1, field_names[1], OrderBookId); } - if (HasBidId) { - output.WriteUInt64(2, BidId); + if (hasBidId) { + output.WriteUInt64(2, field_names[0], BidId); } UnknownFields.WriteTo(output); } @@ -2539,10 +3061,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOrderBookId) { + if (hasOrderBookId) { size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); } - if (HasBidId) { + if (hasBidId) { size += pb::CodedOutputStream.ComputeUInt64Size(2, BidId); } size += UnknownFields.SerializedSize; @@ -2575,38 +3097,72 @@ public static PlaceBidOnOrderBookResponse ParseDelimitedFrom(global::System.IO.S 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) { + public static PlaceBidOnOrderBookResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PlaceBidOnOrderBookResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - PlaceBidOnOrderBookResponse result = new PlaceBidOnOrderBookResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override PlaceBidOnOrderBookResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PlaceBidOnOrderBookResponse(); + 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 { @@ -2618,12 +3174,11 @@ public override PlaceBidOnOrderBookResponse DefaultInstanceForType { } public override PlaceBidOnOrderBookResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - PlaceBidOnOrderBookResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2637,6 +3192,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PlaceBidOnOrderBookResponse other) { if (other == global::bnet.protocol.exchange.PlaceBidOnOrderBookResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOrderBookId) { OrderBookId = other.OrderBookId; } @@ -2647,20 +3203,31 @@ public override Builder MergeFrom(PlaceBidOnOrderBookResponse 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2672,53 +3239,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: { - OrderBookId = input.ReadUInt64(); + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); break; } case 16: { - BidId = input.ReadUInt64(); + result.hasBidId = input.ReadUInt64(ref result.bidId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasOrderBookId { - get { return result.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; } + 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; @@ -2729,14 +3305,20 @@ static PlaceBidOnOrderBookResponse() { } } + [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 static readonly PlaceBidCreateOrderBookIfNeededRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override PlaceBidCreateOrderBookIfNeededRequest ThisMessage { @@ -2753,32 +3335,32 @@ protected override PlaceBidCreateOrderBookIfNeededRequest ThisMessage { public const int PartitionIdFieldNumber = 1; private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId partitionId_; public bool HasPartitionId { get { return hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return 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_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; + private global::bnet.protocol.exchange.OrderBook orderBook_; public bool HasOrderBook { get { return hasOrderBook; } } public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return 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_ = global::bnet.protocol.exchange.BidCreation.DefaultInstance; + private global::bnet.protocol.exchange.BidCreation bidCreation_; public bool HasBidCreation { get { return hasBidCreation; } } public global::bnet.protocol.exchange.BidCreation BidCreation { - get { return bidCreation_; } + get { return bidCreation_ ?? global::bnet.protocol.exchange.BidCreation.DefaultInstance; } } public override bool IsInitialized { @@ -2793,16 +3375,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _placeBidCreateOrderBookIfNeededRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[2], PartitionId); } - if (HasOrderBook) { - output.WriteMessage(2, OrderBook); + if (hasOrderBook) { + output.WriteMessage(2, field_names[1], OrderBook); } - if (HasBidCreation) { - output.WriteMessage(3, BidCreation); + if (hasBidCreation) { + output.WriteMessage(3, field_names[0], BidCreation); } UnknownFields.WriteTo(output); } @@ -2814,13 +3397,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { + if (hasPartitionId) { size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasOrderBook) { + if (hasOrderBook) { size += pb::CodedOutputStream.ComputeMessageSize(2, OrderBook); } - if (HasBidCreation) { + if (hasBidCreation) { size += pb::CodedOutputStream.ComputeMessageSize(3, BidCreation); } size += UnknownFields.SerializedSize; @@ -2853,38 +3436,72 @@ public static PlaceBidCreateOrderBookIfNeededRequest ParseDelimitedFrom(global:: 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) { + public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PlaceBidCreateOrderBookIfNeededRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - PlaceBidCreateOrderBookIfNeededRequest result = new PlaceBidCreateOrderBookIfNeededRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override PlaceBidCreateOrderBookIfNeededRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PlaceBidCreateOrderBookIfNeededRequest(); + 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 { @@ -2896,12 +3513,11 @@ public override PlaceBidCreateOrderBookIfNeededRequest DefaultInstanceForType { } public override PlaceBidCreateOrderBookIfNeededRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - PlaceBidCreateOrderBookIfNeededRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2915,6 +3531,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PlaceBidCreateOrderBookIfNeededRequest other) { if (other == global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasPartitionId) { MergePartitionId(other.PartitionId); } @@ -2928,20 +3545,31 @@ public override Builder MergeFrom(PlaceBidCreateOrderBookIfNeededRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2953,12 +3581,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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { + if (result.hasPartitionId) { subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2967,7 +3595,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); - if (HasOrderBook) { + if (result.hasOrderBook) { subBuilder.MergeFrom(OrderBook); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2976,7 +3604,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.exchange.BidCreation.Builder subBuilder = global::bnet.protocol.exchange.BidCreation.CreateBuilder(); - if (HasBidCreation) { + if (result.hasBidCreation) { subBuilder.MergeFrom(BidCreation); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2985,11 +3613,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPartitionId { - get { return result.HasPartitionId; } + get { return result.hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { get { return result.PartitionId; } @@ -2997,19 +3630,22 @@ public bool HasPartitionId { } 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"); - if (result.HasPartitionId && + 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 { @@ -3019,13 +3655,14 @@ public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value return this; } public Builder ClearPartitionId() { + PrepareBuilder(); result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.partitionId_ = null; return this; } public bool HasOrderBook { - get { return result.HasOrderBook; } + get { return result.hasOrderBook; } } public global::bnet.protocol.exchange.OrderBook OrderBook { get { return result.OrderBook; } @@ -3033,19 +3670,22 @@ public bool HasOrderBook { } 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"); - if (result.HasOrderBook && + 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 { @@ -3055,13 +3695,14 @@ public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { return this; } public Builder ClearOrderBook() { + PrepareBuilder(); result.hasOrderBook = false; - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; + result.orderBook_ = null; return this; } public bool HasBidCreation { - get { return result.HasBidCreation; } + get { return result.hasBidCreation; } } public global::bnet.protocol.exchange.BidCreation BidCreation { get { return result.BidCreation; } @@ -3069,19 +3710,22 @@ public bool HasBidCreation { } 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"); - if (result.HasBidCreation && + 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 { @@ -3091,8 +3735,9 @@ public Builder MergeBidCreation(global::bnet.protocol.exchange.BidCreation value return this; } public Builder ClearBidCreation() { + PrepareBuilder(); result.hasBidCreation = false; - result.bidCreation_ = global::bnet.protocol.exchange.BidCreation.DefaultInstance; + result.bidCreation_ = null; return this; } } @@ -3101,14 +3746,20 @@ static PlaceBidCreateOrderBookIfNeededRequest() { } } + [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 static readonly PlaceBidCreateOrderBookIfNeededResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override PlaceBidCreateOrderBookIfNeededResponse ThisMessage { @@ -3125,7 +3776,7 @@ protected override PlaceBidCreateOrderBookIfNeededResponse ThisMessage { public const int OrderBookIdFieldNumber = 1; private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; + private ulong orderBookId_; public bool HasOrderBookId { get { return hasOrderBookId; } } @@ -3135,7 +3786,7 @@ public ulong OrderBookId { public const int BidIdFieldNumber = 2; private bool hasBidId; - private ulong bidId_ = 0UL; + private ulong bidId_; public bool HasBidId { get { return hasBidId; } } @@ -3149,13 +3800,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOrderBookId) { - output.WriteUInt64(1, OrderBookId); + string[] field_names = _placeBidCreateOrderBookIfNeededResponseFieldNames; + if (hasOrderBookId) { + output.WriteUInt64(1, field_names[1], OrderBookId); } - if (HasBidId) { - output.WriteUInt64(2, BidId); + if (hasBidId) { + output.WriteUInt64(2, field_names[0], BidId); } UnknownFields.WriteTo(output); } @@ -3167,10 +3819,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOrderBookId) { + if (hasOrderBookId) { size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); } - if (HasBidId) { + if (hasBidId) { size += pb::CodedOutputStream.ComputeUInt64Size(2, BidId); } size += UnknownFields.SerializedSize; @@ -3203,38 +3855,72 @@ public static PlaceBidCreateOrderBookIfNeededResponse ParseDelimitedFrom(global: 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) { + public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PlaceBidCreateOrderBookIfNeededResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - PlaceBidCreateOrderBookIfNeededResponse result = new PlaceBidCreateOrderBookIfNeededResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override PlaceBidCreateOrderBookIfNeededResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PlaceBidCreateOrderBookIfNeededResponse(); + 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 { @@ -3246,12 +3932,11 @@ public override PlaceBidCreateOrderBookIfNeededResponse DefaultInstanceForType { } public override PlaceBidCreateOrderBookIfNeededResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - PlaceBidCreateOrderBookIfNeededResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3265,6 +3950,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PlaceBidCreateOrderBookIfNeededResponse other) { if (other == global::bnet.protocol.exchange.PlaceBidCreateOrderBookIfNeededResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOrderBookId) { OrderBookId = other.OrderBookId; } @@ -3275,20 +3961,31 @@ public override Builder MergeFrom(PlaceBidCreateOrderBookIfNeededResponse 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3300,53 +3997,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: { - OrderBookId = input.ReadUInt64(); + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); break; } case 16: { - BidId = input.ReadUInt64(); + result.hasBidId = input.ReadUInt64(ref result.bidId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasOrderBookId { - get { return result.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; } + 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; @@ -3357,14 +4063,20 @@ static PlaceBidCreateOrderBookIfNeededResponse() { } } + [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 static readonly QueryOffersByOrderBookRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override QueryOffersByOrderBookRequest ThisMessage { @@ -3381,27 +4093,27 @@ protected override QueryOffersByOrderBookRequest ThisMessage { public const int PartitionIdFieldNumber = 1; private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId partitionId_; public bool HasPartitionId { get { return hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return 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_ = global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; + private global::bnet.protocol.exchange.QueryFilterByOrderId filter_; public bool HasFilter { get { return hasFilter; } } public global::bnet.protocol.exchange.QueryFilterByOrderId Filter { - get { return filter_; } + get { return filter_ ?? global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; } } public const int StatusFieldNumber = 3; private bool hasStatus; - private int status_ = 0; + private int status_; public bool HasStatus { get { return hasStatus; } } @@ -3420,16 +4132,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _queryOffersByOrderBookRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); } - if (HasFilter) { - output.WriteMessage(2, Filter); + if (hasFilter) { + output.WriteMessage(2, field_names[0], Filter); } - if (HasStatus) { - output.WriteInt32(3, Status); + if (hasStatus) { + output.WriteInt32(3, field_names[2], Status); } UnknownFields.WriteTo(output); } @@ -3441,13 +4154,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { + if (hasPartitionId) { size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasFilter) { + if (hasFilter) { size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); } - if (HasStatus) { + if (hasStatus) { size += pb::CodedOutputStream.ComputeInt32Size(3, Status); } size += UnknownFields.SerializedSize; @@ -3480,38 +4193,72 @@ public static QueryOffersByOrderBookRequest ParseDelimitedFrom(global::System.IO 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) { + public static QueryOffersByOrderBookRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryOffersByOrderBookRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - QueryOffersByOrderBookRequest result = new QueryOffersByOrderBookRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override QueryOffersByOrderBookRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QueryOffersByOrderBookRequest(); + 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 { @@ -3523,12 +4270,11 @@ public override QueryOffersByOrderBookRequest DefaultInstanceForType { } public override QueryOffersByOrderBookRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - QueryOffersByOrderBookRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3542,6 +4288,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QueryOffersByOrderBookRequest other) { if (other == global::bnet.protocol.exchange.QueryOffersByOrderBookRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasPartitionId) { MergePartitionId(other.PartitionId); } @@ -3555,20 +4302,31 @@ public override Builder MergeFrom(QueryOffersByOrderBookRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3580,12 +4338,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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { + if (result.hasPartitionId) { subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3594,7 +4352,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.QueryFilterByOrderId.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByOrderId.CreateBuilder(); - if (HasFilter) { + if (result.hasFilter) { subBuilder.MergeFrom(Filter); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3602,16 +4360,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 24: { - Status = input.ReadInt32(); + result.hasStatus = input.ReadInt32(ref result.status_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPartitionId { - get { return result.HasPartitionId; } + get { return result.hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { get { return result.PartitionId; } @@ -3619,19 +4382,22 @@ public bool HasPartitionId { } 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"); - if (result.HasPartitionId && + 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 { @@ -3641,13 +4407,14 @@ public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value return this; } public Builder ClearPartitionId() { + PrepareBuilder(); result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.partitionId_ = null; return this; } public bool HasFilter { - get { return result.HasFilter; } + get { return result.hasFilter; } } public global::bnet.protocol.exchange.QueryFilterByOrderId Filter { get { return result.Filter; } @@ -3655,19 +4422,22 @@ public bool HasFilter { } 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"); - if (result.HasFilter && + 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 { @@ -3677,24 +4447,27 @@ public Builder MergeFilter(global::bnet.protocol.exchange.QueryFilterByOrderId v return this; } public Builder ClearFilter() { + PrepareBuilder(); result.hasFilter = false; - result.filter_ = global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; + result.filter_ = null; return this; } public bool HasStatus { - get { return result.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; @@ -3705,14 +4478,20 @@ static QueryOffersByOrderBookRequest() { } } + [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 static readonly QueryOffersByOrderBookResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override QueryOffersByOrderBookResponse ThisMessage { @@ -3741,7 +4520,7 @@ public int OffersCount { public const int TotalCountFieldNumber = 2; private bool hasTotalCount; - private uint totalCount_ = 0; + private uint totalCount_; public bool HasTotalCount { get { return hasTotalCount; } } @@ -3759,13 +4538,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.exchange.OfferExtended element in OffersList) { - output.WriteMessage(1, element); + string[] field_names = _queryOffersByOrderBookResponseFieldNames; + if (offers_.Count > 0) { + output.WriteMessageArray(1, field_names[0], offers_); } - if (HasTotalCount) { - output.WriteUInt32(2, TotalCount); + if (hasTotalCount) { + output.WriteUInt32(2, field_names[1], TotalCount); } UnknownFields.WriteTo(output); } @@ -3780,7 +4560,7 @@ public override int SerializedSize { foreach (global::bnet.protocol.exchange.OfferExtended element in OffersList) { size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasTotalCount) { + if (hasTotalCount) { size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalCount); } size += UnknownFields.SerializedSize; @@ -3813,38 +4593,73 @@ public static QueryOffersByOrderBookResponse ParseDelimitedFrom(global::System.I 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) { + public static QueryOffersByOrderBookResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryOffersByOrderBookResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - QueryOffersByOrderBookResponse result = new QueryOffersByOrderBookResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override QueryOffersByOrderBookResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QueryOffersByOrderBookResponse(); + 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 { @@ -3856,13 +4671,11 @@ public override QueryOffersByOrderBookResponse DefaultInstanceForType { } public override QueryOffersByOrderBookResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.offers_.MakeReadOnly(); - QueryOffersByOrderBookResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3876,8 +4689,9 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QueryOffersByOrderBookResponse other) { if (other == global::bnet.protocol.exchange.QueryOffersByOrderBookResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.offers_.Count != 0) { - base.AddRange(other.offers_, result.offers_); + result.offers_.Add(other.offers_); } if (other.HasTotalCount) { TotalCount = other.TotalCount; @@ -3886,22 +4700,33 @@ public override Builder MergeFrom(QueryOffersByOrderBookResponse 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(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); + uint tag; + 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); } - return this; + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; } - default: { + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { if (pb::WireFormat.IsEndGroupTag(tag)) { if (unknownFields != null) { this.UnknownFields = unknownFields.Build(); @@ -3911,26 +4736,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.exchange.OfferExtended.Builder subBuilder = global::bnet.protocol.exchange.OfferExtended.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddOffers(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.offers_, global::bnet.protocol.exchange.OfferExtended.DefaultInstance, extensionRegistry); break; } case 16: { - TotalCount = input.ReadUInt32(); + result.hasTotalCount = input.ReadUInt32(ref result.totalCount_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList OffersList { - get { return result.offers_; } + get { return PrepareBuilder().offers_; } } public int OffersCount { get { return result.OffersCount; } @@ -3940,46 +4768,54 @@ public int OffersCount { } 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) { - base.AddRange(values, result.offers_); + PrepareBuilder(); + result.offers_.Add(values); return this; } public Builder ClearOffers() { + PrepareBuilder(); result.offers_.Clear(); return this; } public bool HasTotalCount { - get { return result.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; @@ -3990,14 +4826,20 @@ static QueryOffersByOrderBookResponse() { } } + [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 static readonly QueryBidsByOrderBookRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override QueryBidsByOrderBookRequest ThisMessage { @@ -4014,27 +4856,27 @@ protected override QueryBidsByOrderBookRequest ThisMessage { public const int PartitionIdFieldNumber = 1; private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId partitionId_; public bool HasPartitionId { get { return hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return 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_ = global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; + private global::bnet.protocol.exchange.QueryFilterByOrderId filter_; public bool HasFilter { get { return hasFilter; } } public global::bnet.protocol.exchange.QueryFilterByOrderId Filter { - get { return filter_; } + get { return filter_ ?? global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; } } public const int StatusFieldNumber = 3; private bool hasStatus; - private int status_ = 0; + private int status_; public bool HasStatus { get { return hasStatus; } } @@ -4053,16 +4895,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _queryBidsByOrderBookRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); } - if (HasFilter) { - output.WriteMessage(2, Filter); + if (hasFilter) { + output.WriteMessage(2, field_names[0], Filter); } - if (HasStatus) { - output.WriteInt32(3, Status); + if (hasStatus) { + output.WriteInt32(3, field_names[2], Status); } UnknownFields.WriteTo(output); } @@ -4074,13 +4917,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { + if (hasPartitionId) { size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasFilter) { + if (hasFilter) { size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); } - if (HasStatus) { + if (hasStatus) { size += pb::CodedOutputStream.ComputeInt32Size(3, Status); } size += UnknownFields.SerializedSize; @@ -4113,38 +4956,72 @@ public static QueryBidsByOrderBookRequest ParseDelimitedFrom(global::System.IO.S 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) { + public static QueryBidsByOrderBookRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryBidsByOrderBookRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(QueryBidsByOrderBookRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - QueryBidsByOrderBookRequest result = new QueryBidsByOrderBookRequest(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QueryBidsByOrderBookRequest(); + 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 { @@ -4156,12 +5033,11 @@ public override QueryBidsByOrderBookRequest DefaultInstanceForType { } public override QueryBidsByOrderBookRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - QueryBidsByOrderBookRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4175,6 +5051,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QueryBidsByOrderBookRequest other) { if (other == global::bnet.protocol.exchange.QueryBidsByOrderBookRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasPartitionId) { MergePartitionId(other.PartitionId); } @@ -4188,20 +5065,31 @@ public override Builder MergeFrom(QueryBidsByOrderBookRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4213,12 +5101,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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { + if (result.hasPartitionId) { subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4227,7 +5115,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.QueryFilterByOrderId.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByOrderId.CreateBuilder(); - if (HasFilter) { + if (result.hasFilter) { subBuilder.MergeFrom(Filter); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4235,16 +5123,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 24: { - Status = input.ReadInt32(); + result.hasStatus = input.ReadInt32(ref result.status_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPartitionId { - get { return result.HasPartitionId; } + get { return result.hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { get { return result.PartitionId; } @@ -4252,19 +5145,22 @@ public bool HasPartitionId { } 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"); - if (result.HasPartitionId && + 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 { @@ -4274,13 +5170,14 @@ public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value return this; } public Builder ClearPartitionId() { + PrepareBuilder(); result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.partitionId_ = null; return this; } public bool HasFilter { - get { return result.HasFilter; } + get { return result.hasFilter; } } public global::bnet.protocol.exchange.QueryFilterByOrderId Filter { get { return result.Filter; } @@ -4288,19 +5185,22 @@ public bool HasFilter { } 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"); - if (result.HasFilter && + 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 { @@ -4310,24 +5210,27 @@ public Builder MergeFilter(global::bnet.protocol.exchange.QueryFilterByOrderId v return this; } public Builder ClearFilter() { + PrepareBuilder(); result.hasFilter = false; - result.filter_ = global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; + result.filter_ = null; return this; } public bool HasStatus { - get { return result.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; @@ -4338,14 +5241,20 @@ static QueryBidsByOrderBookRequest() { } } + [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 static readonly QueryBidsByOrderBookResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override QueryBidsByOrderBookResponse ThisMessage { @@ -4374,7 +5283,7 @@ public int BidsCount { public const int TotalCountFieldNumber = 2; private bool hasTotalCount; - private uint totalCount_ = 0; + private uint totalCount_; public bool HasTotalCount { get { return hasTotalCount; } } @@ -4392,13 +5301,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.exchange.BidExtended element in BidsList) { - output.WriteMessage(1, element); + string[] field_names = _queryBidsByOrderBookResponseFieldNames; + if (bids_.Count > 0) { + output.WriteMessageArray(1, field_names[0], bids_); } - if (HasTotalCount) { - output.WriteUInt32(2, TotalCount); + if (hasTotalCount) { + output.WriteUInt32(2, field_names[1], TotalCount); } UnknownFields.WriteTo(output); } @@ -4413,7 +5323,7 @@ public override int SerializedSize { foreach (global::bnet.protocol.exchange.BidExtended element in BidsList) { size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasTotalCount) { + if (hasTotalCount) { size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalCount); } size += UnknownFields.SerializedSize; @@ -4446,38 +5356,73 @@ public static QueryBidsByOrderBookResponse ParseDelimitedFrom(global::System.IO. 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) { + public static QueryBidsByOrderBookResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryBidsByOrderBookResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - QueryBidsByOrderBookResponse result = new QueryBidsByOrderBookResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override QueryBidsByOrderBookResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QueryBidsByOrderBookResponse(); + 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 { @@ -4489,13 +5434,11 @@ public override QueryBidsByOrderBookResponse DefaultInstanceForType { } public override QueryBidsByOrderBookResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.bids_.MakeReadOnly(); - QueryBidsByOrderBookResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4509,8 +5452,9 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QueryBidsByOrderBookResponse other) { if (other == global::bnet.protocol.exchange.QueryBidsByOrderBookResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.bids_.Count != 0) { - base.AddRange(other.bids_, result.bids_); + result.bids_.Add(other.bids_); } if (other.HasTotalCount) { TotalCount = other.TotalCount; @@ -4519,20 +5463,31 @@ public override Builder MergeFrom(QueryBidsByOrderBookResponse 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4544,26 +5499,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.exchange.BidExtended.Builder subBuilder = global::bnet.protocol.exchange.BidExtended.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddBids(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.bids_, global::bnet.protocol.exchange.BidExtended.DefaultInstance, extensionRegistry); break; } case 16: { - TotalCount = input.ReadUInt32(); + result.hasTotalCount = input.ReadUInt32(ref result.totalCount_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList BidsList { - get { return result.bids_; } + get { return PrepareBuilder().bids_; } } public int BidsCount { get { return result.BidsCount; } @@ -4573,46 +5531,54 @@ public int BidsCount { } 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) { - base.AddRange(values, result.bids_); + PrepareBuilder(); + result.bids_.Add(values); return this; } public Builder ClearBids() { + PrepareBuilder(); result.bids_.Clear(); return this; } public bool HasTotalCount { - get { return result.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; @@ -4623,14 +5589,20 @@ static QueryBidsByOrderBookResponse() { } } + [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 static readonly QueryOffersByAccountForItemRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override QueryOffersByAccountForItemRequest ThisMessage { @@ -4647,32 +5619,32 @@ protected override QueryOffersByAccountForItemRequest ThisMessage { public const int AccountForItemFieldNumber = 1; private bool hasAccountForItem; - private global::bnet.protocol.exchange.BlobFrom accountForItem_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; + private global::bnet.protocol.exchange.BlobFrom accountForItem_; public bool HasAccountForItem { get { return hasAccountForItem; } } public global::bnet.protocol.exchange.BlobFrom AccountForItem { - get { return 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_ = global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; + private global::bnet.protocol.exchange.QueryFilterByCreatedTime filter_; public bool HasFilter { get { return hasFilter; } } public global::bnet.protocol.exchange.QueryFilterByCreatedTime Filter { - get { return filter_; } + get { return filter_ ?? global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; } } public const int BnetAccountFieldNumber = 3; private bool hasBnetAccount; - private global::bnet.protocol.EntityId bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId bnetAccount_; public bool HasBnetAccount { get { return hasBnetAccount; } } public global::bnet.protocol.EntityId BnetAccount { - get { return bnetAccount_; } + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -4688,16 +5660,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAccountForItem) { - output.WriteMessage(1, AccountForItem); + string[] field_names = _queryOffersByAccountForItemRequestFieldNames; + if (hasAccountForItem) { + output.WriteMessage(1, field_names[0], AccountForItem); } - if (HasFilter) { - output.WriteMessage(2, Filter); + if (hasFilter) { + output.WriteMessage(2, field_names[2], Filter); } - if (HasBnetAccount) { - output.WriteMessage(3, BnetAccount); + if (hasBnetAccount) { + output.WriteMessage(3, field_names[1], BnetAccount); } UnknownFields.WriteTo(output); } @@ -4709,13 +5682,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAccountForItem) { + if (hasAccountForItem) { size += pb::CodedOutputStream.ComputeMessageSize(1, AccountForItem); } - if (HasFilter) { + if (hasFilter) { size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); } - if (HasBnetAccount) { + if (hasBnetAccount) { size += pb::CodedOutputStream.ComputeMessageSize(3, BnetAccount); } size += UnknownFields.SerializedSize; @@ -4748,38 +5721,72 @@ public static QueryOffersByAccountForItemRequest ParseDelimitedFrom(global::Syst 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) { + public static QueryOffersByAccountForItemRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryOffersByAccountForItemRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - QueryOffersByAccountForItemRequest result = new QueryOffersByAccountForItemRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override QueryOffersByAccountForItemRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QueryOffersByAccountForItemRequest(); + 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 { @@ -4791,12 +5798,11 @@ public override QueryOffersByAccountForItemRequest DefaultInstanceForType { } public override QueryOffersByAccountForItemRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - QueryOffersByAccountForItemRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4810,6 +5816,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QueryOffersByAccountForItemRequest other) { if (other == global::bnet.protocol.exchange.QueryOffersByAccountForItemRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAccountForItem) { MergeAccountForItem(other.AccountForItem); } @@ -4823,20 +5830,31 @@ public override Builder MergeFrom(QueryOffersByAccountForItemRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4848,12 +5866,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.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); - if (HasAccountForItem) { + if (result.hasAccountForItem) { subBuilder.MergeFrom(AccountForItem); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4862,7 +5880,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.QueryFilterByCreatedTime.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByCreatedTime.CreateBuilder(); - if (HasFilter) { + if (result.hasFilter) { subBuilder.MergeFrom(Filter); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4871,7 +5889,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccount) { + if (result.hasBnetAccount) { subBuilder.MergeFrom(BnetAccount); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4880,11 +5898,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAccountForItem { - get { return result.HasAccountForItem; } + get { return result.hasAccountForItem; } } public global::bnet.protocol.exchange.BlobFrom AccountForItem { get { return result.AccountForItem; } @@ -4892,19 +5915,22 @@ public bool HasAccountForItem { } 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"); - if (result.HasAccountForItem && + 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 { @@ -4914,13 +5940,14 @@ public Builder MergeAccountForItem(global::bnet.protocol.exchange.BlobFrom value return this; } public Builder ClearAccountForItem() { + PrepareBuilder(); result.hasAccountForItem = false; - result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; + result.accountForItem_ = null; return this; } public bool HasFilter { - get { return result.HasFilter; } + get { return result.hasFilter; } } public global::bnet.protocol.exchange.QueryFilterByCreatedTime Filter { get { return result.Filter; } @@ -4928,19 +5955,22 @@ public bool HasFilter { } 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"); - if (result.HasFilter && + 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 { @@ -4950,13 +5980,14 @@ public Builder MergeFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTi return this; } public Builder ClearFilter() { + PrepareBuilder(); result.hasFilter = false; - result.filter_ = global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; + result.filter_ = null; return this; } public bool HasBnetAccount { - get { return result.HasBnetAccount; } + get { return result.hasBnetAccount; } } public global::bnet.protocol.EntityId BnetAccount { get { return result.BnetAccount; } @@ -4964,19 +5995,22 @@ public bool HasBnetAccount { } 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"); - if (result.HasBnetAccount && + PrepareBuilder(); + if (result.hasBnetAccount && result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); } else { @@ -4986,8 +6020,9 @@ public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { return this; } public Builder ClearBnetAccount() { + PrepareBuilder(); result.hasBnetAccount = false; - result.bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + result.bnetAccount_ = null; return this; } } @@ -4996,14 +6031,20 @@ static QueryOffersByAccountForItemRequest() { } } + [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 static readonly QueryOffersByAccountForItemResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override QueryOffersByAccountForItemResponse ThisMessage { @@ -5032,7 +6073,7 @@ public int OffersCount { public const int TotalCountFieldNumber = 2; private bool hasTotalCount; - private uint totalCount_ = 0; + private uint totalCount_; public bool HasTotalCount { get { return hasTotalCount; } } @@ -5050,13 +6091,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.exchange.OfferExtended element in OffersList) { - output.WriteMessage(1, element); + string[] field_names = _queryOffersByAccountForItemResponseFieldNames; + if (offers_.Count > 0) { + output.WriteMessageArray(1, field_names[0], offers_); } - if (HasTotalCount) { - output.WriteUInt32(2, TotalCount); + if (hasTotalCount) { + output.WriteUInt32(2, field_names[1], TotalCount); } UnknownFields.WriteTo(output); } @@ -5071,7 +6113,7 @@ public override int SerializedSize { foreach (global::bnet.protocol.exchange.OfferExtended element in OffersList) { size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasTotalCount) { + if (hasTotalCount) { size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalCount); } size += UnknownFields.SerializedSize; @@ -5104,38 +6146,73 @@ public static QueryOffersByAccountForItemResponse ParseDelimitedFrom(global::Sys 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) { + public static QueryOffersByAccountForItemResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryOffersByAccountForItemResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - QueryOffersByAccountForItemResponse result = new QueryOffersByAccountForItemResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override QueryOffersByAccountForItemResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QueryOffersByAccountForItemResponse(); + 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 { @@ -5147,13 +6224,11 @@ public override QueryOffersByAccountForItemResponse DefaultInstanceForType { } public override QueryOffersByAccountForItemResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.offers_.MakeReadOnly(); - QueryOffersByAccountForItemResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -5167,8 +6242,9 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QueryOffersByAccountForItemResponse other) { if (other == global::bnet.protocol.exchange.QueryOffersByAccountForItemResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.offers_.Count != 0) { - base.AddRange(other.offers_, result.offers_); + result.offers_.Add(other.offers_); } if (other.HasTotalCount) { TotalCount = other.TotalCount; @@ -5177,20 +6253,31 @@ public override Builder MergeFrom(QueryOffersByAccountForItemResponse 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -5202,26 +6289,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.exchange.OfferExtended.Builder subBuilder = global::bnet.protocol.exchange.OfferExtended.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddOffers(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.offers_, global::bnet.protocol.exchange.OfferExtended.DefaultInstance, extensionRegistry); break; } case 16: { - TotalCount = input.ReadUInt32(); + result.hasTotalCount = input.ReadUInt32(ref result.totalCount_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList OffersList { - get { return result.offers_; } + get { return PrepareBuilder().offers_; } } public int OffersCount { get { return result.OffersCount; } @@ -5231,46 +6321,54 @@ public int OffersCount { } 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) { - base.AddRange(values, result.offers_); + PrepareBuilder(); + result.offers_.Add(values); return this; } public Builder ClearOffers() { + PrepareBuilder(); result.offers_.Clear(); return this; } public bool HasTotalCount { - get { return result.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; @@ -5281,14 +6379,20 @@ static QueryOffersByAccountForItemResponse() { } } + [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 static readonly QueryBidsByAccountForItemRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override QueryBidsByAccountForItemRequest ThisMessage { @@ -5305,32 +6409,32 @@ protected override QueryBidsByAccountForItemRequest ThisMessage { public const int AccountForItemFieldNumber = 1; private bool hasAccountForItem; - private global::bnet.protocol.exchange.BlobFrom accountForItem_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; + private global::bnet.protocol.exchange.BlobFrom accountForItem_; public bool HasAccountForItem { get { return hasAccountForItem; } } public global::bnet.protocol.exchange.BlobFrom AccountForItem { - get { return 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_ = global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; + private global::bnet.protocol.exchange.QueryFilterByCreatedTime filter_; public bool HasFilter { get { return hasFilter; } } public global::bnet.protocol.exchange.QueryFilterByCreatedTime Filter { - get { return filter_; } + get { return filter_ ?? global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; } } public const int BnetAccountFieldNumber = 3; private bool hasBnetAccount; - private global::bnet.protocol.EntityId bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId bnetAccount_; public bool HasBnetAccount { get { return hasBnetAccount; } } public global::bnet.protocol.EntityId BnetAccount { - get { return bnetAccount_; } + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -5346,16 +6450,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAccountForItem) { - output.WriteMessage(1, AccountForItem); + string[] field_names = _queryBidsByAccountForItemRequestFieldNames; + if (hasAccountForItem) { + output.WriteMessage(1, field_names[0], AccountForItem); } - if (HasFilter) { - output.WriteMessage(2, Filter); + if (hasFilter) { + output.WriteMessage(2, field_names[2], Filter); } - if (HasBnetAccount) { - output.WriteMessage(3, BnetAccount); + if (hasBnetAccount) { + output.WriteMessage(3, field_names[1], BnetAccount); } UnknownFields.WriteTo(output); } @@ -5367,13 +6472,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAccountForItem) { + if (hasAccountForItem) { size += pb::CodedOutputStream.ComputeMessageSize(1, AccountForItem); } - if (HasFilter) { + if (hasFilter) { size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); } - if (HasBnetAccount) { + if (hasBnetAccount) { size += pb::CodedOutputStream.ComputeMessageSize(3, BnetAccount); } size += UnknownFields.SerializedSize; @@ -5406,38 +6511,72 @@ public static QueryBidsByAccountForItemRequest ParseDelimitedFrom(global::System 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) { + public static QueryBidsByAccountForItemRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryBidsByAccountForItemRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - QueryBidsByAccountForItemRequest result = new QueryBidsByAccountForItemRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override QueryBidsByAccountForItemRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QueryBidsByAccountForItemRequest(); + 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 { @@ -5449,12 +6588,11 @@ public override QueryBidsByAccountForItemRequest DefaultInstanceForType { } public override QueryBidsByAccountForItemRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - QueryBidsByAccountForItemRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -5468,6 +6606,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QueryBidsByAccountForItemRequest other) { if (other == global::bnet.protocol.exchange.QueryBidsByAccountForItemRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAccountForItem) { MergeAccountForItem(other.AccountForItem); } @@ -5481,20 +6620,31 @@ public override Builder MergeFrom(QueryBidsByAccountForItemRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -5506,12 +6656,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.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); - if (HasAccountForItem) { + if (result.hasAccountForItem) { subBuilder.MergeFrom(AccountForItem); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5520,7 +6670,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.QueryFilterByCreatedTime.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByCreatedTime.CreateBuilder(); - if (HasFilter) { + if (result.hasFilter) { subBuilder.MergeFrom(Filter); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5529,7 +6679,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccount) { + if (result.hasBnetAccount) { subBuilder.MergeFrom(BnetAccount); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5538,11 +6688,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAccountForItem { - get { return result.HasAccountForItem; } + get { return result.hasAccountForItem; } } public global::bnet.protocol.exchange.BlobFrom AccountForItem { get { return result.AccountForItem; } @@ -5550,19 +6705,22 @@ public bool HasAccountForItem { } 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"); - if (result.HasAccountForItem && + 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 { @@ -5572,13 +6730,14 @@ public Builder MergeAccountForItem(global::bnet.protocol.exchange.BlobFrom value return this; } public Builder ClearAccountForItem() { + PrepareBuilder(); result.hasAccountForItem = false; - result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; + result.accountForItem_ = null; return this; } public bool HasFilter { - get { return result.HasFilter; } + get { return result.hasFilter; } } public global::bnet.protocol.exchange.QueryFilterByCreatedTime Filter { get { return result.Filter; } @@ -5586,19 +6745,22 @@ public bool HasFilter { } 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"); - if (result.HasFilter && + 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 { @@ -5608,13 +6770,14 @@ public Builder MergeFilter(global::bnet.protocol.exchange.QueryFilterByCreatedTi return this; } public Builder ClearFilter() { + PrepareBuilder(); result.hasFilter = false; - result.filter_ = global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; + result.filter_ = null; return this; } public bool HasBnetAccount { - get { return result.HasBnetAccount; } + get { return result.hasBnetAccount; } } public global::bnet.protocol.EntityId BnetAccount { get { return result.BnetAccount; } @@ -5622,19 +6785,22 @@ public bool HasBnetAccount { } 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"); - if (result.HasBnetAccount && + PrepareBuilder(); + if (result.hasBnetAccount && result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); } else { @@ -5644,8 +6810,9 @@ public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { return this; } public Builder ClearBnetAccount() { + PrepareBuilder(); result.hasBnetAccount = false; - result.bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + result.bnetAccount_ = null; return this; } } @@ -5654,14 +6821,20 @@ static QueryBidsByAccountForItemRequest() { } } + [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 static readonly QueryBidsByAccountForItemResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override QueryBidsByAccountForItemResponse ThisMessage { @@ -5690,7 +6863,7 @@ public int BidsCount { public const int TotalCountFieldNumber = 2; private bool hasTotalCount; - private uint totalCount_ = 0; + private uint totalCount_; public bool HasTotalCount { get { return hasTotalCount; } } @@ -5708,13 +6881,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.exchange.BidExtended element in BidsList) { - output.WriteMessage(1, element); + string[] field_names = _queryBidsByAccountForItemResponseFieldNames; + if (bids_.Count > 0) { + output.WriteMessageArray(1, field_names[0], bids_); } - if (HasTotalCount) { - output.WriteUInt32(2, TotalCount); + if (hasTotalCount) { + output.WriteUInt32(2, field_names[1], TotalCount); } UnknownFields.WriteTo(output); } @@ -5729,7 +6903,7 @@ public override int SerializedSize { foreach (global::bnet.protocol.exchange.BidExtended element in BidsList) { size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasTotalCount) { + if (hasTotalCount) { size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalCount); } size += UnknownFields.SerializedSize; @@ -5762,38 +6936,73 @@ public static QueryBidsByAccountForItemResponse ParseDelimitedFrom(global::Syste 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) { + public static QueryBidsByAccountForItemResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryBidsByAccountForItemResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - QueryBidsByAccountForItemResponse result = new QueryBidsByAccountForItemResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override QueryBidsByAccountForItemResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QueryBidsByAccountForItemResponse(); + 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 { @@ -5805,13 +7014,11 @@ public override QueryBidsByAccountForItemResponse DefaultInstanceForType { } public override QueryBidsByAccountForItemResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.bids_.MakeReadOnly(); - QueryBidsByAccountForItemResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -5825,8 +7032,9 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QueryBidsByAccountForItemResponse other) { if (other == global::bnet.protocol.exchange.QueryBidsByAccountForItemResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.bids_.Count != 0) { - base.AddRange(other.bids_, result.bids_); + result.bids_.Add(other.bids_); } if (other.HasTotalCount) { TotalCount = other.TotalCount; @@ -5835,20 +7043,31 @@ public override Builder MergeFrom(QueryBidsByAccountForItemResponse 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -5860,26 +7079,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.exchange.BidExtended.Builder subBuilder = global::bnet.protocol.exchange.BidExtended.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddBids(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.bids_, global::bnet.protocol.exchange.BidExtended.DefaultInstance, extensionRegistry); break; } case 16: { - TotalCount = input.ReadUInt32(); + result.hasTotalCount = input.ReadUInt32(ref result.totalCount_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList BidsList { - get { return result.bids_; } + get { return PrepareBuilder().bids_; } } public int BidsCount { get { return result.BidsCount; } @@ -5889,46 +7111,54 @@ public int BidsCount { } 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) { - base.AddRange(values, result.bids_); + PrepareBuilder(); + result.bids_.Add(values); return this; } public Builder ClearBids() { + PrepareBuilder(); result.bids_.Clear(); return this; } public bool HasTotalCount { - get { return result.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; @@ -5939,14 +7169,20 @@ static QueryBidsByAccountForItemResponse() { } } + [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 static readonly QueryOrderBooksSummaryRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override QueryOrderBooksSummaryRequest ThisMessage { @@ -5982,10 +7218,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.exchange.OrderBookHandle element in HandlesList) { - output.WriteMessage(1, element); + string[] field_names = _queryOrderBooksSummaryRequestFieldNames; + if (handles_.Count > 0) { + output.WriteMessageArray(1, field_names[0], handles_); } UnknownFields.WriteTo(output); } @@ -6030,38 +7267,73 @@ public static QueryOrderBooksSummaryRequest ParseDelimitedFrom(global::System.IO 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) { + public static QueryOrderBooksSummaryRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryOrderBooksSummaryRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - QueryOrderBooksSummaryRequest result = new QueryOrderBooksSummaryRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override QueryOrderBooksSummaryRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QueryOrderBooksSummaryRequest(); + 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 { @@ -6073,13 +7345,11 @@ public override QueryOrderBooksSummaryRequest DefaultInstanceForType { } public override QueryOrderBooksSummaryRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.handles_.MakeReadOnly(); - QueryOrderBooksSummaryRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -6093,27 +7363,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QueryOrderBooksSummaryRequest other) { if (other == global::bnet.protocol.exchange.QueryOrderBooksSummaryRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.handles_.Count != 0) { - base.AddRange(other.handles_, result.handles_); + result.handles_.Add(other.handles_); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -6125,22 +7407,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.exchange.OrderBookHandle.Builder subBuilder = global::bnet.protocol.exchange.OrderBookHandle.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddHandles(subBuilder.BuildPartial()); + 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 result.handles_; } + get { return PrepareBuilder().handles_; } } public int HandlesCount { get { return result.HandlesCount; } @@ -6150,29 +7435,35 @@ public int HandlesCount { } 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) { - base.AddRange(values, result.handles_); + PrepareBuilder(); + result.handles_.Add(values); return this; } public Builder ClearHandles() { + PrepareBuilder(); result.handles_.Clear(); return this; } @@ -6182,14 +7473,20 @@ static QueryOrderBooksSummaryRequest() { } } + [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 static readonly QueryOrderBooksSummaryResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override QueryOrderBooksSummaryResponse ThisMessage { @@ -6225,10 +7522,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.exchange.OrderBookSummary element in OrderBooksList) { - output.WriteMessage(1, element); + string[] field_names = _queryOrderBooksSummaryResponseFieldNames; + if (orderBooks_.Count > 0) { + output.WriteMessageArray(1, field_names[0], orderBooks_); } UnknownFields.WriteTo(output); } @@ -6273,38 +7571,73 @@ public static QueryOrderBooksSummaryResponse ParseDelimitedFrom(global::System.I 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) { + public static QueryOrderBooksSummaryResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryOrderBooksSummaryResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - QueryOrderBooksSummaryResponse result = new QueryOrderBooksSummaryResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override QueryOrderBooksSummaryResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QueryOrderBooksSummaryResponse(); + 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 { @@ -6316,13 +7649,11 @@ public override QueryOrderBooksSummaryResponse DefaultInstanceForType { } public override QueryOrderBooksSummaryResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.orderBooks_.MakeReadOnly(); - QueryOrderBooksSummaryResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -6336,27 +7667,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QueryOrderBooksSummaryResponse other) { if (other == global::bnet.protocol.exchange.QueryOrderBooksSummaryResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.orderBooks_.Count != 0) { - base.AddRange(other.orderBooks_, result.orderBooks_); + result.orderBooks_.Add(other.orderBooks_); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -6368,22 +7711,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.exchange.OrderBookSummary.Builder subBuilder = global::bnet.protocol.exchange.OrderBookSummary.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddOrderBooks(subBuilder.BuildPartial()); + 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 result.orderBooks_; } + get { return PrepareBuilder().orderBooks_; } } public int OrderBooksCount { get { return result.OrderBooksCount; } @@ -6393,29 +7739,35 @@ public int OrderBooksCount { } 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) { - base.AddRange(values, result.orderBooks_); + PrepareBuilder(); + result.orderBooks_.Add(values); return this; } public Builder ClearOrderBooks() { + PrepareBuilder(); result.orderBooks_.Clear(); return this; } @@ -6425,198 +7777,386 @@ static QueryOrderBooksSummaryResponse() { } } - public sealed partial class QuerySettlementsByOrderBookRequest : pb::GeneratedMessage { - private static readonly QuerySettlementsByOrderBookRequest defaultInstance = new Builder().BuildPartial(); - public static QuerySettlementsByOrderBookRequest DefaultInstance { + [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 QuerySettlementsByOrderBookRequest DefaultInstanceForType { - get { return defaultInstance; } + public override SubscribeOrderBookStatusChangeRequest DefaultInstanceForType { + get { return DefaultInstance; } } - protected override QuerySettlementsByOrderBookRequest ThisMessage { + 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_QuerySettlementsByOrderBookRequest__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_QuerySettlementsByOrderBookRequest__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_SubscribeOrderBookStatusChangeRequest__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 const int ObjectIdFieldNumber = 1; + private bool hasObjectId; + private ulong objectId_; + public bool HasObjectId { + get { return hasObjectId; } } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } + public ulong ObjectId { + get { return objectId_; } } - 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 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.QueryFilterByOrderId Filter { - get { return filter_; } + public global::bnet.protocol.exchange.PartitionId MinPartitionId { + get { return minPartitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } } - 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 const int MaxPartitionIdFieldNumber = 3; + private bool hasMaxPartitionId; + private global::bnet.protocol.exchange.PartitionId maxPartitionId_; + public bool HasMaxPartitionId { + get { return hasMaxPartitionId; } } - - 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); + public global::bnet.protocol.exchange.PartitionId MaxPartitionId { + get { return maxPartitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } } - 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 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 (!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 QuerySettlementsByOrderBookRequest ParseFrom(pb::ByteString data) { + public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static QuerySettlementsByOrderBookRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static QuerySettlementsByOrderBookRequest ParseFrom(byte[] data) { + public static SubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static QuerySettlementsByOrderBookRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static QuerySettlementsByOrderBookRequest ParseFrom(global::System.IO.Stream input) { + public static SubscribeOrderBookStatusChangeRequest ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QuerySettlementsByOrderBookRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeOrderBookStatusChangeRequest 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) { + public static SubscribeOrderBookStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static QuerySettlementsByOrderBookRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeOrderBookStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static QuerySettlementsByOrderBookRequest ParseFrom(pb::CodedInputStream input) { + public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QuerySettlementsByOrderBookRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(QuerySettlementsByOrderBookRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(SubscribeOrderBookStatusChangeRequest 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(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; + } - QuerySettlementsByOrderBookRequest result = new QuerySettlementsByOrderBookRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } - protected override QuerySettlementsByOrderBookRequest MessageBeingBuilt { - get { return result; } + protected override SubscribeOrderBookStatusChangeRequest MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QuerySettlementsByOrderBookRequest(); + 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.exchange.QuerySettlementsByOrderBookRequest.Descriptor; } + get { return global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest.Descriptor; } } - public override QuerySettlementsByOrderBookRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QuerySettlementsByOrderBookRequest.DefaultInstance; } + public override SubscribeOrderBookStatusChangeRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest.DefaultInstance; } } - public override QuerySettlementsByOrderBookRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override SubscribeOrderBookStatusChangeRequest BuildPartial() { + if (resultIsReadOnly) { + return result; } - QuerySettlementsByOrderBookRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is QuerySettlementsByOrderBookRequest) { - return MergeFrom((QuerySettlementsByOrderBookRequest) other); + if (other is SubscribeOrderBookStatusChangeRequest) { + return MergeFrom((SubscribeOrderBookStatusChangeRequest) 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); + 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.HasFilter) { - MergeFilter(other.Filter); + 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::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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -6628,157 +8168,328 @@ 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 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 (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); + if (result.hasMinPartitionId) { + subBuilder.MergeFrom(MinPartitionId); } input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); + MinPartitionId = subBuilder.BuildPartial(); break; } - case 18: { - global::bnet.protocol.exchange.QueryFilterByOrderId.Builder subBuilder = global::bnet.protocol.exchange.QueryFilterByOrderId.CreateBuilder(); - if (HasFilter) { - subBuilder.MergeFrom(Filter); + 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); - Filter = subBuilder.BuildPartial(); + 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 HasPartitionId { - get { return result.HasPartitionId; } + public bool HasObjectId { + get { return result.hasObjectId; } } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } + public ulong ObjectId { + get { return result.ObjectId; } + set { SetObjectId(value); } } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId 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"); - result.hasPartitionId = true; - result.partitionId_ = value; + PrepareBuilder(); + result.hasMinPartitionId = true; + result.minPartitionId_ = value; return this; } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + public Builder SetMinPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); + PrepareBuilder(); + result.hasMinPartitionId = true; + result.minPartitionId_ = builderForValue.Build(); return this; } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + public Builder MergeMinPartitionId(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(); + 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.partitionId_ = value; + result.minPartitionId_ = value; } - result.hasPartitionId = true; + result.hasMinPartitionId = true; return this; } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + public Builder ClearMinPartitionId() { + PrepareBuilder(); + result.hasMinPartitionId = false; + result.minPartitionId_ = 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 bool HasMaxPartitionId { + get { return result.hasMaxPartitionId; } } - public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByOrderId value) { + 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.hasFilter = true; - result.filter_ = value; + PrepareBuilder(); + result.hasMaxPartitionId = true; + result.maxPartitionId_ = value; return this; } - public Builder SetFilter(global::bnet.protocol.exchange.QueryFilterByOrderId.Builder builderForValue) { + public Builder SetMaxPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasFilter = true; - result.filter_ = builderForValue.Build(); + PrepareBuilder(); + result.hasMaxPartitionId = true; + result.maxPartitionId_ = builderForValue.Build(); return this; } - public Builder MergeFilter(global::bnet.protocol.exchange.QueryFilterByOrderId value) { + public Builder MergeMaxPartitionId(global::bnet.protocol.exchange.PartitionId 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(); + 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.filter_ = value; + result.maxPartitionId_ = value; } - result.hasFilter = true; + result.hasMaxPartitionId = true; return this; } - public Builder ClearFilter() { - result.hasFilter = false; - result.filter_ = global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; + 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 QuerySettlementsByOrderBookRequest() { + static SubscribeOrderBookStatusChangeRequest() { 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 { + [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 QuerySettlementsByOrderBookResponse DefaultInstanceForType { - get { return defaultInstance; } + public override UnsubscribeOrderBookStatusChangeRequest DefaultInstanceForType { + get { return DefaultInstance; } } - protected override QuerySettlementsByOrderBookResponse ThisMessage { + 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_QuerySettlementsByOrderBookResponse__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QuerySettlementsByOrderBookResponse__FieldAccessorTable; } + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_UnsubscribeOrderBookStatusChangeRequest__Descriptor; } } - 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]; + 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 { - foreach (global::bnet.protocol.exchange.Settlement element in SettlementsList) { - 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::bnet.protocol.exchange.Settlement element in SettlementsList) { - output.WriteMessage(1, element); - } + string[] field_names = _unsubscribeOrderBookStatusChangeRequestFieldNames; UnknownFields.WriteTo(output); } @@ -6789,123 +8500,161 @@ public override int SerializedSize { 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) { + public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static QuerySettlementsByOrderBookResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static QuerySettlementsByOrderBookResponse ParseFrom(byte[] data) { + public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static QuerySettlementsByOrderBookResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static QuerySettlementsByOrderBookResponse ParseFrom(global::System.IO.Stream input) { + public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QuerySettlementsByOrderBookResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static UnsubscribeOrderBookStatusChangeRequest 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) { + public static UnsubscribeOrderBookStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static QuerySettlementsByOrderBookResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static UnsubscribeOrderBookStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static QuerySettlementsByOrderBookResponse ParseFrom(pb::CodedInputStream input) { + public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QuerySettlementsByOrderBookResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(QuerySettlementsByOrderBookResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(UnsubscribeOrderBookStatusChangeRequest 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(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; + } - QuerySettlementsByOrderBookResponse result = new QuerySettlementsByOrderBookResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } - protected override QuerySettlementsByOrderBookResponse MessageBeingBuilt { - get { return result; } + protected override UnsubscribeOrderBookStatusChangeRequest MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QuerySettlementsByOrderBookResponse(); + 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.exchange.QuerySettlementsByOrderBookResponse.Descriptor; } + get { return global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest.Descriptor; } } - public override QuerySettlementsByOrderBookResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QuerySettlementsByOrderBookResponse.DefaultInstance; } + public override UnsubscribeOrderBookStatusChangeRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest.DefaultInstance; } } - public override QuerySettlementsByOrderBookResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override UnsubscribeOrderBookStatusChangeRequest BuildPartial() { + if (resultIsReadOnly) { + return result; } - result.settlements_.MakeReadOnly(); - QuerySettlementsByOrderBookResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is QuerySettlementsByOrderBookResponse) { - return MergeFrom((QuerySettlementsByOrderBookResponse) other); + if (other is UnsubscribeOrderBookStatusChangeRequest) { + return MergeFrom((UnsubscribeOrderBookStatusChangeRequest) 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_); - } + 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::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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -6917,88 +8666,65 @@ 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::bnet.protocol.exchange.Settlement.Builder subBuilder = global::bnet.protocol.exchange.Settlement.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddSettlements(subBuilder.BuildPartial()); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); 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(); + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } return this; } + } - static QuerySettlementsByOrderBookResponse() { + static UnsubscribeOrderBookStatusChangeRequest() { 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 { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class SubscribeOrderStatusChangeRequest : pb::GeneratedMessage { + private SubscribeOrderStatusChangeRequest() { } + private static readonly SubscribeOrderStatusChangeRequest defaultInstance = new SubscribeOrderStatusChangeRequest().MakeReadOnly(); + private static readonly string[] _subscribeOrderStatusChangeRequestFieldNames = new string[] { "agent_id", "object_id" }; + private static readonly uint[] _subscribeOrderStatusChangeRequestFieldTags = new uint[] { 10, 16 }; + public static SubscribeOrderStatusChangeRequest DefaultInstance { get { return defaultInstance; } } - public override SubscribeOrderBookStatusChangeRequest DefaultInstanceForType { - get { return defaultInstance; } + public override SubscribeOrderStatusChangeRequest DefaultInstanceForType { + get { return DefaultInstance; } } - protected override SubscribeOrderBookStatusChangeRequest ThisMessage { + 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_SubscribeOrderBookStatusChangeRequest__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_SubscribeOrderBookStatusChangeRequest__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_SubscribeOrderStatusChangeRequest__FieldAccessorTable; } } - public const int ObjectIdFieldNumber = 1; + 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_ = 0UL; + private ulong objectId_; public bool HasObjectId { get { return hasObjectId; } } @@ -7006,116 +8732,25 @@ 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 override bool IsInitialized { + get { + if (!hasAgentId) return false; + if (!hasObjectId) return false; + if (!AgentId.IsInitialized) return false; + return true; + } } - 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); + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _subscribeOrderStatusChangeRequestFieldNames; + 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; @@ -7125,29 +8760,11 @@ public override int SerializedSize { 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 (hasAgentId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasBootstrap) { - size += pb::CodedOutputStream.ComputeBoolSize(8, Bootstrap); + if (hasObjectId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -7155,134 +8772,161 @@ public override int SerializedSize { } } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data) { + public static SubscribeOrderStatusChangeRequest ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeOrderStatusChangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data) { + public static SubscribeOrderStatusChangeRequest ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeOrderStatusChangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(global::System.IO.Stream input) { + public static SubscribeOrderStatusChangeRequest ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeOrderStatusChangeRequest 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) { + public static SubscribeOrderStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static SubscribeOrderBookStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeOrderStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::CodedInputStream input) { + public static SubscribeOrderStatusChangeRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SubscribeOrderBookStatusChangeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeOrderStatusChangeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SubscribeOrderStatusChangeRequest MakeReadOnly() { + return this; + } + public 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 static Builder CreateBuilder(SubscribeOrderStatusChangeRequest 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(SubscribeOrderStatusChangeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SubscribeOrderBookStatusChangeRequest result = new SubscribeOrderBookStatusChangeRequest(); + private bool resultIsReadOnly; + private SubscribeOrderStatusChangeRequest result; - protected override SubscribeOrderBookStatusChangeRequest MessageBeingBuilt { - get { return result; } + private SubscribeOrderStatusChangeRequest PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeOrderStatusChangeRequest original = result; + result = new SubscribeOrderStatusChangeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SubscribeOrderStatusChangeRequest MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SubscribeOrderBookStatusChangeRequest(); + 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.exchange.SubscribeOrderBookStatusChangeRequest.Descriptor; } + get { return global::bnet.protocol.exchange.SubscribeOrderStatusChangeRequest.Descriptor; } } - public override SubscribeOrderBookStatusChangeRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest.DefaultInstance; } + public override SubscribeOrderStatusChangeRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.SubscribeOrderStatusChangeRequest.DefaultInstance; } } - public override SubscribeOrderBookStatusChangeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override SubscribeOrderStatusChangeRequest BuildPartial() { + if (resultIsReadOnly) { + return result; } - SubscribeOrderBookStatusChangeRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is SubscribeOrderBookStatusChangeRequest) { - return MergeFrom((SubscribeOrderBookStatusChangeRequest) other); + if (other is SubscribeOrderStatusChangeRequest) { + return MergeFrom((SubscribeOrderStatusChangeRequest) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(SubscribeOrderBookStatusChangeRequest other) { - if (other == global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest.DefaultInstance) return this; + public override Builder MergeFrom(SubscribeOrderStatusChangeRequest other) { + if (other == global::bnet.protocol.exchange.SubscribeOrderStatusChangeRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasAgentId) { + MergeAgentId(other.AgentId); + } 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) { + 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(_subscribeOrderStatusChangeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeOrderStatusChangeRequestFieldTags[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)) { @@ -7294,272 +8938,1690 @@ 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: { - 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(); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 26: { - global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasMaxPartitionId) { - subBuilder.MergeFrom(MaxPartitionId); + case 10: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasAgentId) { + subBuilder.MergeFrom(AgentId); } 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(); + AgentId = subBuilder.BuildPartial(); break; } - case 64: { - Bootstrap = input.ReadBool(); + case 16: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); 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; + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } return this; } - public bool HasMinPartitionId { - get { return result.HasMinPartitionId; } + + public bool HasAgentId { + get { return result.hasAgentId; } } - public global::bnet.protocol.exchange.PartitionId MinPartitionId { - get { return result.MinPartitionId; } - set { SetMinPartitionId(value); } + public global::bnet.protocol.EntityId AgentId { + get { return result.AgentId; } + set { SetAgentId(value); } } - public Builder SetMinPartitionId(global::bnet.protocol.exchange.PartitionId value) { + public Builder SetAgentId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasMinPartitionId = true; - result.minPartitionId_ = value; + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = value; return this; } - public Builder SetMinPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasMinPartitionId = true; - result.minPartitionId_ = builderForValue.Build(); + PrepareBuilder(); + result.hasAgentId = true; + result.agentId_ = builderForValue.Build(); return this; } - public Builder MergeMinPartitionId(global::bnet.protocol.exchange.PartitionId value) { + public Builder MergeAgentId(global::bnet.protocol.EntityId 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(); + 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.minPartitionId_ = value; + result.agentId_ = value; } - result.hasMinPartitionId = true; + result.hasAgentId = true; return this; } - public Builder ClearMinPartitionId() { - result.hasMinPartitionId = false; - result.minPartitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + public Builder ClearAgentId() { + PrepareBuilder(); + result.hasAgentId = false; + result.agentId_ = null; return this; } - public bool HasMaxPartitionId { - get { return result.HasMaxPartitionId; } + public bool HasObjectId { + get { return result.hasObjectId; } } - public global::bnet.protocol.exchange.PartitionId MaxPartitionId { - get { return result.MaxPartitionId; } - set { SetMaxPartitionId(value); } + 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 SubscribeOrderStatusChangeRequest() { + 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 UnsubscribeOrderStatusChangeRequest : pb::GeneratedMessage { + private UnsubscribeOrderStatusChangeRequest() { } + private static readonly UnsubscribeOrderStatusChangeRequest defaultInstance = new UnsubscribeOrderStatusChangeRequest().MakeReadOnly(); + private static readonly string[] _unsubscribeOrderStatusChangeRequestFieldNames = new string[] { "agent_id", "object_id" }; + private static readonly uint[] _unsubscribeOrderStatusChangeRequestFieldTags = new uint[] { 10, 16 }; + 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_; + 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 = _unsubscribeOrderStatusChangeRequestFieldNames; + 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 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::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnsubscribeOrderStatusChangeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UnsubscribeOrderStatusChangeRequest MakeReadOnly() { + return this; + } + + public 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 new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnsubscribeOrderStatusChangeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnsubscribeOrderStatusChangeRequest result; + + private UnsubscribeOrderStatusChangeRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnsubscribeOrderStatusChangeRequest original = result; + result = new UnsubscribeOrderStatusChangeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UnsubscribeOrderStatusChangeRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.UnsubscribeOrderStatusChangeRequest.Descriptor; } + } + + public override UnsubscribeOrderStatusChangeRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.UnsubscribeOrderStatusChangeRequest.DefaultInstance; } + } + + public override UnsubscribeOrderStatusChangeRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + 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; + 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(_unsubscribeOrderStatusChangeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unsubscribeOrderStatusChangeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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 UnsubscribeOrderStatusChangeRequest() { + 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", "order_id", "partition_id", "program" }; + private static readonly uint[] _claimRequestFieldTags = new uint[] { 34, 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 override bool IsInitialized { + get { + if (HasPartitionId) { + 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 = _claimRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[2], PartitionId); + } + if (hasOrderId) { + output.WriteUInt64(2, field_names[1], OrderId); + } + if (hasProgram) { + output.WriteFixed32(3, field_names[3], Program); + } + 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 (hasProgram) { + size += pb::CodedOutputStream.ComputeFixed32Size(3, Program); + } + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(4, 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::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); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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; + } + } + 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); } - public Builder SetMaxPartitionId(global::bnet.protocol.exchange.PartitionId value) { + 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"); - result.hasMaxPartitionId = true; - result.maxPartitionId_ = 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 SetMaxPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasMaxPartitionId = true; - result.maxPartitionId_ = builderForValue.Build(); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); return this; } - public Builder MergeMaxPartitionId(global::bnet.protocol.exchange.PartitionId value) { + public Builder MergeBnetAccount(global::bnet.protocol.EntityId 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(); + 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.maxPartitionId_ = value; + result.bnetAccount_ = value; } - result.hasMaxPartitionId = true; + result.hasBnetAccount = true; return this; } - public Builder ClearMaxPartitionId() { - result.hasMaxPartitionId = false; - result.maxPartitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; return this; } - - public bool HasProgram { - get { return result.HasProgram; } + } + 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 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 uint Program { - get { return result.Program; } - set { SetProgram(value); } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _getConfigurationRequestFieldNames; + if (hasProgram) { + output.WriteFixed32(1, field_names[0], Program); } - public Builder SetProgram(uint value) { - result.hasProgram = true; - result.program_ = value; - return this; + 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 Builder ClearProgram() { - result.hasProgram = false; - result.program_ = 0; - return this; + } + + 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; } - public bool HasStatus { - get { return result.HasStatus; } + private bool resultIsReadOnly; + private GetConfigurationRequest result; + + private GetConfigurationRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetConfigurationRequest original = result; + result = new GetConfigurationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; } - public int Status { - get { return result.Status; } - set { SetStatus(value); } + + public override bool IsInitialized { + get { return result.IsInitialized; } } - public Builder SetStatus(int value) { - result.hasStatus = true; - result.status_ = value; - return this; + + protected override GetConfigurationRequest MessageBeingBuilt { + get { return PrepareBuilder(); } } - public Builder ClearStatus() { - result.hasStatus = false; - result.status_ = 0; + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; return this; } - public bool HasCurrency { - get { return result.HasCurrency; } - } - public string Currency { - get { return result.Currency; } - set { SetCurrency(value); } + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } } - public Builder SetCurrency(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasCurrency = true; - result.currency_ = value; - return this; + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::bnet.protocol.exchange.GetConfigurationRequest.Descriptor; } } - public Builder ClearCurrency() { - result.hasCurrency = false; - result.currency_ = ""; - return this; + + public override GetConfigurationRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetConfigurationRequest.DefaultInstance; } } - public bool HasSpecialist { - get { return result.HasSpecialist; } + public override GetConfigurationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); } - public int Specialist { - get { return result.Specialist; } - set { SetSpecialist(value); } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetConfigurationRequest) { + return MergeFrom((GetConfigurationRequest) other); + } else { + base.MergeFrom(other); + return this; + } } - public Builder SetSpecialist(int value) { - result.hasSpecialist = true; - result.specialist_ = value; + + 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 Builder ClearSpecialist() { - result.hasSpecialist = false; - result.specialist_ = 0; + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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 HasBootstrap { - get { return result.HasBootstrap; } + + public bool HasProgram { + get { return result.hasProgram; } } - public bool Bootstrap { - get { return result.Bootstrap; } - set { SetBootstrap(value); } + public uint Program { + get { return result.Program; } + set { SetProgram(value); } } - public Builder SetBootstrap(bool value) { - result.hasBootstrap = true; - result.bootstrap_ = value; + public Builder SetProgram(uint value) { + PrepareBuilder(); + result.hasProgram = true; + result.program_ = value; return this; } - public Builder ClearBootstrap() { - result.hasBootstrap = false; - result.bootstrap_ = false; + public Builder ClearProgram() { + PrepareBuilder(); + result.hasProgram = false; + result.program_ = 0; return this; } } - static SubscribeOrderBookStatusChangeRequest() { + static GetConfigurationRequest() { 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 { + [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" }; + private static readonly uint[] _getConfigurationResponseFieldTags = new uint[] { 10 }; + public static GetConfigurationResponse DefaultInstance { get { return defaultInstance; } } - public override UnsubscribeOrderBookStatusChangeRequest DefaultInstanceForType { - get { return defaultInstance; } + public override GetConfigurationResponse DefaultInstanceForType { + get { return DefaultInstance; } } - protected override UnsubscribeOrderBookStatusChangeRequest ThisMessage { + 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_UnsubscribeOrderBookStatusChangeRequest__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_UnsubscribeOrderBookStatusChangeRequest__FieldAccessorTable; } + 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) { + 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_); + } UnknownFields.WriteTo(output); } @@ -7570,116 +10632,168 @@ public override int SerializedSize { 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 UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data) { + public static GetConfigurationResponse ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static GetConfigurationResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data) { + public static GetConfigurationResponse ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static GetConfigurationResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(global::System.IO.Stream input) { + public static GetConfigurationResponse ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetConfigurationResponse 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) { + public static GetConfigurationResponse ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static UnsubscribeOrderBookStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetConfigurationResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::CodedInputStream input) { + public static GetConfigurationResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UnsubscribeOrderBookStatusChangeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(UnsubscribeOrderBookStatusChangeRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(GetConfigurationResponse 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(GetConfigurationResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - UnsubscribeOrderBookStatusChangeRequest result = new UnsubscribeOrderBookStatusChangeRequest(); + private bool resultIsReadOnly; + private GetConfigurationResponse result; - protected override UnsubscribeOrderBookStatusChangeRequest MessageBeingBuilt { - get { return 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 = new UnsubscribeOrderBookStatusChangeRequest(); + 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.exchange.UnsubscribeOrderBookStatusChangeRequest.Descriptor; } + get { return global::bnet.protocol.exchange.GetConfigurationResponse.Descriptor; } } - public override UnsubscribeOrderBookStatusChangeRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest.DefaultInstance; } + public override GetConfigurationResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetConfigurationResponse.DefaultInstance; } } - public override UnsubscribeOrderBookStatusChangeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override GetConfigurationResponse BuildPartial() { + if (resultIsReadOnly) { + return result; } - UnsubscribeOrderBookStatusChangeRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is UnsubscribeOrderBookStatusChangeRequest) { - return MergeFrom((UnsubscribeOrderBookStatusChangeRequest) other); + if (other is GetConfigurationResponse) { + return MergeFrom((GetConfigurationResponse) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(UnsubscribeOrderBookStatusChangeRequest other) { - if (other == global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest.DefaultInstance) 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_); + } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -7691,77 +10805,138 @@ 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.configs_, global::bnet.protocol.exchange.SpecialistConfig.DefaultInstance, extensionRegistry); 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; + } } - static UnsubscribeOrderBookStatusChangeRequest() { + static GetConfigurationResponse() { 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 { + [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 SubscribeOrderStatusChangeRequest DefaultInstanceForType { - get { return defaultInstance; } + public override GetOfferFeeEstimationRequest DefaultInstanceForType { + get { return DefaultInstance; } } - protected override SubscribeOrderStatusChangeRequest ThisMessage { + 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_SubscribeOrderStatusChangeRequest__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_SubscribeOrderStatusChangeRequest__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOfferFeeEstimationRequest__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 const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } } - public const int ObjectIdFieldNumber = 2; - private bool hasObjectId; - private ulong objectId_ = 0UL; - public bool HasObjectId { - get { return hasObjectId; } + public const int DataFieldNumber = 2; + private bool hasData; + private global::bnet.protocol.exchange.FeeEstimationData data_; + public bool HasData { + get { return hasData; } } - public ulong ObjectId { - get { return objectId_; } + public global::bnet.protocol.exchange.FeeEstimationData Data { + get { return data_ ?? global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance; } } public override bool IsInitialized { get { - if (!hasAgentId) return false; - if (!hasObjectId) return false; - if (!AgentId.IsInitialized) return false; + 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) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _getOfferFeeEstimationRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); } - if (HasObjectId) { - output.WriteUInt64(2, ObjectId); + if (hasData) { + output.WriteMessage(2, field_names[0], Data); } UnknownFields.WriteTo(output); } @@ -7773,11 +10948,11 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); + if (hasData) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Data); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -7785,116 +10960,161 @@ public override int SerializedSize { } } - public static SubscribeOrderStatusChangeRequest ParseFrom(pb::ByteString data) { + public static GetOfferFeeEstimationRequest ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static SubscribeOrderStatusChangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static GetOfferFeeEstimationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static SubscribeOrderStatusChangeRequest ParseFrom(byte[] data) { + public static GetOfferFeeEstimationRequest ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static SubscribeOrderStatusChangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static GetOfferFeeEstimationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static SubscribeOrderStatusChangeRequest ParseFrom(global::System.IO.Stream input) { + public static GetOfferFeeEstimationRequest ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SubscribeOrderStatusChangeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetOfferFeeEstimationRequest 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) { + public static GetOfferFeeEstimationRequest ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static SubscribeOrderStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetOfferFeeEstimationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SubscribeOrderStatusChangeRequest ParseFrom(pb::CodedInputStream input) { + public static GetOfferFeeEstimationRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SubscribeOrderStatusChangeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(SubscribeOrderStatusChangeRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(GetOfferFeeEstimationRequest 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(GetOfferFeeEstimationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SubscribeOrderStatusChangeRequest result = new SubscribeOrderStatusChangeRequest(); + private bool resultIsReadOnly; + private GetOfferFeeEstimationRequest result; - protected override SubscribeOrderStatusChangeRequest MessageBeingBuilt { - get { return 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 = new SubscribeOrderStatusChangeRequest(); + 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.exchange.SubscribeOrderStatusChangeRequest.Descriptor; } + get { return global::bnet.protocol.exchange.GetOfferFeeEstimationRequest.Descriptor; } } - public override SubscribeOrderStatusChangeRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.SubscribeOrderStatusChangeRequest.DefaultInstance; } + public override GetOfferFeeEstimationRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetOfferFeeEstimationRequest.DefaultInstance; } } - public override SubscribeOrderStatusChangeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override GetOfferFeeEstimationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; } - SubscribeOrderStatusChangeRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is SubscribeOrderStatusChangeRequest) { - return MergeFrom((SubscribeOrderStatusChangeRequest) other); + if (other is GetOfferFeeEstimationRequest) { + return MergeFrom((GetOfferFeeEstimationRequest) 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); + 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.HasObjectId) { - ObjectId = other.ObjectId; + if (other.HasData) { + MergeData(other.Data); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -7906,144 +11126,188 @@ 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) { - subBuilder.MergeFrom(AgentId); + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); + PartitionId = subBuilder.BuildPartial(); break; } - case 16: { - ObjectId = input.ReadUInt64(); + 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 HasAgentId { - get { return result.HasAgentId; } + public bool HasPartitionId { + get { return result.hasPartitionId; } } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; return this; } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); return this; } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId 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(); + 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.agentId_ = value; + result.partitionId_ = value; } - result.hasAgentId = true; + result.hasPartitionId = true; return this; } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; return this; } - public bool HasObjectId { - get { return result.HasObjectId; } + public bool HasData { + get { return result.hasData; } } - public ulong ObjectId { - get { return result.ObjectId; } - set { SetObjectId(value); } + public global::bnet.protocol.exchange.FeeEstimationData Data { + get { return result.Data; } + set { SetData(value); } } - public Builder SetObjectId(ulong value) { - result.hasObjectId = true; - result.objectId_ = 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 ClearObjectId() { - result.hasObjectId = false; - result.objectId_ = 0UL; + 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 SubscribeOrderStatusChangeRequest() { + static GetOfferFeeEstimationRequest() { 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 { + [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 UnsubscribeOrderStatusChangeRequest DefaultInstanceForType { - get { return defaultInstance; } + public override GetBidFeeEstimationRequest DefaultInstanceForType { + get { return DefaultInstance; } } - protected override UnsubscribeOrderStatusChangeRequest ThisMessage { + 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_UnsubscribeOrderStatusChangeRequest__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_UnsubscribeOrderStatusChangeRequest__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetBidFeeEstimationRequest__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 const int PartitionIdFieldNumber = 1; + private bool hasPartitionId; + private global::bnet.protocol.exchange.PartitionId partitionId_; + public bool HasPartitionId { + get { return hasPartitionId; } } - public global::bnet.protocol.EntityId AgentId { - get { return agentId_; } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } } - public const int ObjectIdFieldNumber = 2; - private bool hasObjectId; - private ulong objectId_ = 0UL; - public bool HasObjectId { - get { return hasObjectId; } + public const int DataFieldNumber = 2; + private bool hasData; + private global::bnet.protocol.exchange.FeeEstimationData data_; + public bool HasData { + get { return hasData; } } - public ulong ObjectId { - get { return objectId_; } + public global::bnet.protocol.exchange.FeeEstimationData Data { + get { return data_ ?? global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance; } } public override bool IsInitialized { get { - if (!hasAgentId) return false; - if (!hasObjectId) return false; - if (!AgentId.IsInitialized) return false; + 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) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _getBidFeeEstimationRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); } - if (HasObjectId) { - output.WriteUInt64(2, ObjectId); + if (hasData) { + output.WriteMessage(2, field_names[0], Data); } UnknownFields.WriteTo(output); } @@ -8055,11 +11319,11 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasObjectId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, ObjectId); + if (hasData) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Data); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -8067,116 +11331,161 @@ public override int SerializedSize { } } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(pb::ByteString data) { + public static GetBidFeeEstimationRequest ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static GetBidFeeEstimationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(byte[] data) { + public static GetBidFeeEstimationRequest ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static GetBidFeeEstimationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(global::System.IO.Stream input) { + public static GetBidFeeEstimationRequest ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetBidFeeEstimationRequest 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) { + public static GetBidFeeEstimationRequest ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static UnsubscribeOrderStatusChangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetBidFeeEstimationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(pb::CodedInputStream input) { + public static GetBidFeeEstimationRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UnsubscribeOrderStatusChangeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(UnsubscribeOrderStatusChangeRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(GetBidFeeEstimationRequest 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(GetBidFeeEstimationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - UnsubscribeOrderStatusChangeRequest result = new UnsubscribeOrderStatusChangeRequest(); + private bool resultIsReadOnly; + private GetBidFeeEstimationRequest result; - protected override UnsubscribeOrderStatusChangeRequest MessageBeingBuilt { - get { return 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 = new UnsubscribeOrderStatusChangeRequest(); + 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.exchange.UnsubscribeOrderStatusChangeRequest.Descriptor; } + get { return global::bnet.protocol.exchange.GetBidFeeEstimationRequest.Descriptor; } } - public override UnsubscribeOrderStatusChangeRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.UnsubscribeOrderStatusChangeRequest.DefaultInstance; } + public override GetBidFeeEstimationRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetBidFeeEstimationRequest.DefaultInstance; } } - public override UnsubscribeOrderStatusChangeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override GetBidFeeEstimationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; } - UnsubscribeOrderStatusChangeRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is UnsubscribeOrderStatusChangeRequest) { - return MergeFrom((UnsubscribeOrderStatusChangeRequest) other); + if (other is GetBidFeeEstimationRequest) { + return MergeFrom((GetBidFeeEstimationRequest) 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); + 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.HasObjectId) { - ObjectId = other.ObjectId; + if (other.HasData) { + MergeData(other.Data); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -8188,160 +11497,190 @@ 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) { - subBuilder.MergeFrom(AgentId); + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); - AgentId = subBuilder.BuildPartial(); + PartitionId = subBuilder.BuildPartial(); break; } - case 16: { - ObjectId = input.ReadUInt64(); + 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 HasAgentId { - get { return result.HasAgentId; } + public bool HasPartitionId { + get { return result.hasPartitionId; } } - public global::bnet.protocol.EntityId AgentId { - get { return result.AgentId; } - set { SetAgentId(value); } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } } - public Builder SetAgentId(global::bnet.protocol.EntityId value) { + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasAgentId = true; - result.agentId_ = value; + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; return this; } - public Builder SetAgentId(global::bnet.protocol.EntityId.Builder builderForValue) { + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasAgentId = true; - result.agentId_ = builderForValue.Build(); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); return this; } - public Builder MergeAgentId(global::bnet.protocol.EntityId value) { + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId 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(); + 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.agentId_ = value; + result.partitionId_ = value; } - result.hasAgentId = true; + result.hasPartitionId = true; return this; } - public Builder ClearAgentId() { - result.hasAgentId = false; - result.agentId_ = global::bnet.protocol.EntityId.DefaultInstance; + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; return this; } - public bool HasObjectId { - get { return result.HasObjectId; } + public bool HasData { + get { return result.hasData; } } - public ulong ObjectId { - get { return result.ObjectId; } - set { SetObjectId(value); } + 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 SetObjectId(ulong value) { - result.hasObjectId = true; - result.objectId_ = value; + 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 ClearObjectId() { - result.hasObjectId = false; - result.objectId_ = 0UL; + public Builder ClearData() { + PrepareBuilder(); + result.hasData = false; + result.data_ = null; return this; } } - static UnsubscribeOrderStatusChangeRequest() { + static GetBidFeeEstimationRequest() { 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 { + [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 ClaimRequest DefaultInstanceForType { - get { return defaultInstance; } + public override GetFeeEstimationResponse DefaultInstanceForType { + get { return DefaultInstance; } } - protected override ClaimRequest ThisMessage { + 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_ClaimRequest__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_ClaimRequest__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__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 const int FeeAmountFieldNumber = 1; + private bool hasFeeAmount; + private ulong feeAmount_; + public bool HasFeeAmount { + get { return hasFeeAmount; } } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } + public ulong FeeAmount { + get { return feeAmount_; } } - 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 FeeDetailsFieldNumber = 2; + private pbc::PopsicleList feeDetails_ = new pbc::PopsicleList(); + public scg::IList FeeDetailsList { + get { return feeDetails_; } } - - 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 int FeeDetailsCount { + get { return feeDetails_.Count; } } - public global::bnet.protocol.EntityId BnetAccount { - get { return bnetAccount_; } + public global::bnet.protocol.exchange.FeeDetail GetFeeDetails(int index) { + return feeDetails_[index]; } 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; + 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::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasOrderId) { - output.WriteUInt32(2, OrderId); + string[] field_names = _getFeeEstimationResponseFieldNames; + if (hasFeeAmount) { + output.WriteUInt64(1, field_names[0], FeeAmount); } - if (HasBnetAccount) { - output.WriteMessage(3, BnetAccount); + if (feeDetails_.Count > 0) { + output.WriteMessageArray(2, field_names[1], feeDetails_); } UnknownFields.WriteTo(output); } @@ -8353,14 +11692,11 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); - } - if (HasOrderId) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, OrderId); + if (hasFeeAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, FeeAmount); } - if (HasBnetAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(3, BnetAccount); + foreach (global::bnet.protocol.exchange.FeeDetail element in FeeDetailsList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -8368,119 +11704,162 @@ public override int SerializedSize { } } - public static ClaimRequest ParseFrom(pb::ByteString data) { + public static GetFeeEstimationResponse ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static ClaimRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static GetFeeEstimationResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static ClaimRequest ParseFrom(byte[] data) { + public static GetFeeEstimationResponse ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static ClaimRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static GetFeeEstimationResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static ClaimRequest ParseFrom(global::System.IO.Stream input) { + public static GetFeeEstimationResponse ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ClaimRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetFeeEstimationResponse 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) { + public static GetFeeEstimationResponse ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static ClaimRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetFeeEstimationResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ClaimRequest ParseFrom(pb::CodedInputStream input) { + public static GetFeeEstimationResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ClaimRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(ClaimRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(GetFeeEstimationResponse 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(GetFeeEstimationResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ClaimRequest result = new ClaimRequest(); + private bool resultIsReadOnly; + private GetFeeEstimationResponse result; - protected override ClaimRequest MessageBeingBuilt { - get { return 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 = new ClaimRequest(); + 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.exchange.ClaimRequest.Descriptor; } + get { return global::bnet.protocol.exchange.GetFeeEstimationResponse.Descriptor; } } - public override ClaimRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.ClaimRequest.DefaultInstance; } + public override GetFeeEstimationResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance; } } - public override ClaimRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override GetFeeEstimationResponse BuildPartial() { + if (resultIsReadOnly) { + return result; } - ClaimRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is ClaimRequest) { - return MergeFrom((ClaimRequest) other); + if (other is GetFeeEstimationResponse) { + return MergeFrom((GetFeeEstimationResponse) 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; + 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.HasBnetAccount) { - MergeBnetAccount(other.BnetAccount); + if (other.feeDetails_.Count != 0) { + result.feeDetails_.Add(other.feeDetails_); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -8492,218 +11871,163 @@ 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::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); break; } - case 16: { - OrderId = input.ReadUInt32(); + case 8: { + result.hasFeeAmount = input.ReadUInt64(ref result.feeAmount_); 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(); + 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 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 bool HasFeeAmount { + get { return result.hasFeeAmount; } } - 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 ulong FeeAmount { + get { return result.FeeAmount; } + set { SetFeeAmount(value); } } - 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; + public Builder SetFeeAmount(ulong value) { + PrepareBuilder(); + result.hasFeeAmount = true; + result.feeAmount_ = value; return this; } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + public Builder ClearFeeAmount() { + PrepareBuilder(); + result.hasFeeAmount = false; + result.feeAmount_ = 0UL; return this; } - public bool HasOrderId { - get { return result.HasOrderId; } + public pbc::IPopsicleList FeeDetailsList { + get { return PrepareBuilder().feeDetails_; } } - public uint OrderId { - get { return result.OrderId; } - set { SetOrderId(value); } + public int FeeDetailsCount { + get { return result.FeeDetailsCount; } } - public Builder SetOrderId(uint value) { - result.hasOrderId = true; - result.orderId_ = value; - return this; + public global::bnet.protocol.exchange.FeeDetail GetFeeDetails(int index) { + return result.GetFeeDetails(index); } - public Builder ClearOrderId() { - result.hasOrderId = false; - result.orderId_ = 0; + public Builder SetFeeDetails(int index, global::bnet.protocol.exchange.FeeDetail value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.feeDetails_[index] = value; return this; } - - public bool HasBnetAccount { - get { return result.HasBnetAccount; } - } - public global::bnet.protocol.EntityId BnetAccount { - get { return result.BnetAccount; } - set { SetBnetAccount(value); } + 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 SetBnetAccount(global::bnet.protocol.EntityId value) { + public Builder AddFeeDetails(global::bnet.protocol.exchange.FeeDetail value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBnetAccount = true; - result.bnetAccount_ = value; + PrepareBuilder(); + result.feeDetails_.Add(value); return this; } - public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + public Builder AddFeeDetails(global::bnet.protocol.exchange.FeeDetail.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccount = true; - result.bnetAccount_ = builderForValue.Build(); + PrepareBuilder(); + result.feeDetails_.Add(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; + public Builder AddRangeFeeDetails(scg::IEnumerable values) { + PrepareBuilder(); + result.feeDetails_.Add(values); return this; } - public Builder ClearBnetAccount() { - result.hasBnetAccount = false; - result.bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + public Builder ClearFeeDetails() { + PrepareBuilder(); + result.feeDetails_.Clear(); return this; } } - static ClaimRequest() { + static GetFeeEstimationResponse() { 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 { + [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 CancelRequest DefaultInstanceForType { - get { return defaultInstance; } + public override OrderBookNotificationRequest DefaultInstanceForType { + get { return DefaultInstance; } } - protected override CancelRequest ThisMessage { + 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_CancelRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_CancelRequest__FieldAccessorTable; } + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__Descriptor; } } - 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_; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_OrderBookNotificationRequest__FieldAccessorTable; } } - 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 NotificationsFieldNumber = 1; + private pbc::PopsicleList notifications_ = new pbc::PopsicleList(); + public scg::IList NotificationsList { + get { return notifications_; } } - - public const int ReasonFieldNumber = 3; - private bool hasReason; - private uint reason_ = 0; - public bool HasReason { - get { return hasReason; } + public int NotificationsCount { + get { return notifications_.Count; } } - public uint Reason { - get { return reason_; } + public global::bnet.protocol.exchange.OrderBookNotification GetNotifications(int index) { + return notifications_[index]; } - 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 const int BootStrapLastFieldNumber = 2; + private bool hasBootStrapLast; + private bool bootStrapLast_; + public bool HasBootStrapLast { + get { return hasBootStrapLast; } } - public global::bnet.protocol.EntityId BnetAccount { - get { return bnetAccount_; } + public bool BootStrapLast { + get { return bootStrapLast_; } } 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; + foreach (global::bnet.protocol.exchange.OrderBookNotification element in NotificationsList) { + 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 (HasPartitionId) { - output.WriteMessage(1, PartitionId); - } - if (HasOrderId) { - output.WriteUInt32(2, OrderId); + string[] field_names = _orderBookNotificationRequestFieldNames; + if (notifications_.Count > 0) { + output.WriteMessageArray(1, field_names[1], notifications_); } - if (HasReason) { - output.WriteUInt32(3, Reason); - } - if (HasBnetAccount) { - output.WriteMessage(4, BnetAccount); + if (hasBootStrapLast) { + output.WriteBool(2, field_names[0], BootStrapLast); } UnknownFields.WriteTo(output); } @@ -8715,17 +12039,11 @@ public override int SerializedSize { 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); + foreach (global::bnet.protocol.exchange.OrderBookNotification element in NotificationsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasBnetAccount) { - size += pb::CodedOutputStream.ComputeMessageSize(4, BnetAccount); + if (hasBootStrapLast) { + size += pb::CodedOutputStream.ComputeBoolSize(2, BootStrapLast); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -8733,122 +12051,162 @@ public override int SerializedSize { } } - public static CancelRequest ParseFrom(pb::ByteString data) { + public static OrderBookNotificationRequest ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static CancelRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static OrderBookNotificationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static CancelRequest ParseFrom(byte[] data) { + public static OrderBookNotificationRequest ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static CancelRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static OrderBookNotificationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static CancelRequest ParseFrom(global::System.IO.Stream input) { + public static OrderBookNotificationRequest ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CancelRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static OrderBookNotificationRequest 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) { + public static OrderBookNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static CancelRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static OrderBookNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static CancelRequest ParseFrom(pb::CodedInputStream input) { + public static OrderBookNotificationRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CancelRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(CancelRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(OrderBookNotificationRequest 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(OrderBookNotificationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - CancelRequest result = new CancelRequest(); + private bool resultIsReadOnly; + private OrderBookNotificationRequest result; - protected override CancelRequest MessageBeingBuilt { - get { return 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 = new CancelRequest(); + 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.exchange.CancelRequest.Descriptor; } + get { return global::bnet.protocol.exchange.OrderBookNotificationRequest.Descriptor; } } - public override CancelRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.CancelRequest.DefaultInstance; } + public override OrderBookNotificationRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.OrderBookNotificationRequest.DefaultInstance; } } - public override CancelRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override OrderBookNotificationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; } - CancelRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is CancelRequest) { - return MergeFrom((CancelRequest) other); + if (other is OrderBookNotificationRequest) { + return MergeFrom((OrderBookNotificationRequest) 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; + 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.HasBnetAccount) { - MergeBnetAccount(other.BnetAccount); + if (other.HasBootStrapLast) { + BootStrapLast = other.BootStrapLast; } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -8860,196 +12218,177 @@ 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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); + input.ReadMessageArray(tag, field_name, result.notifications_, global::bnet.protocol.exchange.OrderBookNotification.DefaultInstance, extensionRegistry); 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(); + result.hasBootStrapLast = input.ReadBool(ref result.bootStrapLast_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasPartitionId { - get { return result.HasPartitionId; } + public pbc::IPopsicleList NotificationsList { + get { return PrepareBuilder().notifications_; } } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } + public int NotificationsCount { + get { return result.NotificationsCount; } } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + 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.hasPartitionId = true; - result.partitionId_ = value; + PrepareBuilder(); + result.notifications_[index] = value; return this; } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + public Builder SetNotifications(int index, global::bnet.protocol.exchange.OrderBookNotification.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); + PrepareBuilder(); + result.notifications_[index] = builderForValue.Build(); return this; } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + public Builder AddNotifications(global::bnet.protocol.exchange.OrderBookNotification 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; + PrepareBuilder(); + result.notifications_.Add(value); return this; } - public Builder ClearOrderId() { - result.hasOrderId = false; - result.orderId_ = 0; + public Builder AddNotifications(global::bnet.protocol.exchange.OrderBookNotification.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.notifications_.Add(builderForValue.Build()); 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; + public Builder AddRangeNotifications(scg::IEnumerable values) { + PrepareBuilder(); + result.notifications_.Add(values); return this; } - public Builder ClearReason() { - result.hasReason = false; - result.reason_ = 0; + public Builder ClearNotifications() { + PrepareBuilder(); + result.notifications_.Clear(); 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 bool HasBootStrapLast { + get { return result.hasBootStrapLast; } } - public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccount = true; - result.bnetAccount_ = builderForValue.Build(); - return this; + public bool BootStrapLast { + get { return result.BootStrapLast; } + set { SetBootStrapLast(value); } } - 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; + public Builder SetBootStrapLast(bool value) { + PrepareBuilder(); + result.hasBootStrapLast = true; + result.bootStrapLast_ = value; return this; } - public Builder ClearBnetAccount() { - result.hasBnetAccount = false; - result.bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + public Builder ClearBootStrapLast() { + PrepareBuilder(); + result.hasBootStrapLast = false; + result.bootStrapLast_ = false; return this; } } - static CancelRequest() { + static OrderBookNotificationRequest() { 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 { + [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[] { "event", "extra_info", "offer" }; + private static readonly uint[] _offerNotificationRequestFieldTags = new uint[] { 16, 26, 10 }; + public static OfferNotificationRequest DefaultInstance { get { return defaultInstance; } } - public override GetConfigurationRequest DefaultInstanceForType { - get { return defaultInstance; } + public override OfferNotificationRequest DefaultInstanceForType { + get { return DefaultInstance; } } - protected override GetConfigurationRequest ThisMessage { + 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_GetConfigurationRequest__Descriptor; } + 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; } } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetConfigurationRequest__FieldAccessorTable; } + public uint Event { + get { return event_; } } - public const int ProgramFieldNumber = 1; - private bool hasProgram; - private uint program_ = 0; - public bool HasProgram { - get { return hasProgram; } + public const int ExtraInfoFieldNumber = 3; + private bool hasExtraInfo; + private global::bnet.protocol.exchange.BlobFrom extraInfo_; + public bool HasExtraInfo { + get { return hasExtraInfo; } } - public uint Program { - get { return program_; } + public global::bnet.protocol.exchange.BlobFrom ExtraInfo { + get { return extraInfo_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } } public override bool IsInitialized { get { - if (!hasProgram) return false; + if (!hasOffer) return false; + if (!hasEvent) return false; + if (!Offer.IsInitialized) return false; + if (HasExtraInfo) { + if (!ExtraInfo.IsInitialized) return false; + } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasProgram) { - output.WriteFixed32(1, Program); + string[] field_names = _offerNotificationRequestFieldNames; + if (hasOffer) { + output.WriteMessage(1, field_names[2], Offer); + } + if (hasEvent) { + output.WriteUInt32(2, field_names[0], Event); + } + if (hasExtraInfo) { + output.WriteMessage(3, field_names[1], ExtraInfo); } UnknownFields.WriteTo(output); } @@ -9061,8 +12400,14 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasProgram) { - size += pb::CodedOutputStream.ComputeFixed32Size(1, Program); + if (hasOffer) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Offer); + } + if (hasEvent) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Event); + } + if (hasExtraInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(3, ExtraInfo); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -9070,113 +12415,164 @@ public override int SerializedSize { } } - public static GetConfigurationRequest ParseFrom(pb::ByteString data) { + public static OfferNotificationRequest ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static GetConfigurationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static OfferNotificationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static GetConfigurationRequest ParseFrom(byte[] data) { + public static OfferNotificationRequest ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static GetConfigurationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static OfferNotificationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static GetConfigurationRequest ParseFrom(global::System.IO.Stream input) { + public static OfferNotificationRequest ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetConfigurationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static OfferNotificationRequest 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) { + public static OfferNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static GetConfigurationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static OfferNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GetConfigurationRequest ParseFrom(pb::CodedInputStream input) { + public static OfferNotificationRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetConfigurationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(GetConfigurationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(OfferNotificationRequest 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(OfferNotificationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - GetConfigurationRequest result = new GetConfigurationRequest(); + private bool resultIsReadOnly; + private OfferNotificationRequest result; - protected override GetConfigurationRequest MessageBeingBuilt { - get { return 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 = new GetConfigurationRequest(); + 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.exchange.GetConfigurationRequest.Descriptor; } + get { return global::bnet.protocol.exchange.OfferNotificationRequest.Descriptor; } } - public override GetConfigurationRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.GetConfigurationRequest.DefaultInstance; } + public override OfferNotificationRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.OfferNotificationRequest.DefaultInstance; } } - public override GetConfigurationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override OfferNotificationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; } - GetConfigurationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is GetConfigurationRequest) { - return MergeFrom((GetConfigurationRequest) other); + if (other is OfferNotificationRequest) { + return MergeFrom((OfferNotificationRequest) 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; + 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.HasExtraInfo) { + MergeExtraInfo(other.ExtraInfo); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -9188,88 +12584,227 @@ 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: { - Program = input.ReadFixed32(); + 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 26: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasExtraInfo) { + subBuilder.MergeFrom(ExtraInfo); + } + input.ReadMessage(subBuilder, extensionRegistry); + ExtraInfo = subBuilder.BuildPartial(); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasProgram { - get { return result.HasProgram; } + public bool HasOffer { + get { return result.hasOffer; } } - public uint Program { - get { return result.Program; } - set { SetProgram(value); } + public global::bnet.protocol.exchange.OfferExtended Offer { + get { return result.Offer; } + set { SetOffer(value); } } - public Builder SetProgram(uint value) { - result.hasProgram = true; - result.program_ = 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 ClearProgram() { - result.hasProgram = false; - result.program_ = 0; + 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 HasExtraInfo { + get { return result.hasExtraInfo; } + } + public global::bnet.protocol.exchange.BlobFrom ExtraInfo { + get { return result.ExtraInfo; } + set { SetExtraInfo(value); } + } + public Builder SetExtraInfo(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasExtraInfo = true; + result.extraInfo_ = value; + return this; + } + public Builder SetExtraInfo(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasExtraInfo = true; + result.extraInfo_ = builderForValue.Build(); + return this; + } + public Builder MergeExtraInfo(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasExtraInfo && + result.extraInfo_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.extraInfo_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.extraInfo_).MergeFrom(value).BuildPartial(); + } else { + result.extraInfo_ = value; + } + result.hasExtraInfo = true; + return this; + } + public Builder ClearExtraInfo() { + PrepareBuilder(); + result.hasExtraInfo = false; + result.extraInfo_ = null; return this; } } - static GetConfigurationRequest() { + static OfferNotificationRequest() { 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 { + [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", "event", "extra_info" }; + private static readonly uint[] _bidNotificationRequestFieldTags = new uint[] { 10, 16, 26 }; + public static BidNotificationRequest DefaultInstance { get { return defaultInstance; } } - public override GetConfigurationResponse DefaultInstanceForType { - get { return defaultInstance; } + public override BidNotificationRequest DefaultInstanceForType { + get { return DefaultInstance; } } - protected override GetConfigurationResponse ThisMessage { + 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_GetConfigurationResponse__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_GetConfigurationResponse__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_BidNotificationRequest__FieldAccessorTable; } } - public const int ConfigsFieldNumber = 1; - private pbc::PopsicleList configs_ = new pbc::PopsicleList(); - public scg::IList ConfigsList { - get { return configs_; } + public const int BidFieldNumber = 1; + private bool hasBid; + private global::bnet.protocol.exchange.BidExtended bid_; + public bool HasBid { + get { return hasBid; } } - public int ConfigsCount { - get { return configs_.Count; } + public global::bnet.protocol.exchange.BidExtended Bid { + get { return bid_ ?? global::bnet.protocol.exchange.BidExtended.DefaultInstance; } } - public global::bnet.protocol.exchange.SpecialistConfig GetConfigs(int index) { - return configs_[index]; + + 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 ExtraInfoFieldNumber = 3; + private bool hasExtraInfo; + private global::bnet.protocol.exchange.BlobFrom extraInfo_; + public bool HasExtraInfo { + get { return hasExtraInfo; } + } + public global::bnet.protocol.exchange.BlobFrom ExtraInfo { + get { return extraInfo_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } } public override bool IsInitialized { get { - foreach (global::bnet.protocol.exchange.SpecialistConfig element in ConfigsList) { - if (!element.IsInitialized) return false; + if (!hasBid) return false; + if (!hasEvent) return false; + if (!Bid.IsInitialized) return false; + if (HasExtraInfo) { + if (!ExtraInfo.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.exchange.SpecialistConfig element in ConfigsList) { - output.WriteMessage(1, element); + string[] field_names = _bidNotificationRequestFieldNames; + if (hasBid) { + output.WriteMessage(1, field_names[0], Bid); + } + if (hasEvent) { + output.WriteUInt32(2, field_names[1], Event); + } + if (hasExtraInfo) { + output.WriteMessage(3, field_names[2], ExtraInfo); } UnknownFields.WriteTo(output); } @@ -9281,8 +12816,14 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - foreach (global::bnet.protocol.exchange.SpecialistConfig element in ConfigsList) { - size += pb::CodedOutputStream.ComputeMessageSize(1, element); + if (hasBid) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Bid); + } + if (hasEvent) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Event); + } + if (hasExtraInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(3, ExtraInfo); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -9290,114 +12831,164 @@ public override int SerializedSize { } } - public static GetConfigurationResponse ParseFrom(pb::ByteString data) { + public static BidNotificationRequest ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static GetConfigurationResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static BidNotificationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static GetConfigurationResponse ParseFrom(byte[] data) { + public static BidNotificationRequest ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static GetConfigurationResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static BidNotificationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static GetConfigurationResponse ParseFrom(global::System.IO.Stream input) { + public static BidNotificationRequest ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetConfigurationResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static BidNotificationRequest 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) { + public static BidNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static GetConfigurationResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static BidNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GetConfigurationResponse ParseFrom(pb::CodedInputStream input) { + public static BidNotificationRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetConfigurationResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(GetConfigurationResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(BidNotificationRequest 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(BidNotificationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - GetConfigurationResponse result = new GetConfigurationResponse(); + private bool resultIsReadOnly; + private BidNotificationRequest result; - protected override GetConfigurationResponse MessageBeingBuilt { - get { return 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 = new GetConfigurationResponse(); + 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.exchange.GetConfigurationResponse.Descriptor; } + get { return global::bnet.protocol.exchange.BidNotificationRequest.Descriptor; } } - public override GetConfigurationResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.GetConfigurationResponse.DefaultInstance; } + public override BidNotificationRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.BidNotificationRequest.DefaultInstance; } } - public override GetConfigurationResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override BidNotificationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; } - result.configs_.MakeReadOnly(); - GetConfigurationResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is GetConfigurationResponse) { - return MergeFrom((GetConfigurationResponse) other); + if (other is BidNotificationRequest) { + return MergeFrom((BidNotificationRequest) 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_); + 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.HasExtraInfo) { + MergeExtraInfo(other.ExtraInfo); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -9409,122 +13000,228 @@ 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.exchange.SpecialistConfig.Builder subBuilder = global::bnet.protocol.exchange.SpecialistConfig.CreateBuilder(); + 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 26: { + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasExtraInfo) { + subBuilder.MergeFrom(ExtraInfo); + } input.ReadMessage(subBuilder, extensionRegistry); - AddConfigs(subBuilder.BuildPartial()); + ExtraInfo = subBuilder.BuildPartial(); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public pbc::IPopsicleList ConfigsList { - get { return result.configs_; } - } - public int ConfigsCount { - get { return result.ConfigsCount; } + public bool HasBid { + get { return result.hasBid; } } - public global::bnet.protocol.exchange.SpecialistConfig GetConfigs(int index) { - return result.GetConfigs(index); + public global::bnet.protocol.exchange.BidExtended Bid { + get { return result.Bid; } + set { SetBid(value); } } - public Builder SetConfigs(int index, global::bnet.protocol.exchange.SpecialistConfig value) { + public Builder SetBid(global::bnet.protocol.exchange.BidExtended value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.configs_[index] = value; + PrepareBuilder(); + result.hasBid = true; + result.bid_ = value; return this; } - public Builder SetConfigs(int index, global::bnet.protocol.exchange.SpecialistConfig.Builder builderForValue) { + public Builder SetBid(global::bnet.protocol.exchange.BidExtended.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.configs_[index] = builderForValue.Build(); + PrepareBuilder(); + result.hasBid = true; + result.bid_ = builderForValue.Build(); return this; } - public Builder AddConfigs(global::bnet.protocol.exchange.SpecialistConfig value) { + public Builder MergeBid(global::bnet.protocol.exchange.BidExtended value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.configs_.Add(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 AddConfigs(global::bnet.protocol.exchange.SpecialistConfig.Builder builderForValue) { + 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 HasExtraInfo { + get { return result.hasExtraInfo; } + } + public global::bnet.protocol.exchange.BlobFrom ExtraInfo { + get { return result.ExtraInfo; } + set { SetExtraInfo(value); } + } + public Builder SetExtraInfo(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasExtraInfo = true; + result.extraInfo_ = value; + return this; + } + public Builder SetExtraInfo(global::bnet.protocol.exchange.BlobFrom.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.configs_.Add(builderForValue.Build()); + PrepareBuilder(); + result.hasExtraInfo = true; + result.extraInfo_ = builderForValue.Build(); return this; } - public Builder AddRangeConfigs(scg::IEnumerable values) { - base.AddRange(values, result.configs_); + public Builder MergeExtraInfo(global::bnet.protocol.exchange.BlobFrom value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasExtraInfo && + result.extraInfo_ != global::bnet.protocol.exchange.BlobFrom.DefaultInstance) { + result.extraInfo_ = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(result.extraInfo_).MergeFrom(value).BuildPartial(); + } else { + result.extraInfo_ = value; + } + result.hasExtraInfo = true; return this; } - public Builder ClearConfigs() { - result.configs_.Clear(); + public Builder ClearExtraInfo() { + PrepareBuilder(); + result.hasExtraInfo = false; + result.extraInfo_ = null; return this; } } - static GetConfigurationResponse() { + static BidNotificationRequest() { 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 { + [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 GetOfferFeeEstimationRequest DefaultInstanceForType { - get { return defaultInstance; } + public override QueryOrdersByAccountForItemRequest DefaultInstanceForType { + get { return DefaultInstance; } } - protected override GetOfferFeeEstimationRequest ThisMessage { + 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_GetOfferFeeEstimationRequest__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_GetOfferFeeEstimationRequest__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemRequest__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 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.PartitionId PartitionId { - get { return partitionId_; } + public global::bnet.protocol.exchange.BlobFrom AccountForItem { + get { return accountForItem_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } } - 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 const int BnetAccountFieldNumber = 2; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } } - public global::bnet.protocol.exchange.FeeEstimationData Data { - get { return data_; } + 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 (!hasPartitionId) return false; - if (!hasData) return false; - if (!PartitionId.IsInitialized) return false; - if (!Data.IsInitialized) return false; + 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::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _queryOrdersByAccountForItemRequestFieldNames; + if (hasAccountForItem) { + output.WriteMessage(1, field_names[0], AccountForItem); + } + if (hasBnetAccount) { + output.WriteMessage(2, field_names[1], BnetAccount); } - if (HasData) { - output.WriteMessage(2, Data); + if (hasFilter) { + output.WriteMessage(3, field_names[2], Filter); } UnknownFields.WriteTo(output); } @@ -9536,11 +13233,14 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + if (hasAccountForItem) { + size += pb::CodedOutputStream.ComputeMessageSize(1, AccountForItem); } - if (HasData) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Data); + if (hasBnetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(2, BnetAccount); + } + if (hasFilter) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Filter); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -9548,116 +13248,164 @@ public override int SerializedSize { } } - public static GetOfferFeeEstimationRequest ParseFrom(pb::ByteString data) { + public static QueryOrdersByAccountForItemRequest ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static GetOfferFeeEstimationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static QueryOrdersByAccountForItemRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static GetOfferFeeEstimationRequest ParseFrom(byte[] data) { + public static QueryOrdersByAccountForItemRequest ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static GetOfferFeeEstimationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static QueryOrdersByAccountForItemRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static GetOfferFeeEstimationRequest ParseFrom(global::System.IO.Stream input) { + public static QueryOrdersByAccountForItemRequest ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetOfferFeeEstimationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static QueryOrdersByAccountForItemRequest 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) { + public static QueryOrdersByAccountForItemRequest ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static GetOfferFeeEstimationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static QueryOrdersByAccountForItemRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GetOfferFeeEstimationRequest ParseFrom(pb::CodedInputStream input) { + public static QueryOrdersByAccountForItemRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetOfferFeeEstimationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(GetOfferFeeEstimationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(QueryOrdersByAccountForItemRequest 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(QueryOrdersByAccountForItemRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - GetOfferFeeEstimationRequest result = new GetOfferFeeEstimationRequest(); + private bool resultIsReadOnly; + private QueryOrdersByAccountForItemRequest result; - protected override GetOfferFeeEstimationRequest MessageBeingBuilt { - get { return 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 = new GetOfferFeeEstimationRequest(); + 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.exchange.GetOfferFeeEstimationRequest.Descriptor; } + get { return global::bnet.protocol.exchange.QueryOrdersByAccountForItemRequest.Descriptor; } } - public override GetOfferFeeEstimationRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.GetOfferFeeEstimationRequest.DefaultInstance; } + public override QueryOrdersByAccountForItemRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryOrdersByAccountForItemRequest.DefaultInstance; } } - public override GetOfferFeeEstimationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override QueryOrdersByAccountForItemRequest BuildPartial() { + if (resultIsReadOnly) { + return result; } - GetOfferFeeEstimationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is GetOfferFeeEstimationRequest) { - return MergeFrom((GetOfferFeeEstimationRequest) other); + if (other is QueryOrdersByAccountForItemRequest) { + return MergeFrom((QueryOrdersByAccountForItemRequest) 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); + 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.HasData) { - MergeData(other.Data); + if (other.HasBnetAccount) { + MergeBnetAccount(other.BnetAccount); + } + if (other.HasFilter) { + MergeFilter(other.Filter); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -9669,168 +13417,239 @@ 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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); + global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); + if (result.hasAccountForItem) { + subBuilder.MergeFrom(AccountForItem); } input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); + AccountForItem = subBuilder.BuildPartial(); break; } case 18: { - global::bnet.protocol.exchange.FeeEstimationData.Builder subBuilder = global::bnet.protocol.exchange.FeeEstimationData.CreateBuilder(); - if (HasData) { - subBuilder.MergeFrom(Data); + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasBnetAccount) { + subBuilder.MergeFrom(BnetAccount); } input.ReadMessage(subBuilder, extensionRegistry); - Data = subBuilder.BuildPartial(); + 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 HasPartitionId { - get { return result.HasPartitionId; } + public bool HasBnetAccount { + get { return result.hasBnetAccount; } } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } + public global::bnet.protocol.EntityId BnetAccount { + get { return result.BnetAccount; } + set { SetBnetAccount(value); } } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + public Builder SetBnetAccount(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPartitionId = true; - result.partitionId_ = value; + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = value; return this; } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + public Builder SetBnetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); + PrepareBuilder(); + result.hasBnetAccount = true; + result.bnetAccount_ = builderForValue.Build(); return this; } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + public Builder MergeBnetAccount(global::bnet.protocol.EntityId 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(); + 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.partitionId_ = value; + result.bnetAccount_ = value; } - result.hasPartitionId = true; + result.hasBnetAccount = true; return this; } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + public Builder ClearBnetAccount() { + PrepareBuilder(); + result.hasBnetAccount = false; + result.bnetAccount_ = null; return this; } - public bool HasData { - get { return result.HasData; } + public bool HasFilter { + get { return result.hasFilter; } } - public global::bnet.protocol.exchange.FeeEstimationData Data { - get { return result.Data; } - set { SetData(value); } + public global::bnet.protocol.exchange.QueryOrderFilter Filter { + get { return result.Filter; } + set { SetFilter(value); } } - public Builder SetData(global::bnet.protocol.exchange.FeeEstimationData value) { + public Builder SetFilter(global::bnet.protocol.exchange.QueryOrderFilter value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasData = true; - result.data_ = value; + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = value; return this; } - public Builder SetData(global::bnet.protocol.exchange.FeeEstimationData.Builder builderForValue) { + public Builder SetFilter(global::bnet.protocol.exchange.QueryOrderFilter.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasData = true; - result.data_ = builderForValue.Build(); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = builderForValue.Build(); return this; } - public Builder MergeData(global::bnet.protocol.exchange.FeeEstimationData value) { + public Builder MergeFilter(global::bnet.protocol.exchange.QueryOrderFilter 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(); + 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.data_ = value; + result.filter_ = value; } - result.hasData = true; + result.hasFilter = true; return this; } - public Builder ClearData() { - result.hasData = false; - result.data_ = global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance; + public Builder ClearFilter() { + PrepareBuilder(); + result.hasFilter = false; + result.filter_ = null; return this; } } - static GetOfferFeeEstimationRequest() { + static QueryOrdersByAccountForItemRequest() { 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 { + [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 GetBidFeeEstimationRequest DefaultInstanceForType { - get { return defaultInstance; } + public override QueryOrdersByAccountForItemResponse DefaultInstanceForType { + get { return DefaultInstance; } } - protected override GetBidFeeEstimationRequest ThisMessage { + 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_GetBidFeeEstimationRequest__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_GetBidFeeEstimationRequest__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_QueryOrdersByAccountForItemResponse__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 const int OrdersFieldNumber = 1; + private pbc::PopsicleList orders_ = new pbc::PopsicleList(); + public scg::IList OrdersList { + get { return orders_; } } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } + public int OrdersCount { + get { return orders_.Count; } + } + public global::bnet.protocol.exchange.OrderExtended GetOrders(int index) { + return orders_[index]; } - 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 const int TotalCountFieldNumber = 2; + private bool hasTotalCount; + private uint totalCount_; + public bool HasTotalCount { + get { return hasTotalCount; } } - public global::bnet.protocol.exchange.FeeEstimationData Data { - get { return data_; } + public uint TotalCount { + get { return totalCount_; } } public override bool IsInitialized { get { - if (!hasPartitionId) return false; - if (!hasData) return false; - if (!PartitionId.IsInitialized) return false; - if (!Data.IsInitialized) return false; + 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::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _queryOrdersByAccountForItemResponseFieldNames; + if (orders_.Count > 0) { + output.WriteMessageArray(1, field_names[0], orders_); } - if (HasData) { - output.WriteMessage(2, Data); + if (hasTotalCount) { + output.WriteUInt32(2, field_names[1], TotalCount); } UnknownFields.WriteTo(output); } @@ -9842,11 +13661,11 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { - size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); + foreach (global::bnet.protocol.exchange.OrderExtended element in OrdersList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasData) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Data); + if (hasTotalCount) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, TotalCount); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -9854,116 +13673,162 @@ public override int SerializedSize { } } - public static GetBidFeeEstimationRequest ParseFrom(pb::ByteString data) { + public static QueryOrdersByAccountForItemResponse ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static GetBidFeeEstimationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static QueryOrdersByAccountForItemResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static GetBidFeeEstimationRequest ParseFrom(byte[] data) { + public static QueryOrdersByAccountForItemResponse ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static GetBidFeeEstimationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static QueryOrdersByAccountForItemResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static GetBidFeeEstimationRequest ParseFrom(global::System.IO.Stream input) { + public static QueryOrdersByAccountForItemResponse ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetBidFeeEstimationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static QueryOrdersByAccountForItemResponse 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) { + public static QueryOrdersByAccountForItemResponse ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static GetBidFeeEstimationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static QueryOrdersByAccountForItemResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GetBidFeeEstimationRequest ParseFrom(pb::CodedInputStream input) { + public static QueryOrdersByAccountForItemResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetBidFeeEstimationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(GetBidFeeEstimationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(QueryOrdersByAccountForItemResponse 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(QueryOrdersByAccountForItemResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - GetBidFeeEstimationRequest result = new GetBidFeeEstimationRequest(); + private bool resultIsReadOnly; + private QueryOrdersByAccountForItemResponse result; - protected override GetBidFeeEstimationRequest MessageBeingBuilt { - get { return 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 = new GetBidFeeEstimationRequest(); + 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.exchange.GetBidFeeEstimationRequest.Descriptor; } + get { return global::bnet.protocol.exchange.QueryOrdersByAccountForItemResponse.Descriptor; } } - public override GetBidFeeEstimationRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.GetBidFeeEstimationRequest.DefaultInstance; } + public override QueryOrdersByAccountForItemResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryOrdersByAccountForItemResponse.DefaultInstance; } } - public override GetBidFeeEstimationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override QueryOrdersByAccountForItemResponse BuildPartial() { + if (resultIsReadOnly) { + return result; } - GetBidFeeEstimationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is GetBidFeeEstimationRequest) { - return MergeFrom((GetBidFeeEstimationRequest) other); + if (other is QueryOrdersByAccountForItemResponse) { + return MergeFrom((QueryOrdersByAccountForItemResponse) 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); + 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.HasData) { - MergeData(other.Data); + if (other.HasTotalCount) { + TotalCount = other.TotalCount; } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -9975,151 +13840,177 @@ 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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { - subBuilder.MergeFrom(PartitionId); - } - input.ReadMessage(subBuilder, extensionRegistry); - PartitionId = subBuilder.BuildPartial(); + input.ReadMessageArray(tag, field_name, result.orders_, global::bnet.protocol.exchange.OrderExtended.DefaultInstance, extensionRegistry); 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(); + case 16: { + result.hasTotalCount = input.ReadUInt32(ref result.totalCount_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasPartitionId { - get { return result.HasPartitionId; } + public pbc::IPopsicleList OrdersList { + get { return PrepareBuilder().orders_; } } - public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return result.PartitionId; } - set { SetPartitionId(value); } + public int OrdersCount { + get { return result.OrdersCount; } } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { + 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"); - result.hasPartitionId = true; - result.partitionId_ = value; + PrepareBuilder(); + result.orders_[index] = value; return this; } - public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { + public Builder SetOrders(int index, global::bnet.protocol.exchange.OrderExtended.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPartitionId = true; - result.partitionId_ = builderForValue.Build(); + PrepareBuilder(); + result.orders_[index] = builderForValue.Build(); return this; } - public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value) { + public Builder AddOrders(global::bnet.protocol.exchange.OrderExtended 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; + PrepareBuilder(); + result.orders_.Add(value); return this; } - public Builder ClearPartitionId() { - result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + public Builder AddOrders(global::bnet.protocol.exchange.OrderExtended.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.orders_.Add(builderForValue.Build()); 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; + public Builder AddRangeOrders(scg::IEnumerable values) { + PrepareBuilder(); + result.orders_.Add(values); return this; } - public Builder SetData(global::bnet.protocol.exchange.FeeEstimationData.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasData = true; - result.data_ = builderForValue.Build(); + public Builder ClearOrders() { + PrepareBuilder(); + result.orders_.Clear(); 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; + + 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 ClearData() { - result.hasData = false; - result.data_ = global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance; + public Builder ClearTotalCount() { + PrepareBuilder(); + result.hasTotalCount = false; + result.totalCount_ = 0; return this; } } - static GetBidFeeEstimationRequest() { + static QueryOrdersByAccountForItemResponse() { 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 { + [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 GetFeeEstimationResponse DefaultInstanceForType { - get { return defaultInstance; } + public override GetFeeDetailsRequest DefaultInstanceForType { + get { return DefaultInstance; } } - protected override GetFeeEstimationResponse ThisMessage { + 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_GetFeeEstimationResponse__Descriptor; } + 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; } } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetFeeEstimationResponse__FieldAccessorTable; } + public ulong OrderId { + get { return orderId_; } } - public const int FeeAmountFieldNumber = 1; - private bool hasFeeAmount; - private ulong feeAmount_ = 0UL; - public bool HasFeeAmount { - get { return hasFeeAmount; } + public const int BnetAccountFieldNumber = 3; + private bool hasBnetAccount; + private global::bnet.protocol.EntityId bnetAccount_; + public bool HasBnetAccount { + get { return hasBnetAccount; } } - public ulong FeeAmount { - get { return feeAmount_; } + 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::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasFeeAmount) { - output.WriteUInt64(1, FeeAmount); + 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); } @@ -10131,8 +14022,14 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasFeeAmount) { - size += pb::CodedOutputStream.ComputeUInt64Size(1, FeeAmount); + 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; @@ -10140,113 +14037,164 @@ public override int SerializedSize { } } - public static GetFeeEstimationResponse ParseFrom(pb::ByteString data) { + public static GetFeeDetailsRequest ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static GetFeeEstimationResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static GetFeeDetailsRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static GetFeeEstimationResponse ParseFrom(byte[] data) { + public static GetFeeDetailsRequest ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static GetFeeEstimationResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static GetFeeDetailsRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static GetFeeEstimationResponse ParseFrom(global::System.IO.Stream input) { + public static GetFeeDetailsRequest ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetFeeEstimationResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetFeeDetailsRequest 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) { + public static GetFeeDetailsRequest ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static GetFeeEstimationResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetFeeDetailsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static GetFeeEstimationResponse ParseFrom(pb::CodedInputStream input) { + public static GetFeeDetailsRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetFeeEstimationResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(GetFeeEstimationResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(GetFeeDetailsRequest 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(GetFeeDetailsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - GetFeeEstimationResponse result = new GetFeeEstimationResponse(); + private bool resultIsReadOnly; + private GetFeeDetailsRequest result; - protected override GetFeeEstimationResponse MessageBeingBuilt { - get { return 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 = new GetFeeEstimationResponse(); + 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.exchange.GetFeeEstimationResponse.Descriptor; } + get { return global::bnet.protocol.exchange.GetFeeDetailsRequest.Descriptor; } } - public override GetFeeEstimationResponse DefaultInstanceForType { - get { return global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance; } + public override GetFeeDetailsRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetFeeDetailsRequest.DefaultInstance; } } - public override GetFeeEstimationResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override GetFeeDetailsRequest BuildPartial() { + if (resultIsReadOnly) { + return result; } - GetFeeEstimationResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is GetFeeEstimationResponse) { - return MergeFrom((GetFeeEstimationResponse) other); + if (other is GetFeeDetailsRequest) { + return MergeFrom((GetFeeDetailsRequest) 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; + 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::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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -10258,101 +14206,218 @@ 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: { - FeeAmount = input.ReadUInt64(); + 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 HasFeeAmount { - get { return result.HasFeeAmount; } + public bool HasPartitionId { + get { return result.hasPartitionId; } } - public ulong FeeAmount { - get { return result.FeeAmount; } - set { SetFeeAmount(value); } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } } - public Builder SetFeeAmount(ulong value) { - result.hasFeeAmount = true; - result.feeAmount_ = 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 ClearFeeAmount() { - result.hasFeeAmount = false; - result.feeAmount_ = 0UL; + 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 GetFeeEstimationResponse() { + static GetFeeDetailsRequest() { 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 { + [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 OrderBookNotificationRequest DefaultInstanceForType { - get { return defaultInstance; } + public override GetFeeDetailsResponse DefaultInstanceForType { + get { return DefaultInstance; } } - protected override OrderBookNotificationRequest ThisMessage { + 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_OrderBookNotificationRequest__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_OrderBookNotificationRequest__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetFeeDetailsResponse__FieldAccessorTable; } } - public const int NotificationsFieldNumber = 1; - private pbc::PopsicleList notifications_ = new pbc::PopsicleList(); - public scg::IList NotificationsList { - get { return notifications_; } + public const int FeeDetailsInFieldNumber = 1; + private pbc::PopsicleList feeDetailsIn_ = new pbc::PopsicleList(); + public scg::IList FeeDetailsInList { + get { return feeDetailsIn_; } } - public int NotificationsCount { - get { return notifications_.Count; } + public int FeeDetailsInCount { + get { return feeDetailsIn_.Count; } } - public global::bnet.protocol.exchange.OrderBookNotification GetNotifications(int index) { - return notifications_[index]; + public global::bnet.protocol.exchange.FeeDetail GetFeeDetailsIn(int index) { + return feeDetailsIn_[index]; } - public const int BootStrapLastFieldNumber = 2; - private bool hasBootStrapLast; - private bool bootStrapLast_ = false; - public bool HasBootStrapLast { - get { return hasBootStrapLast; } + public const int FeeDetailsOutFieldNumber = 2; + private pbc::PopsicleList feeDetailsOut_ = new pbc::PopsicleList(); + public scg::IList FeeDetailsOutList { + get { return feeDetailsOut_; } } - public bool BootStrapLast { - get { return bootStrapLast_; } + 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.OrderBookNotification element in NotificationsList) { + 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::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - foreach (global::bnet.protocol.exchange.OrderBookNotification element in NotificationsList) { - output.WriteMessage(1, element); + string[] field_names = _getFeeDetailsResponseFieldNames; + if (feeDetailsIn_.Count > 0) { + output.WriteMessageArray(1, field_names[0], feeDetailsIn_); } - if (HasBootStrapLast) { - output.WriteBool(2, BootStrapLast); + if (feeDetailsOut_.Count > 0) { + output.WriteMessageArray(2, field_names[1], feeDetailsOut_); } UnknownFields.WriteTo(output); } @@ -10364,11 +14429,11 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - foreach (global::bnet.protocol.exchange.OrderBookNotification element in NotificationsList) { + foreach (global::bnet.protocol.exchange.FeeDetail element in FeeDetailsInList) { size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasBootStrapLast) { - size += pb::CodedOutputStream.ComputeBoolSize(2, BootStrapLast); + foreach (global::bnet.protocol.exchange.FeeDetail element in FeeDetailsOutList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -10376,117 +14441,163 @@ public override int SerializedSize { } } - public static OrderBookNotificationRequest ParseFrom(pb::ByteString data) { + public static GetFeeDetailsResponse ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static OrderBookNotificationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static GetFeeDetailsResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static OrderBookNotificationRequest ParseFrom(byte[] data) { + public static GetFeeDetailsResponse ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static OrderBookNotificationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static GetFeeDetailsResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static OrderBookNotificationRequest ParseFrom(global::System.IO.Stream input) { + public static GetFeeDetailsResponse ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OrderBookNotificationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetFeeDetailsResponse 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) { + public static GetFeeDetailsResponse ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static OrderBookNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetFeeDetailsResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static OrderBookNotificationRequest ParseFrom(pb::CodedInputStream input) { + public static GetFeeDetailsResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OrderBookNotificationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(OrderBookNotificationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(GetFeeDetailsResponse 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(GetFeeDetailsResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - OrderBookNotificationRequest result = new OrderBookNotificationRequest(); + private bool resultIsReadOnly; + private GetFeeDetailsResponse result; - protected override OrderBookNotificationRequest MessageBeingBuilt { - get { return 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 = new OrderBookNotificationRequest(); + 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.exchange.OrderBookNotificationRequest.Descriptor; } + get { return global::bnet.protocol.exchange.GetFeeDetailsResponse.Descriptor; } } - public override OrderBookNotificationRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.OrderBookNotificationRequest.DefaultInstance; } + public override GetFeeDetailsResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetFeeDetailsResponse.DefaultInstance; } } - public override OrderBookNotificationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override GetFeeDetailsResponse BuildPartial() { + if (resultIsReadOnly) { + return result; } - result.notifications_.MakeReadOnly(); - OrderBookNotificationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is OrderBookNotificationRequest) { - return MergeFrom((OrderBookNotificationRequest) other); + if (other is GetFeeDetailsResponse) { + return MergeFrom((GetFeeDetailsResponse) 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_); + 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.HasBootStrapLast) { - BootStrapLast = other.BootStrapLast; + if (other.feeDetailsOut_.Count != 0) { + result.feeDetailsOut_.Add(other.feeDetailsOut_); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -10498,143 +14609,227 @@ 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.exchange.OrderBookNotification.Builder subBuilder = global::bnet.protocol.exchange.OrderBookNotification.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddNotifications(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.feeDetailsIn_, global::bnet.protocol.exchange.FeeDetail.DefaultInstance, extensionRegistry); break; } - case 16: { - BootStrapLast = input.ReadBool(); + 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 NotificationsList { - get { return result.notifications_; } + public pbc::IPopsicleList FeeDetailsInList { + get { return PrepareBuilder().feeDetailsIn_; } } - public int NotificationsCount { - get { return result.NotificationsCount; } + public int FeeDetailsInCount { + get { return result.FeeDetailsInCount; } } - public global::bnet.protocol.exchange.OrderBookNotification GetNotifications(int index) { - return result.GetNotifications(index); + public global::bnet.protocol.exchange.FeeDetail GetFeeDetailsIn(int index) { + return result.GetFeeDetailsIn(index); } - public Builder SetNotifications(int index, global::bnet.protocol.exchange.OrderBookNotification value) { + public Builder SetFeeDetailsIn(int index, global::bnet.protocol.exchange.FeeDetail value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.notifications_[index] = value; + PrepareBuilder(); + result.feeDetailsIn_[index] = value; return this; } - public Builder SetNotifications(int index, global::bnet.protocol.exchange.OrderBookNotification.Builder builderForValue) { + public Builder SetFeeDetailsIn(int index, global::bnet.protocol.exchange.FeeDetail.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.notifications_[index] = builderForValue.Build(); + PrepareBuilder(); + result.feeDetailsIn_[index] = builderForValue.Build(); return this; } - public Builder AddNotifications(global::bnet.protocol.exchange.OrderBookNotification value) { + public Builder AddFeeDetailsIn(global::bnet.protocol.exchange.FeeDetail value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.notifications_.Add(value); + PrepareBuilder(); + result.feeDetailsIn_.Add(value); return this; } - public Builder AddNotifications(global::bnet.protocol.exchange.OrderBookNotification.Builder builderForValue) { + public Builder AddFeeDetailsIn(global::bnet.protocol.exchange.FeeDetail.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.notifications_.Add(builderForValue.Build()); + PrepareBuilder(); + result.feeDetailsIn_.Add(builderForValue.Build()); return this; } - public Builder AddRangeNotifications(scg::IEnumerable values) { - base.AddRange(values, result.notifications_); + public Builder AddRangeFeeDetailsIn(scg::IEnumerable values) { + PrepareBuilder(); + result.feeDetailsIn_.Add(values); return this; } - public Builder ClearNotifications() { - result.notifications_.Clear(); + public Builder ClearFeeDetailsIn() { + PrepareBuilder(); + result.feeDetailsIn_.Clear(); return this; } - public bool HasBootStrapLast { - get { return result.HasBootStrapLast; } + public pbc::IPopsicleList FeeDetailsOutList { + get { return PrepareBuilder().feeDetailsOut_; } } - public bool BootStrapLast { - get { return result.BootStrapLast; } - set { SetBootStrapLast(value); } + public int FeeDetailsOutCount { + get { return result.FeeDetailsOutCount; } } - public Builder SetBootStrapLast(bool value) { - result.hasBootStrapLast = true; - result.bootStrapLast_ = value; + 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 ClearBootStrapLast() { - result.hasBootStrapLast = false; - result.bootStrapLast_ = false; + 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 OrderBookNotificationRequest() { + static GetFeeDetailsResponse() { 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 { + [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 OfferNotificationRequest DefaultInstanceForType { - get { return defaultInstance; } + public override GetOrderBookStatisticsRequest DefaultInstanceForType { + get { return DefaultInstance; } } - protected override OfferNotificationRequest ThisMessage { + 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_OfferNotificationRequest__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_OfferNotificationRequest__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOrderBookStatisticsRequest__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 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.OfferExtended Offer { - get { return offer_; } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } } - public const int EventFieldNumber = 2; - private bool hasEvent; - private uint event_ = 0; - public bool HasEvent { - get { return hasEvent; } + public const int OrderTypeFieldNumber = 2; + private bool hasOrderType; + private uint orderType_; + public bool HasOrderType { + get { return hasOrderType; } } - public uint Event { - get { return event_; } + 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 (!hasOffer) return false; - if (!hasEvent) return false; - if (!Offer.IsInitialized) return false; + 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::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOffer) { - output.WriteMessage(1, Offer); + string[] field_names = _getOrderBookStatisticsRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[3], PartitionId); } - if (HasEvent) { - output.WriteUInt32(2, Event); + 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); } @@ -10646,11 +14841,20 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOffer) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Offer); + if (hasPartitionId) { + size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasEvent) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, Event); + 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; @@ -10658,116 +14862,170 @@ public override int SerializedSize { } } - public static OfferNotificationRequest ParseFrom(pb::ByteString data) { + public static GetOrderBookStatisticsRequest ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static OfferNotificationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static GetOrderBookStatisticsRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static OfferNotificationRequest ParseFrom(byte[] data) { + public static GetOrderBookStatisticsRequest ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static OfferNotificationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static GetOrderBookStatisticsRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static OfferNotificationRequest ParseFrom(global::System.IO.Stream input) { + public static GetOrderBookStatisticsRequest ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OfferNotificationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetOrderBookStatisticsRequest 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) { + public static GetOrderBookStatisticsRequest ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static OfferNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetOrderBookStatisticsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static OfferNotificationRequest ParseFrom(pb::CodedInputStream input) { + public static GetOrderBookStatisticsRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OfferNotificationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(OfferNotificationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(GetOrderBookStatisticsRequest 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(GetOrderBookStatisticsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - OfferNotificationRequest result = new OfferNotificationRequest(); + private bool resultIsReadOnly; + private GetOrderBookStatisticsRequest result; - protected override OfferNotificationRequest MessageBeingBuilt { - get { return 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 = new OfferNotificationRequest(); + 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.exchange.OfferNotificationRequest.Descriptor; } + get { return global::bnet.protocol.exchange.GetOrderBookStatisticsRequest.Descriptor; } } - public override OfferNotificationRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.OfferNotificationRequest.DefaultInstance; } + public override GetOrderBookStatisticsRequest DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetOrderBookStatisticsRequest.DefaultInstance; } } - public override OfferNotificationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override GetOrderBookStatisticsRequest BuildPartial() { + if (resultIsReadOnly) { + return result; } - OfferNotificationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is OfferNotificationRequest) { - return MergeFrom((OfferNotificationRequest) other); + if (other is GetOrderBookStatisticsRequest) { + return MergeFrom((GetOrderBookStatisticsRequest) 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); + 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.HasEvent) { - Event = other.Event; + 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::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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -10779,144 +15037,251 @@ 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.exchange.OfferExtended.Builder subBuilder = global::bnet.protocol.exchange.OfferExtended.CreateBuilder(); - if (HasOffer) { - subBuilder.MergeFrom(Offer); + global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); + if (result.hasPartitionId) { + subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); - Offer = subBuilder.BuildPartial(); + PartitionId = subBuilder.BuildPartial(); break; } case 16: { - Event = input.ReadUInt32(); + 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 HasOffer { - get { return result.HasOffer; } + public bool HasPartitionId { + get { return result.hasPartitionId; } } - public global::bnet.protocol.exchange.OfferExtended Offer { - get { return result.Offer; } - set { SetOffer(value); } + public global::bnet.protocol.exchange.PartitionId PartitionId { + get { return result.PartitionId; } + set { SetPartitionId(value); } } - public Builder SetOffer(global::bnet.protocol.exchange.OfferExtended value) { + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOffer = true; - result.offer_ = value; + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = value; return this; } - public Builder SetOffer(global::bnet.protocol.exchange.OfferExtended.Builder builderForValue) { + public Builder SetPartitionId(global::bnet.protocol.exchange.PartitionId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasOffer = true; - result.offer_ = builderForValue.Build(); + PrepareBuilder(); + result.hasPartitionId = true; + result.partitionId_ = builderForValue.Build(); return this; } - public Builder MergeOffer(global::bnet.protocol.exchange.OfferExtended value) { + public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId 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(); + 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.offer_ = value; + result.partitionId_ = value; } - result.hasOffer = true; + result.hasPartitionId = true; return this; } - public Builder ClearOffer() { - result.hasOffer = false; - result.offer_ = global::bnet.protocol.exchange.OfferExtended.DefaultInstance; + public Builder ClearPartitionId() { + PrepareBuilder(); + result.hasPartitionId = false; + result.partitionId_ = null; return this; } - public bool HasEvent { - get { return result.HasEvent; } + public bool HasOrderType { + get { return result.hasOrderType; } } - public uint Event { - get { return result.Event; } - set { SetEvent(value); } + public uint OrderType { + get { return result.OrderType; } + set { SetOrderType(value); } } - public Builder SetEvent(uint value) { - result.hasEvent = true; - result.event_ = value; + public Builder SetOrderType(uint value) { + PrepareBuilder(); + result.hasOrderType = true; + result.orderType_ = value; return this; } - public Builder ClearEvent() { - result.hasEvent = false; - result.event_ = 0; + 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 OfferNotificationRequest() { + static GetOrderBookStatisticsRequest() { 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 { + [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 BidNotificationRequest DefaultInstanceForType { - get { return defaultInstance; } + public override GetOrderBookStatisticsResponse DefaultInstanceForType { + get { return DefaultInstance; } } - protected override BidNotificationRequest ThisMessage { + 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_BidNotificationRequest__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_BidNotificationRequest__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.Proto.ExchangeService.internal__static_bnet_protocol_exchange_GetOrderBookStatisticsResponse__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 const int PriceDetailsFieldNumber = 1; + private pbc::PopsicleList priceDetails_ = new pbc::PopsicleList(); + public scg::IList PriceDetailsList { + get { return priceDetails_; } } - public global::bnet.protocol.exchange.BidExtended Bid { - get { return bid_; } + public int PriceDetailsCount { + get { return priceDetails_.Count; } + } + public global::bnet.protocol.exchange.PriceDetail GetPriceDetails(int index) { + return priceDetails_[index]; } - public const int EventFieldNumber = 2; - private bool hasEvent; - private uint event_ = 0; - public bool HasEvent { - get { return hasEvent; } + public const int LastTradesAverageFieldNumber = 2; + private bool hasLastTradesAverage; + private ulong lastTradesAverage_; + public bool HasLastTradesAverage { + get { return hasLastTradesAverage; } } - public uint Event { - get { return event_; } + 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 (!hasBid) return false; - if (!hasEvent) return false; - if (!Bid.IsInitialized) return false; + 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::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasBid) { - output.WriteMessage(1, Bid); + 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 (HasEvent) { - output.WriteUInt32(2, Event); + if (hasLastDaysAverage) { + output.WriteUInt64(3, field_names[0], LastDaysAverage); } UnknownFields.WriteTo(output); } @@ -10928,11 +15293,14 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasBid) { - size += pb::CodedOutputStream.ComputeMessageSize(1, Bid); + foreach (global::bnet.protocol.exchange.PriceDetail element in PriceDetailsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasEvent) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, Event); + if (hasLastTradesAverage) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, LastTradesAverage); + } + if (hasLastDaysAverage) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, LastDaysAverage); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -10940,116 +15308,165 @@ public override int SerializedSize { } } - public static BidNotificationRequest ParseFrom(pb::ByteString data) { + public static GetOrderBookStatisticsResponse ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static BidNotificationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static GetOrderBookStatisticsResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static BidNotificationRequest ParseFrom(byte[] data) { + public static GetOrderBookStatisticsResponse ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static BidNotificationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static GetOrderBookStatisticsResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static BidNotificationRequest ParseFrom(global::System.IO.Stream input) { + public static GetOrderBookStatisticsResponse ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static BidNotificationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetOrderBookStatisticsResponse 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) { + public static GetOrderBookStatisticsResponse ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static BidNotificationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static GetOrderBookStatisticsResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static BidNotificationRequest ParseFrom(pb::CodedInputStream input) { + public static GetOrderBookStatisticsResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static BidNotificationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(BidNotificationRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(GetOrderBookStatisticsResponse 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(GetOrderBookStatisticsResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - BidNotificationRequest result = new BidNotificationRequest(); + private bool resultIsReadOnly; + private GetOrderBookStatisticsResponse result; - protected override BidNotificationRequest MessageBeingBuilt { - get { return 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 = new BidNotificationRequest(); + 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.exchange.BidNotificationRequest.Descriptor; } + get { return global::bnet.protocol.exchange.GetOrderBookStatisticsResponse.Descriptor; } } - public override BidNotificationRequest DefaultInstanceForType { - get { return global::bnet.protocol.exchange.BidNotificationRequest.DefaultInstance; } + public override GetOrderBookStatisticsResponse DefaultInstanceForType { + get { return global::bnet.protocol.exchange.GetOrderBookStatisticsResponse.DefaultInstance; } } - public override BidNotificationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override GetOrderBookStatisticsResponse BuildPartial() { + if (resultIsReadOnly) { + return result; } - BidNotificationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is BidNotificationRequest) { - return MergeFrom((BidNotificationRequest) other); + if (other is GetOrderBookStatisticsResponse) { + return MergeFrom((GetOrderBookStatisticsResponse) 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); + 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.HasEvent) { - Event = other.Event; + if (other.HasLastTradesAverage) { + LastTradesAverage = other.LastTradesAverage; + } + if (other.HasLastDaysAverage) { + LastDaysAverage = other.LastDaysAverage; } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -11061,82 +15478,116 @@ 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.exchange.BidExtended.Builder subBuilder = global::bnet.protocol.exchange.BidExtended.CreateBuilder(); - if (HasBid) { - subBuilder.MergeFrom(Bid); - } - input.ReadMessage(subBuilder, extensionRegistry); - Bid = subBuilder.BuildPartial(); + input.ReadMessageArray(tag, field_name, result.priceDetails_, global::bnet.protocol.exchange.PriceDetail.DefaultInstance, extensionRegistry); break; } case 16: { - Event = input.ReadUInt32(); + 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 bool HasBid { - get { return result.HasBid; } + public pbc::IPopsicleList PriceDetailsList { + get { return PrepareBuilder().priceDetails_; } } - public global::bnet.protocol.exchange.BidExtended Bid { - get { return result.Bid; } - set { SetBid(value); } + public int PriceDetailsCount { + get { return result.PriceDetailsCount; } } - public Builder SetBid(global::bnet.protocol.exchange.BidExtended value) { + 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"); - result.hasBid = true; - result.bid_ = value; + PrepareBuilder(); + result.priceDetails_[index] = value; return this; } - public Builder SetBid(global::bnet.protocol.exchange.BidExtended.Builder builderForValue) { + public Builder SetPriceDetails(int index, global::bnet.protocol.exchange.PriceDetail.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBid = true; - result.bid_ = builderForValue.Build(); + PrepareBuilder(); + result.priceDetails_[index] = builderForValue.Build(); return this; } - public Builder MergeBid(global::bnet.protocol.exchange.BidExtended value) { + public Builder AddPriceDetails(global::bnet.protocol.exchange.PriceDetail 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; + PrepareBuilder(); + result.priceDetails_.Add(value); return this; } - public Builder ClearBid() { - result.hasBid = false; - result.bid_ = global::bnet.protocol.exchange.BidExtended.DefaultInstance; + 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 HasEvent { - get { return result.HasEvent; } + public bool HasLastTradesAverage { + get { return result.hasLastTradesAverage; } } - public uint Event { - get { return result.Event; } - set { SetEvent(value); } + public ulong LastTradesAverage { + get { return result.LastTradesAverage; } + set { SetLastTradesAverage(value); } } - public Builder SetEvent(uint value) { - result.hasEvent = true; - result.event_ = value; + public Builder SetLastTradesAverage(ulong value) { + PrepareBuilder(); + result.hasLastTradesAverage = true; + result.lastTradesAverage_ = value; return this; } - public Builder ClearEvent() { - result.hasEvent = false; - result.event_ = 0; + 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 BidNotificationRequest() { + static GetOrderBookStatisticsResponse() { object.ReferenceEquals(global::bnet.protocol.exchange.Proto.ExchangeService.Descriptor, null); } } @@ -11144,6 +15595,9 @@ static BidNotificationRequest() { #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, @@ -11185,10 +15639,6 @@ 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, @@ -11257,6 +15707,30 @@ 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 static pbd::ServiceDescriptor Descriptor { get { return Proto.ExchangeService.Descriptor.Services[0]; } @@ -11326,95 +15800,120 @@ public void CallMethod( 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: + case 11: this.ReportSettle(controller, (global::bnet.protocol.exchange_object_provider.ReportSettleRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 13: + case 12: this.ReportCancel(controller, (global::bnet.protocol.exchange_object_provider.ReportCancelRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 14: + case 13: this.SubscribeOrderBookStatusChange(controller, (global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 15: + case 14: this.UnsubscribeOrderBookStatusChange(controller, (global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 16: + case 15: this.SubscribeOrderStatusChange(controller, (global::bnet.protocol.exchange.SubscribeOrderStatusChangeRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 17: + case 16: this.UnsubscribeOrderStatusChange(controller, (global::bnet.protocol.exchange.UnsubscribeOrderStatusChangeRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 18: + case 17: this.GetPaymentMethods(controller, (global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 19: + case 18: this.ClaimBidItem(controller, (global::bnet.protocol.exchange.ClaimRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 20: + case 19: this.ClaimBidMoney(controller, (global::bnet.protocol.exchange.ClaimRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 21: + case 20: this.ClaimOfferItem(controller, (global::bnet.protocol.exchange.ClaimRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 22: + case 21: this.ClaimOfferMoney(controller, (global::bnet.protocol.exchange.ClaimRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 23: + case 22: this.CancelBid(controller, (global::bnet.protocol.exchange.CancelRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 24: + case 23: this.CancelOffer(controller, (global::bnet.protocol.exchange.CancelRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 25: + case 24: this.GetConfiguration(controller, (global::bnet.protocol.exchange.GetConfigurationRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 26: + case 25: this.GetBidFeeEstimation(controller, (global::bnet.protocol.exchange.GetBidFeeEstimationRequest) request, pb::RpcUtil.SpecializeCallback( done)); return; - case 27: + 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; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -11447,23 +15946,23 @@ public void CallMethod( 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: + case 11: return global::bnet.protocol.exchange_object_provider.ReportSettleRequest.DefaultInstance; - case 13: + case 12: return global::bnet.protocol.exchange_object_provider.ReportCancelRequest.DefaultInstance; - case 14: + case 13: return global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest.DefaultInstance; - case 15: + case 14: return global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest.DefaultInstance; - case 16: + case 15: return global::bnet.protocol.exchange.SubscribeOrderStatusChangeRequest.DefaultInstance; - case 17: + case 16: return global::bnet.protocol.exchange.UnsubscribeOrderStatusChangeRequest.DefaultInstance; - case 18: + 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: @@ -11471,17 +15970,27 @@ public void CallMethod( case 21: return global::bnet.protocol.exchange.ClaimRequest.DefaultInstance; case 22: - return global::bnet.protocol.exchange.ClaimRequest.DefaultInstance; + return global::bnet.protocol.exchange.CancelRequest.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: + case 25: return global::bnet.protocol.exchange.GetBidFeeEstimationRequest.DefaultInstance; - case 27: + 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; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -11514,7 +16023,7 @@ public void CallMethod( case 9: return global::bnet.protocol.exchange.QueryOrderBooksSummaryResponse.DefaultInstance; case 10: - return global::bnet.protocol.exchange.QuerySettlementsByOrderBookResponse.DefaultInstance; + return global::bnet.protocol.NoData.DefaultInstance; case 11: return global::bnet.protocol.NoData.DefaultInstance; case 12: @@ -11528,9 +16037,9 @@ public void CallMethod( 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 18: + return global::bnet.protocol.NoData.DefaultInstance; case 19: return global::bnet.protocol.NoData.DefaultInstance; case 20: @@ -11542,13 +16051,23 @@ public void CallMethod( 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 25: + return global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance; case 26: return global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance; case 27: - return global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance; + 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; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -11558,6 +16077,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.exchange.ExchangeService { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -11659,20 +16181,11 @@ public override void QueryOrderBooksSummary( 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], + channel.CallMethod(Descriptor.Methods[10], controller, request, global::bnet.protocol.NoData.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } @@ -11681,7 +16194,7 @@ public override void ReportSettle( pb::IRpcController controller, global::bnet.protocol.exchange_object_provider.ReportSettleRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[12], + channel.CallMethod(Descriptor.Methods[11], controller, request, global::bnet.protocol.NoData.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } @@ -11690,7 +16203,7 @@ public override void ReportCancel( pb::IRpcController controller, global::bnet.protocol.exchange_object_provider.ReportCancelRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[13], + channel.CallMethod(Descriptor.Methods[12], controller, request, global::bnet.protocol.NoData.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } @@ -11699,7 +16212,7 @@ public override void SubscribeOrderBookStatusChange( pb::IRpcController controller, global::bnet.protocol.exchange.SubscribeOrderBookStatusChangeRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[14], + channel.CallMethod(Descriptor.Methods[13], controller, request, global::bnet.protocol.NoData.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } @@ -11708,7 +16221,7 @@ public override void UnsubscribeOrderBookStatusChange( pb::IRpcController controller, global::bnet.protocol.exchange.UnsubscribeOrderBookStatusChangeRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[15], + channel.CallMethod(Descriptor.Methods[14], controller, request, global::bnet.protocol.NoData.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } @@ -11717,7 +16230,7 @@ public override void SubscribeOrderStatusChange( pb::IRpcController controller, global::bnet.protocol.exchange.SubscribeOrderStatusChangeRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[16], + channel.CallMethod(Descriptor.Methods[15], controller, request, global::bnet.protocol.NoData.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } @@ -11726,7 +16239,7 @@ public override void UnsubscribeOrderStatusChange( pb::IRpcController controller, global::bnet.protocol.exchange.UnsubscribeOrderStatusChangeRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[17], + channel.CallMethod(Descriptor.Methods[16], controller, request, global::bnet.protocol.NoData.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } @@ -11735,7 +16248,7 @@ public override void GetPaymentMethods( pb::IRpcController controller, global::bnet.protocol.exchange_object_provider.GetPaymentMethodsRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[18], + 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)); } @@ -11744,7 +16257,7 @@ public override void ClaimBidItem( pb::IRpcController controller, global::bnet.protocol.exchange.ClaimRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[19], + channel.CallMethod(Descriptor.Methods[18], controller, request, global::bnet.protocol.NoData.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } @@ -11753,7 +16266,7 @@ public override void ClaimBidMoney( pb::IRpcController controller, global::bnet.protocol.exchange.ClaimRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[20], + channel.CallMethod(Descriptor.Methods[19], controller, request, global::bnet.protocol.NoData.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } @@ -11762,7 +16275,7 @@ public override void ClaimOfferItem( pb::IRpcController controller, global::bnet.protocol.exchange.ClaimRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[21], + channel.CallMethod(Descriptor.Methods[20], controller, request, global::bnet.protocol.NoData.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } @@ -11771,7 +16284,7 @@ public override void ClaimOfferMoney( pb::IRpcController controller, global::bnet.protocol.exchange.ClaimRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[22], + channel.CallMethod(Descriptor.Methods[21], controller, request, global::bnet.protocol.NoData.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } @@ -11780,7 +16293,7 @@ public override void CancelBid( pb::IRpcController controller, global::bnet.protocol.exchange.CancelRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[23], + channel.CallMethod(Descriptor.Methods[22], controller, request, global::bnet.protocol.NoData.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } @@ -11789,7 +16302,7 @@ public override void CancelOffer( pb::IRpcController controller, global::bnet.protocol.exchange.CancelRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[24], + channel.CallMethod(Descriptor.Methods[23], controller, request, global::bnet.protocol.NoData.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } @@ -11798,7 +16311,7 @@ public override void GetConfiguration( pb::IRpcController controller, global::bnet.protocol.exchange.GetConfigurationRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[25], + channel.CallMethod(Descriptor.Methods[24], controller, request, global::bnet.protocol.exchange.GetConfigurationResponse.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.GetConfigurationResponse.DefaultInstance)); } @@ -11807,7 +16320,7 @@ public override void GetBidFeeEstimation( pb::IRpcController controller, global::bnet.protocol.exchange.GetBidFeeEstimationRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[26], + channel.CallMethod(Descriptor.Methods[25], controller, request, global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.exchange.GetFeeEstimationResponse.DefaultInstance)); } @@ -11816,12 +16329,69 @@ public override void GetOfferFeeEstimation( pb::IRpcController controller, global::bnet.protocol.exchange.GetOfferFeeEstimationRequest request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[27], + 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)); + } } } + [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, @@ -11911,6 +16481,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.exchange.ExchangeNotify { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -11953,3 +16526,5 @@ public override void NotifyBidStatusChange( #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/exchange/ExchangeTypes.cs b/src/LibMooNet/bnet/protocol/exchange/ExchangeTypes.cs similarity index 54% rename from source/D3Proto/bnet/protocol/exchange/ExchangeTypes.cs rename to src/LibMooNet/bnet/protocol/exchange/ExchangeTypes.cs index ab7e4674..03ac1b2a 100644 --- a/source/D3Proto/bnet/protocol/exchange/ExchangeTypes.cs +++ b/src/LibMooNet/bnet/protocol/exchange/ExchangeTypes.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.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 @@ -37,10 +42,14 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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_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; @@ -51,6 +60,10 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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; + 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; #endregion #region Descriptor public static pbd::FileDescriptor Descriptor { @@ -60,87 +73,111 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static ExchangeTypes() { byte[] descriptorData = global::System.Convert.FromBase64String( - "CiVzZXJ2aWNlL2V4Y2hhbmdlL2V4Y2hhbmdlX3R5cGVzLnByb3RvEhZibmV0" + - "LnByb3RvY29sLmV4Y2hhbmdlGhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3Rv" + - "GhtsaWIvcHJvdG9jb2wvZXhjaGFuZ2UucHJvdG8ipAEKCU9yZGVyQm9vaxIy" + - "CgZvYmplY3QYASACKAsyIi5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkJsb2JP" + - "ZlR5cGUSDwoHcHJvZ3JhbRgCIAIoBxIVCg1jb21wYXRpYmlsaXR5GAMgAigN" + - "EhAKCGN1cnJlbmN5GAQgAigJEhIKCnNwZWNpYWxpc3QYBSACKAUSFQoNYWxs" + - "b3dlZF9yZWFsbRgGIAIoDSJjCg9PcmRlckJvb2tIYW5kbGUSOQoMcGFydGl0" + - "aW9uX2lkGAEgAigLMiMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0aXRp" + - "b25JZBIVCg1vcmRlcl9ib29rX2lkGAIgAigEIt4BChVPcmRlckJvb2tOb3Rp" + - "ZmljYXRpb24SNQoKb3JkZXJfYm9vaxgBIAIoCzIhLmJuZXQucHJvdG9jb2wu" + - "ZXhjaGFuZ2UuT3JkZXJCb29rEjkKDHBhcnRpdGlvbl9pZBgCIAIoCzIjLmJu" + + "CjBzZXJ2aWNlL2V4Y2hhbmdlL2RlZmluaXRpb24vZXhjaGFuZ2VfdHlwZXMu" + + "cHJvdG8SFmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UaGWxpYi9wcm90b2NvbC9l" + + "bnRpdHkucHJvdG8aG2xpYi9wcm90b2NvbC9leGNoYW5nZS5wcm90byKkAQoJ" + + "T3JkZXJCb29rEjIKBm9iamVjdBgBIAIoCzIiLmJuZXQucHJvdG9jb2wuZXhj" + + "aGFuZ2UuQmxvYk9mVHlwZRIPCgdwcm9ncmFtGAIgAigHEhUKDWNvbXBhdGli" + + "aWxpdHkYAyACKA0SEAoIY3VycmVuY3kYBCACKAkSEgoKc3BlY2lhbGlzdBgF" + + "IAIoBRIVCg1hbGxvd2VkX3JlYWxtGAYgAigNImMKD09yZGVyQm9va0hhbmRs" + + "ZRI5CgxwYXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hh" + + "bmdlLlBhcnRpdGlvbklkEhUKDW9yZGVyX2Jvb2tfaWQYAiACKAQiqgIKFU9y" + + "ZGVyQm9va05vdGlmaWNhdGlvbhI1CgpvcmRlcl9ib29rGAEgAigLMiEuYm5l" + + "dC5wcm90b2NvbC5leGNoYW5nZS5PcmRlckJvb2sSOQoMcGFydGl0aW9uX2lk" + + "GAIgAigLMiMuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBIV" + + "Cg1vcmRlcl9ib29rX2lkGAMgAigEEhoKD3RyYWRlX25vd19wcmljZRgEIAEo" + + "BDoBMBIYCg13aW5uaW5nX3ByaWNlGAUgASgEOgEwEg4KBnN0YXR1cxgGIAIo" + + "DRITCgt1cGRhdGVfdGltZRgHIAIoBBIWCgtjbG9zZWRfdGltZRgIIAEoBDoB" + + "MBIVCg1maWxsZWRfYW1vdW50GAkgAigEIvsCChBPcmRlckJvb2tTdW1tYXJ5" + + "EjkKDHBhcnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFu" + + "Z2UuUGFydGl0aW9uSWQSFQoNb3JkZXJfYm9va19pZBgCIAIoBBIOCgZyZXN1" + + "bHQYAyACKA0SNQoKb3JkZXJfYm9vaxgEIAEoCzIhLmJuZXQucHJvdG9jb2wu" + + "ZXhjaGFuZ2UuT3JkZXJCb29rEg4KBmFtb3VudBgFIAEoBBIYChBiZXN0X29m" + + "ZmVyX3ByaWNlGAYgASgEEhYKDmJlc3RfYmlkX3ByaWNlGAcgASgEEhAKCGVu" + + "ZF90aW1lGAggASgEEg4KBnN0YXR1cxgJIAEoBRIUCgxjcmVhdGVkX3RpbWUY" + + "CiABKAQSEwoLYWN0aXZlX3RpbWUYCyABKAQSEwoLY2xvc2VkX3RpbWUYDCAB" + + "KAQSDgoGcmVhc29uGA0gASgNEhoKEm91dF9iaWRfdW5pdF9wcmljZRgOIAEo" + + "BCK7AgoFT3JkZXISDgoGYW1vdW50GAEgAigNEhIKCnN0YXJ0X3RpbWUYAiAB" + + "KAQSEAoIZW5kX3RpbWUYAyABKAQSOwoRYWNjb3VudF9mb3JfbW9uZXkYBCAB" + + "KAsyIC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkJsb2JGcm9tEjoKEGFjY291" + + "bnRfZm9yX2l0ZW0YBSABKAsyIC5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkJs" + + "b2JGcm9tEi0KDGJuZXRfYWNjb3VudBgGIAEoCzIXLmJuZXQucHJvdG9jb2wu" + + "RW50aXR5SWQSLQoMZ2FtZV9hY2NvdW50GAcgASgLMhcuYm5ldC5wcm90b2Nv" + + "bC5FbnRpdHlJZBIlCgR0b29uGAggASgLMhcuYm5ldC5wcm90b2NvbC5FbnRp" + + "dHlJZCKPAwoJRXh0ZW5zaW9uEjkKDHBhcnRpdGlvbl9pZBgBIAIoCzIjLmJu" + "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="); + "a19pZBgCIAIoBBIQCghvcmRlcl9pZBgDIAIoBBIVCg1maWxsZWRfYW1vdW50" + + "GAQgASgEEhQKDG9yZGVyX3N0YXR1cxgFIAEoBRIXCg9hdXRob3JpemVkX3Rp" + + "bWUYBiABKAQSFAoMY3JlYXRlZF90aW1lGAcgASgEEhMKC2Nsb3NlZF90aW1l" + + "GAggASgEEg4KBnJlYXNvbhgJIAEoDRI1CgpvcmRlcl9ib29rGAogASgLMiEu" + + "Ym5ldC5wcm90b2NvbC5leGNoYW5nZS5PcmRlckJvb2sSGQoRb3JkZXJfYm9v" + + "a19zdGF0dXMYCyABKAQSFgoObW9uZXlfdG9fY2xhaW0YDCABKAQSFgoOaXRl" + + "bXNfdG9fY2xhaW0YDSABKAQSGwoMcmlza19kZWxheWVkGA4gASgIOgVmYWxz" + + "ZSJ8CgVPZmZlchIsCgVvcmRlchgBIAIoCzIdLmJuZXQucHJvdG9jb2wuZXhj" + + "aGFuZ2UuT3JkZXISFwoPdHJhZGVfbm93X3ByaWNlGAIgASgEEhUKDXJlc2Vy" + + "dmVfcHJpY2UYAyABKAQSFQoNb3V0X2JpZF9wcmljZRgEIAEoBCKSAQoNT2Zm" + + "ZXJFeHRlbmRlZBIsCgVvZmZlchgBIAIoCzIdLmJuZXQucHJvdG9jb2wuZXhj" + + "aGFuZ2UuT2ZmZXISNAoJZXh0ZW5zaW9uGAIgAigLMiEuYm5ldC5wcm90b2Nv" + + "bC5leGNoYW5nZS5FeHRlbnNpb24SHQoVY3VycmVudF93aW5uaW5nX3ByaWNl" + + "GAMgASgEIrUBCg1PZmZlckNyZWF0aW9uEiwKBW9mZmVyGAEgAigLMh0uYm5l" + + "dC5wcm90b2NvbC5leGNoYW5nZS5PZmZlchIYChBhdWN0aW9uX2R1cmF0aW9u" + + "GAIgASgEEhsKE2F1Y3Rpb25fc3RhcnRfZGVsYXkYAyABKAQSPwoPYmlsbGlu" + + "Z19hZGRyZXNzGAQgASgLMiYuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5CaWxs" + + "aW5nQWRkcmVzcyJnCgNCaWQSLAoFb3JkZXIYASACKAsyHS5ibmV0LnByb3Rv" + + "Y29sLmV4Y2hhbmdlLk9yZGVyEhoKEmN1cnJlbnRfdW5pdF9wcmljZRgCIAEo" + + "BBIWCg5tYXhfdW5pdF9wcmljZRgDIAEoBCLOAQoLQmlkRXh0ZW5kZWQSKAoD" + + "YmlkGAEgAigLMhsuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5CaWQSNAoJZXh0" + + "ZW5zaW9uGAIgAigLMiEuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5FeHRlbnNp" + + "b24SGwoTb2ZmZXJfb3V0X2JpZF9wcmljZRgDIAEoBBIdChVvZmZlcl90cmFk" + + "ZV9ub3dfcHJpY2UYBCABKAQSIwobb2ZmZXJfY3VycmVudF93aW5uaW5nX3By" + + "aWNlGAUgASgEIq8BCgtCaWRDcmVhdGlvbhIoCgNiaWQYASACKAsyGy5ibmV0" + + "LnByb3RvY29sLmV4Y2hhbmdlLkJpZBIYChBhdWN0aW9uX2R1cmF0aW9uGAIg" + + "ASgEEhsKE2F1Y3Rpb25fc3RhcnRfZGVsYXkYAyABKAQSPwoPYmlsbGluZ19h" + + "ZGRyZXNzGAQgASgLMiYuYm5ldC5wcm90b2NvbC5leGNoYW5nZS5CaWxsaW5n" + + "QWRkcmVzcyKdAQoNT3JkZXJFeHRlbmRlZBISCgpvcmRlcl90eXBlGAEgAigN" + + "EjkKDGJpZF9leHRlbmRlZBgCIAEoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFu" + + "Z2UuQmlkRXh0ZW5kZWQSPQoOb2ZmZXJfZXh0ZW5kZWQYAyABKAsyJS5ibmV0" + + "LnByb3RvY29sLmV4Y2hhbmdlLk9mZmVyRXh0ZW5kZWQiUwoUUXVlcnlGaWx0" + + "ZXJCeU9yZGVySWQSEgoKbWF4X3Jlc3VsdBgBIAIoDRIUCgxyZWZfb3JkZXJf" + + "aWQYAiABKAQSEQoJcmVmX3ByaWNlGAMgASgEIkgKGFF1ZXJ5RmlsdGVyQnlD" + + "cmVhdGVkVGltZRISCgptYXhfcmVzdWx0GAEgAigNEhgKEHJlZl9jcmVhdGVk" + + "X3RpbWUYAiABKAQivwEKEFF1ZXJ5T3JkZXJGaWx0ZXISEAoIY3VycmVuY3kY" + + "ASABKAkSEgoKc3BlY2lhbGlzdBgCIAEoDRISCgpvcmRlcl90eXBlGAMgASgN" + + "EhQKCWNsYWltYWJsZRgEIAEoDToBMBIUCgxvcmRlcl9zdGF0dXMYBSACKAUS" + + "RQoLdGltZV9maWx0ZXIYBiACKAsyMC5ibmV0LnByb3RvY29sLmV4Y2hhbmdl" + + "LlF1ZXJ5RmlsdGVyQnlDcmVhdGVkVGltZSJoCgpTZXR0bGVtZW50EhUKDW9y" + + "ZGVyX2Jvb2tfaWQYASACKAQSFAoMbW9uZXlfYW1vdW50GAIgAigEEhQKDGl0" + + "ZW1zX2Ftb3VudBgDIAIoBBIXCg9vZmZlcl9zZXR0bGVfaWQYBCACKAQifgoO" + + "Q3VycmVuY3lDb25maWcSEAoIY3VycmVuY3kYASACKAkSEQoJdGlja19zaXpl" + + "GAIgAigEEhYKDm1pbl91bml0X3ByaWNlGAMgAigEEhYKDm1heF91bml0X3By" + + "aWNlGAQgAigEEhcKD21heF90b3RhbF9wcmljZRgHIAIoBCKRAwoQU3BlY2lh" + + "bGlzdENvbmZpZxISCgpzcGVjaWFsaXN0GAEgAigFEh0KEWF1Y3Rpb25fZHVy" + + "YXRpb25zGAIgAygEQgIQARIgChRhdWN0aW9uX3N0YXJ0X2RlbGF5cxgDIAMo" + + "BEICEAESJAocYW50aV9zbmlwaW5nX2V4dGVuc2lvbl9kZWxheRgEIAIoBBIY" + + "ChBtYXhfaXRlbXNfYW1vdW50GAUgAigEEiAKGHN0YXJ0aW5nX3VuaXRfcHJp" + + "Y2VfcnVsZRgGIAIoBRIgChhyZXNlcnZlZF91bml0X3ByaWNlX3J1bGUYByAC" + + "KAUSIQoZdHJhZGVfbm93X3VuaXRfcHJpY2VfcnVsZRgIIAIoBRIfChdjdXJy" + + "ZW50X3VuaXRfcHJpY2VfcnVsZRgJIAIoBRIfChdtYXhpbXVtX3VuaXRfcHJp" + + "Y2VfcnVsZRgKIAIoBRI/Cg9jdXJyZW5jeV9jb25maWcYCyADKAsyJi5ibmV0" + + "LnByb3RvY29sLmV4Y2hhbmdlLkN1cnJlbmN5Q29uZmlnIlYKDkJpbGxpbmdB" + + "ZGRyZXNzEhIKCmNvdW50cnlfaWQYASACKAUSDAoEY2l0eRgCIAIoCRINCgVz" + + "dGF0ZRgDIAEoCRITCgtwb3N0YWxfY29kZRgEIAEoCSL1AQoRRmVlRXN0aW1h" + + "dGlvbkRhdGESDwoHcHJvZ3JhbRgBIAIoBxISCgpzcGVjaWFsaXN0GAIgAigF" + + "EhAKCGN1cnJlbmN5GAMgAigJEg4KBnNvdXJjZRgEIAIoBxIUCgxtb25leV9h" + + "bW91bnQYBSACKAQSEwoLaXRlbV9hbW91bnQYBiACKAQSLQoMYm5ldF9hY2Nv" + + "dW50GAcgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBI/Cg9iaWxsaW5n" + + "X2FkZHJlc3MYCCABKAsyJi5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLkJpbGxp" + + "bmdBZGRyZXNzIqMDCglGZWVEZXRhaWwSDgoGcm93bnVtGAEgAigEEhoKEmZl" + + "ZV9hdXRoX2RldGFpbF9pZBgCIAIoBBIOCgZmZWVfaWQYAyABKAQSEgoKZmVl" + + "X2Ftb3VudBgEIAEoBBIXCg9kaXNjb3VudF9hbW91bnQYBSABKAQSFAoMZmVl" + + "X2dyb3VwX2lkGAYgASgEEhYKDmZlZV9ncm91cF9uYW1lGAcgASgJEhcKD2Zs" + + "YXRfZmVlX2Ftb3VudBgIIAEoBBIaChJzY2FsaW5nX2ZlZV9hbW91bnQYCSAB" + + "KAQSFgoObWF4X2ZlZV9hbW91bnQYCiABKAQSFwoPZmVlX2Rlc2NyaXB0aW9u" + + "GAsgASgJEg4KBmlzX3RheBgMIAIoCBIWCg5jb3Vwb25fYm9va19pZBgNIAEo" + + "BBITCgtjb3Vwb25fdHlwZRgOIAEoBBIaChJjb3Vwb25fZGVzY3JpcHRpb24Y" + + "DyABKAkSHwoXbGVmdF9vdmVyX2NvdXBvbl9jcmVkaXQYECABKAQSHwoXbGVm" + + "dF9vdmVyX2NvdXBvbl9jaGFyZ2UYESABKAQiMgoLUHJpY2VEZXRhaWwSEwoL" + + "dHJhZGVfcHJpY2UYASACKAQSDgoGYW1vdW50GAIgAigE"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_exchange_OrderBook__Descriptor = Descriptor.MessageTypes[0]; @@ -154,7 +191,7 @@ static ExchangeTypes() { 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", }); + 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, @@ -166,7 +203,7 @@ static ExchangeTypes() { 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", }); + new string[] { "PartitionId", "OrderBookId", "OrderId", "FilledAmount", "OrderStatus", "AuthorizedTime", "CreatedTime", "ClosedTime", "Reason", "OrderBook", "OrderBookStatus", "MoneyToClaim", "ItemsToClaim", "RiskDelayed", }); 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, @@ -191,34 +228,50 @@ static ExchangeTypes() { 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_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", }); - internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__Descriptor = Descriptor.MessageTypes[13]; + 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", }); - internal__static_bnet_protocol_exchange_Settlement__Descriptor = Descriptor.MessageTypes[14]; + 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", "OrderStatus", "TimeFilter", }); + internal__static_bnet_protocol_exchange_Settlement__Descriptor = Descriptor.MessageTypes[16]; 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__Descriptor = Descriptor.MessageTypes[17]; 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]; + new string[] { "Currency", "TickSize", "MinUnitPrice", "MaxUnitPrice", "MaxTotalPrice", }); + internal__static_bnet_protocol_exchange_SpecialistConfig__Descriptor = Descriptor.MessageTypes[18]; 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]; + new string[] { "Specialist", "AuctionDurations", "AuctionStartDelays", "AntiSnipingExtensionDelay", "MaxItemsAmount", "StartingUnitPriceRule", "ReservedUnitPriceRule", "TradeNowUnitPriceRule", "CurrentUnitPriceRule", "MaximumUnitPriceRule", "CurrencyConfig", }); + internal__static_bnet_protocol_exchange_BillingAddress__Descriptor = Descriptor.MessageTypes[19]; 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__Descriptor = Descriptor.MessageTypes[20]; 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", }); + new string[] { "Program", "Specialist", "Currency", "Source", "MoneyAmount", "ItemAmount", "BnetAccount", "BillingAddress", }); + internal__static_bnet_protocol_exchange_FeeDetail__Descriptor = Descriptor.MessageTypes[21]; + 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", "ScalingFeeAmount", "MaxFeeAmount", "FeeDescription", "IsTax", "CouponBookId", "CouponType", "CouponDescription", "LeftOverCouponCredit", "LeftOverCouponCharge", }); + internal__static_bnet_protocol_exchange_PriceDetail__Descriptor = Descriptor.MessageTypes[22]; + internal__static_bnet_protocol_exchange_PriceDetail__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_exchange_PriceDetail__Descriptor, + new string[] { "TradePrice", "Amount", }); return null; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, @@ -231,14 +284,20 @@ static ExchangeTypes() { } #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 static readonly OrderBook defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override OrderBook ThisMessage { @@ -255,17 +314,17 @@ protected override OrderBook ThisMessage { public const int ObjectFieldNumber = 1; private bool hasObject; - private global::bnet.protocol.exchange.BlobOfType object_ = global::bnet.protocol.exchange.BlobOfType.DefaultInstance; + private global::bnet.protocol.exchange.BlobOfType object_; public bool HasObject { get { return hasObject; } } public global::bnet.protocol.exchange.BlobOfType Object { - get { return object_; } + get { return object_ ?? global::bnet.protocol.exchange.BlobOfType.DefaultInstance; } } public const int ProgramFieldNumber = 2; private bool hasProgram; - private uint program_ = 0; + private uint program_; public bool HasProgram { get { return hasProgram; } } @@ -275,7 +334,7 @@ public uint Program { public const int CompatibilityFieldNumber = 3; private bool hasCompatibility; - private uint compatibility_ = 0; + private uint compatibility_; public bool HasCompatibility { get { return hasCompatibility; } } @@ -295,7 +354,7 @@ public string Currency { public const int SpecialistFieldNumber = 5; private bool hasSpecialist; - private int specialist_ = 0; + private int specialist_; public bool HasSpecialist { get { return hasSpecialist; } } @@ -305,7 +364,7 @@ public int Specialist { public const int AllowedRealmFieldNumber = 6; private bool hasAllowedRealm; - private uint allowedRealm_ = 0; + private uint allowedRealm_; public bool HasAllowedRealm { get { return hasAllowedRealm; } } @@ -326,25 +385,26 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasObject) { - output.WriteMessage(1, Object); + string[] field_names = _orderBookFieldNames; + if (hasObject) { + output.WriteMessage(1, field_names[3], Object); } - if (HasProgram) { - output.WriteFixed32(2, Program); + if (hasProgram) { + output.WriteFixed32(2, field_names[4], Program); } - if (HasCompatibility) { - output.WriteUInt32(3, Compatibility); + if (hasCompatibility) { + output.WriteUInt32(3, field_names[1], Compatibility); } - if (HasCurrency) { - output.WriteString(4, Currency); + if (hasCurrency) { + output.WriteString(4, field_names[2], Currency); } - if (HasSpecialist) { - output.WriteInt32(5, Specialist); + if (hasSpecialist) { + output.WriteInt32(5, field_names[5], Specialist); } - if (HasAllowedRealm) { - output.WriteUInt32(6, AllowedRealm); + if (hasAllowedRealm) { + output.WriteUInt32(6, field_names[0], AllowedRealm); } UnknownFields.WriteTo(output); } @@ -356,22 +416,22 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasObject) { + if (hasObject) { size += pb::CodedOutputStream.ComputeMessageSize(1, Object); } - if (HasProgram) { + if (hasProgram) { size += pb::CodedOutputStream.ComputeFixed32Size(2, Program); } - if (HasCompatibility) { + if (hasCompatibility) { size += pb::CodedOutputStream.ComputeUInt32Size(3, Compatibility); } - if (HasCurrency) { + if (hasCurrency) { size += pb::CodedOutputStream.ComputeStringSize(4, Currency); } - if (HasSpecialist) { + if (hasSpecialist) { size += pb::CodedOutputStream.ComputeInt32Size(5, Specialist); } - if (HasAllowedRealm) { + if (hasAllowedRealm) { size += pb::CodedOutputStream.ComputeUInt32Size(6, AllowedRealm); } size += UnknownFields.SerializedSize; @@ -404,38 +464,72 @@ public static OrderBook ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static OrderBook ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OrderBook ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - OrderBook result = new OrderBook(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override OrderBook MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new OrderBook(); + 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 { @@ -447,12 +541,11 @@ public override OrderBook DefaultInstanceForType { } public override OrderBook BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - OrderBook returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -466,6 +559,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(OrderBook other) { if (other == global::bnet.protocol.exchange.OrderBook.DefaultInstance) return this; + PrepareBuilder(); if (other.HasObject) { MergeObject(other.Object); } @@ -488,20 +582,31 @@ public override Builder MergeFrom(OrderBook 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -513,12 +618,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.exchange.BlobOfType.Builder subBuilder = global::bnet.protocol.exchange.BlobOfType.CreateBuilder(); - if (HasObject) { + if (result.hasObject) { subBuilder.MergeFrom(Object); } input.ReadMessage(subBuilder, extensionRegistry); @@ -526,32 +631,37 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 21: { - Program = input.ReadFixed32(); + result.hasProgram = input.ReadFixed32(ref result.program_); break; } case 24: { - Compatibility = input.ReadUInt32(); + result.hasCompatibility = input.ReadUInt32(ref result.compatibility_); break; } case 34: { - Currency = input.ReadString(); + result.hasCurrency = input.ReadString(ref result.currency_); break; } case 40: { - Specialist = input.ReadInt32(); + result.hasSpecialist = input.ReadInt32(ref result.specialist_); break; } case 48: { - AllowedRealm = input.ReadUInt32(); + result.hasAllowedRealm = input.ReadUInt32(ref result.allowedRealm_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasObject { - get { return result.HasObject; } + get { return result.hasObject; } } public global::bnet.protocol.exchange.BlobOfType Object { get { return result.Object; } @@ -559,19 +669,22 @@ public bool HasObject { } 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"); - if (result.HasObject && + 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 { @@ -581,49 +694,54 @@ public Builder MergeObject(global::bnet.protocol.exchange.BlobOfType value) { return this; } public Builder ClearObject() { + PrepareBuilder(); result.hasObject = false; - result.object_ = global::bnet.protocol.exchange.BlobOfType.DefaultInstance; + result.object_ = null; 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 HasCompatibility { - get { return result.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; } + get { return result.hasCurrency; } } public string Currency { get { return result.Currency; } @@ -631,47 +749,53 @@ public string Currency { } 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; } + 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; } + 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; @@ -682,14 +806,20 @@ static OrderBook() { } } + [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 static readonly OrderBookHandle defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override OrderBookHandle ThisMessage { @@ -706,17 +836,17 @@ protected override OrderBookHandle ThisMessage { public const int PartitionIdFieldNumber = 1; private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId partitionId_; public bool HasPartitionId { get { return hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } } public const int OrderBookIdFieldNumber = 2; private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; + private ulong orderBookId_; public bool HasOrderBookId { get { return hasOrderBookId; } } @@ -733,13 +863,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _orderBookHandleFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); } - if (HasOrderBookId) { - output.WriteUInt64(2, OrderBookId); + if (hasOrderBookId) { + output.WriteUInt64(2, field_names[0], OrderBookId); } UnknownFields.WriteTo(output); } @@ -751,10 +882,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { + if (hasPartitionId) { size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasOrderBookId) { + if (hasOrderBookId) { size += pb::CodedOutputStream.ComputeUInt64Size(2, OrderBookId); } size += UnknownFields.SerializedSize; @@ -787,38 +918,72 @@ public static OrderBookHandle ParseDelimitedFrom(global::System.IO.Stream input) 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) { + public static OrderBookHandle ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OrderBookHandle ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - OrderBookHandle result = new OrderBookHandle(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override OrderBookHandle MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new OrderBookHandle(); + 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 { @@ -830,12 +995,11 @@ public override OrderBookHandle DefaultInstanceForType { } public override OrderBookHandle BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - OrderBookHandle returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -849,6 +1013,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(OrderBookHandle other) { if (other == global::bnet.protocol.exchange.OrderBookHandle.DefaultInstance) return this; + PrepareBuilder(); if (other.HasPartitionId) { MergePartitionId(other.PartitionId); } @@ -859,20 +1024,31 @@ public override Builder MergeFrom(OrderBookHandle 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -884,12 +1060,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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { + if (result.hasPartitionId) { subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -897,16 +1073,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - OrderBookId = input.ReadUInt64(); + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPartitionId { - get { return result.HasPartitionId; } + get { return result.hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { get { return result.PartitionId; } @@ -914,19 +1095,22 @@ public bool HasPartitionId { } 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"); - if (result.HasPartitionId && + 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 { @@ -936,24 +1120,27 @@ public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value return this; } public Builder ClearPartitionId() { + PrepareBuilder(); result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.partitionId_ = null; return this; } public bool HasOrderBookId { - get { return result.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; @@ -964,14 +1151,20 @@ static OrderBookHandle() { } } + [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 static readonly OrderBookNotification defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override OrderBookNotification ThisMessage { @@ -988,27 +1181,27 @@ protected override OrderBookNotification ThisMessage { public const int OrderBookFieldNumber = 1; private bool hasOrderBook; - private global::bnet.protocol.exchange.OrderBook orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; + private global::bnet.protocol.exchange.OrderBook orderBook_; public bool HasOrderBook { get { return hasOrderBook; } } public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return 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_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId partitionId_; public bool HasPartitionId { get { return hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } } public const int OrderBookIdFieldNumber = 3; private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; + private ulong orderBookId_; public bool HasOrderBookId { get { return hasOrderBookId; } } @@ -1018,7 +1211,7 @@ public ulong OrderBookId { public const int TradeNowPriceFieldNumber = 4; private bool hasTradeNowPrice; - private ulong tradeNowPrice_ = 0UL; + private ulong tradeNowPrice_; public bool HasTradeNowPrice { get { return hasTradeNowPrice; } } @@ -1026,9 +1219,19 @@ public ulong TradeNowPrice { get { return tradeNowPrice_; } } - public const int StatusFieldNumber = 5; + 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_ = 0; + private uint status_; public bool HasStatus { get { return hasStatus; } } @@ -1036,9 +1239,9 @@ public uint Status { get { return status_; } } - public const int UpdateTimeFieldNumber = 6; + public const int UpdateTimeFieldNumber = 7; private bool hasUpdateTime; - private ulong updateTime_ = 0UL; + private ulong updateTime_; public bool HasUpdateTime { get { return hasUpdateTime; } } @@ -1046,6 +1249,26 @@ 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; @@ -1053,31 +1276,42 @@ public override bool IsInitialized { 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::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOrderBook) { - output.WriteMessage(1, OrderBook); + string[] field_names = _orderBookNotificationFieldNames; + if (hasOrderBook) { + output.WriteMessage(1, field_names[2], OrderBook); + } + if (hasPartitionId) { + output.WriteMessage(2, field_names[4], PartitionId); } - if (HasPartitionId) { - output.WriteMessage(2, PartitionId); + if (hasOrderBookId) { + output.WriteUInt64(3, field_names[3], OrderBookId); } - if (HasOrderBookId) { - output.WriteUInt64(3, OrderBookId); + if (hasTradeNowPrice) { + output.WriteUInt64(4, field_names[6], TradeNowPrice); } - if (HasTradeNowPrice) { - output.WriteUInt64(4, TradeNowPrice); + if (hasWinningPrice) { + output.WriteUInt64(5, field_names[8], WinningPrice); } - if (HasStatus) { - output.WriteUInt32(5, Status); + if (hasStatus) { + output.WriteUInt32(6, field_names[5], Status); } - if (HasUpdateTime) { - output.WriteUInt64(6, UpdateTime); + 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); } @@ -1089,23 +1323,32 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOrderBook) { + if (hasOrderBook) { size += pb::CodedOutputStream.ComputeMessageSize(1, OrderBook); } - if (HasPartitionId) { + if (hasPartitionId) { size += pb::CodedOutputStream.ComputeMessageSize(2, PartitionId); } - if (HasOrderBookId) { + if (hasOrderBookId) { size += pb::CodedOutputStream.ComputeUInt64Size(3, OrderBookId); } - if (HasTradeNowPrice) { + if (hasTradeNowPrice) { size += pb::CodedOutputStream.ComputeUInt64Size(4, TradeNowPrice); } - if (HasStatus) { - size += pb::CodedOutputStream.ComputeUInt32Size(5, Status); + if (hasWinningPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(5, WinningPrice); + } + if (hasStatus) { + size += pb::CodedOutputStream.ComputeUInt32Size(6, Status); } - if (HasUpdateTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(6, UpdateTime); + 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; @@ -1137,38 +1380,72 @@ public static OrderBookNotification ParseDelimitedFrom(global::System.IO.Stream 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) { + public static OrderBookNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OrderBookNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - OrderBookNotification result = new OrderBookNotification(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override OrderBookNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new OrderBookNotification(); + 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,12 +1457,11 @@ public override OrderBookNotification DefaultInstanceForType { } public override OrderBookNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - OrderBookNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1199,6 +1475,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(OrderBookNotification other) { if (other == global::bnet.protocol.exchange.OrderBookNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOrderBook) { MergeOrderBook(other.OrderBook); } @@ -1211,30 +1488,50 @@ public override Builder MergeFrom(OrderBookNotification other) { 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::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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1246,12 +1543,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.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); - if (HasOrderBook) { + if (result.hasOrderBook) { subBuilder.MergeFrom(OrderBook); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1260,7 +1557,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { + if (result.hasPartitionId) { subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1268,28 +1565,45 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 24: { - OrderBookId = input.ReadUInt64(); + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); break; } case 32: { - TradeNowPrice = input.ReadUInt64(); + result.hasTradeNowPrice = input.ReadUInt64(ref result.tradeNowPrice_); break; } case 40: { - Status = input.ReadUInt32(); + result.hasWinningPrice = input.ReadUInt64(ref result.winningPrice_); break; } case 48: { - UpdateTime = input.ReadUInt64(); + 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; } + get { return result.hasOrderBook; } } public global::bnet.protocol.exchange.OrderBook OrderBook { get { return result.OrderBook; } @@ -1297,19 +1611,22 @@ public bool HasOrderBook { } 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"); - if (result.HasOrderBook && + 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 { @@ -1319,13 +1636,14 @@ public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { return this; } public Builder ClearOrderBook() { + PrepareBuilder(); result.hasOrderBook = false; - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; + result.orderBook_ = null; return this; } public bool HasPartitionId { - get { return result.HasPartitionId; } + get { return result.hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { get { return result.PartitionId; } @@ -1333,19 +1651,22 @@ public bool HasPartitionId { } 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"); - if (result.HasPartitionId && + 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 { @@ -1355,96 +1676,171 @@ public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value return this; } public Builder ClearPartitionId() { + PrepareBuilder(); result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.partitionId_ = null; return this; } public bool HasOrderBookId { - get { return result.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; } + 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; } + 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; } + 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 static readonly OrderBookSummary defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override OrderBookSummary ThisMessage { @@ -1461,17 +1857,17 @@ protected override OrderBookSummary ThisMessage { public const int PartitionIdFieldNumber = 1; private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId partitionId_; public bool HasPartitionId { get { return hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } } public const int OrderBookIdFieldNumber = 2; private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; + private ulong orderBookId_; public bool HasOrderBookId { get { return hasOrderBookId; } } @@ -1481,7 +1877,7 @@ public ulong OrderBookId { public const int ResultFieldNumber = 3; private bool hasResult; - private uint result_ = 0; + private uint result_; public bool HasResult { get { return hasResult; } } @@ -1491,17 +1887,17 @@ public uint Result { public const int OrderBookFieldNumber = 4; private bool hasOrderBook; - private global::bnet.protocol.exchange.OrderBook orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; + private global::bnet.protocol.exchange.OrderBook orderBook_; public bool HasOrderBook { get { return hasOrderBook; } } public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return orderBook_; } + get { return orderBook_ ?? global::bnet.protocol.exchange.OrderBook.DefaultInstance; } } public const int AmountFieldNumber = 5; private bool hasAmount; - private ulong amount_ = 0UL; + private ulong amount_; public bool HasAmount { get { return hasAmount; } } @@ -1511,7 +1907,7 @@ public ulong Amount { public const int BestOfferPriceFieldNumber = 6; private bool hasBestOfferPrice; - private ulong bestOfferPrice_ = 0UL; + private ulong bestOfferPrice_; public bool HasBestOfferPrice { get { return hasBestOfferPrice; } } @@ -1521,7 +1917,7 @@ public ulong BestOfferPrice { public const int BestBidPriceFieldNumber = 7; private bool hasBestBidPrice; - private ulong bestBidPrice_ = 0UL; + private ulong bestBidPrice_; public bool HasBestBidPrice { get { return hasBestBidPrice; } } @@ -1531,7 +1927,7 @@ public ulong BestBidPrice { public const int EndTimeFieldNumber = 8; private bool hasEndTime; - private ulong endTime_ = 0UL; + private ulong endTime_; public bool HasEndTime { get { return hasEndTime; } } @@ -1541,7 +1937,7 @@ public ulong EndTime { public const int StatusFieldNumber = 9; private bool hasStatus; - private int status_ = 0; + private int status_; public bool HasStatus { get { return hasStatus; } } @@ -1551,7 +1947,7 @@ public int Status { public const int CreatedTimeFieldNumber = 10; private bool hasCreatedTime; - private ulong createdTime_ = 0UL; + private ulong createdTime_; public bool HasCreatedTime { get { return hasCreatedTime; } } @@ -1561,7 +1957,7 @@ public ulong CreatedTime { public const int ActiveTimeFieldNumber = 11; private bool hasActiveTime; - private ulong activeTime_ = 0UL; + private ulong activeTime_; public bool HasActiveTime { get { return hasActiveTime; } } @@ -1571,7 +1967,7 @@ public ulong ActiveTime { public const int ClosedTimeFieldNumber = 12; private bool hasClosedTime; - private ulong closedTime_ = 0UL; + private ulong closedTime_; public bool HasClosedTime { get { return hasClosedTime; } } @@ -1581,7 +1977,7 @@ public ulong ClosedTime { public const int ReasonFieldNumber = 13; private bool hasReason; - private uint reason_ = 0; + private uint reason_; public bool HasReason { get { return hasReason; } } @@ -1591,7 +1987,7 @@ public uint Reason { public const int OutBidUnitPriceFieldNumber = 14; private bool hasOutBidUnitPrice; - private ulong outBidUnitPrice_ = 0UL; + private ulong outBidUnitPrice_; public bool HasOutBidUnitPrice { get { return hasOutBidUnitPrice; } } @@ -1612,49 +2008,50 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _orderBookSummaryFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[10], PartitionId); } - if (HasOrderBookId) { - output.WriteUInt64(2, OrderBookId); + if (hasOrderBookId) { + output.WriteUInt64(2, field_names[8], OrderBookId); } - if (HasResult) { - output.WriteUInt32(3, Result); + if (hasResult) { + output.WriteUInt32(3, field_names[12], Result); } - if (HasOrderBook) { - output.WriteMessage(4, OrderBook); + if (hasOrderBook) { + output.WriteMessage(4, field_names[7], OrderBook); } - if (HasAmount) { - output.WriteUInt64(5, Amount); + if (hasAmount) { + output.WriteUInt64(5, field_names[1], Amount); } - if (HasBestOfferPrice) { - output.WriteUInt64(6, BestOfferPrice); + if (hasBestOfferPrice) { + output.WriteUInt64(6, field_names[3], BestOfferPrice); } - if (HasBestBidPrice) { - output.WriteUInt64(7, BestBidPrice); + if (hasBestBidPrice) { + output.WriteUInt64(7, field_names[2], BestBidPrice); } - if (HasEndTime) { - output.WriteUInt64(8, EndTime); + if (hasEndTime) { + output.WriteUInt64(8, field_names[6], EndTime); } - if (HasStatus) { - output.WriteInt32(9, Status); + if (hasStatus) { + output.WriteInt32(9, field_names[13], Status); } - if (HasCreatedTime) { - output.WriteUInt64(10, CreatedTime); + if (hasCreatedTime) { + output.WriteUInt64(10, field_names[5], CreatedTime); } - if (HasActiveTime) { - output.WriteUInt64(11, ActiveTime); + if (hasActiveTime) { + output.WriteUInt64(11, field_names[0], ActiveTime); } - if (HasClosedTime) { - output.WriteUInt64(12, ClosedTime); + if (hasClosedTime) { + output.WriteUInt64(12, field_names[4], ClosedTime); } - if (HasReason) { - output.WriteUInt32(13, Reason); + if (hasReason) { + output.WriteUInt32(13, field_names[11], Reason); } - if (HasOutBidUnitPrice) { - output.WriteUInt64(14, OutBidUnitPrice); + if (hasOutBidUnitPrice) { + output.WriteUInt64(14, field_names[9], OutBidUnitPrice); } UnknownFields.WriteTo(output); } @@ -1666,46 +2063,46 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { + if (hasPartitionId) { size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasOrderBookId) { + if (hasOrderBookId) { size += pb::CodedOutputStream.ComputeUInt64Size(2, OrderBookId); } - if (HasResult) { + if (hasResult) { size += pb::CodedOutputStream.ComputeUInt32Size(3, Result); } - if (HasOrderBook) { + if (hasOrderBook) { size += pb::CodedOutputStream.ComputeMessageSize(4, OrderBook); } - if (HasAmount) { + if (hasAmount) { size += pb::CodedOutputStream.ComputeUInt64Size(5, Amount); } - if (HasBestOfferPrice) { + if (hasBestOfferPrice) { size += pb::CodedOutputStream.ComputeUInt64Size(6, BestOfferPrice); } - if (HasBestBidPrice) { + if (hasBestBidPrice) { size += pb::CodedOutputStream.ComputeUInt64Size(7, BestBidPrice); } - if (HasEndTime) { + if (hasEndTime) { size += pb::CodedOutputStream.ComputeUInt64Size(8, EndTime); } - if (HasStatus) { + if (hasStatus) { size += pb::CodedOutputStream.ComputeInt32Size(9, Status); } - if (HasCreatedTime) { + if (hasCreatedTime) { size += pb::CodedOutputStream.ComputeUInt64Size(10, CreatedTime); } - if (HasActiveTime) { + if (hasActiveTime) { size += pb::CodedOutputStream.ComputeUInt64Size(11, ActiveTime); } - if (HasClosedTime) { + if (hasClosedTime) { size += pb::CodedOutputStream.ComputeUInt64Size(12, ClosedTime); } - if (HasReason) { + if (hasReason) { size += pb::CodedOutputStream.ComputeUInt32Size(13, Reason); } - if (HasOutBidUnitPrice) { + if (hasOutBidUnitPrice) { size += pb::CodedOutputStream.ComputeUInt64Size(14, OutBidUnitPrice); } size += UnknownFields.SerializedSize; @@ -1738,38 +2135,72 @@ public static OrderBookSummary ParseDelimitedFrom(global::System.IO.Stream input 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) { + public static OrderBookSummary ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OrderBookSummary ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - OrderBookSummary result = new OrderBookSummary(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override OrderBookSummary MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new OrderBookSummary(); + 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,12 +2212,11 @@ public override OrderBookSummary DefaultInstanceForType { } public override OrderBookSummary BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - OrderBookSummary returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1800,6 +2230,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(OrderBookSummary other) { if (other == global::bnet.protocol.exchange.OrderBookSummary.DefaultInstance) return this; + PrepareBuilder(); if (other.HasPartitionId) { MergePartitionId(other.PartitionId); } @@ -1846,20 +2277,31 @@ public override Builder MergeFrom(OrderBookSummary 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1871,12 +2313,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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { + if (result.hasPartitionId) { subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1884,16 +2326,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - OrderBookId = input.ReadUInt64(); + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); break; } case 24: { - Result = input.ReadUInt32(); + result.hasResult = input.ReadUInt32(ref result.result_); break; } case 34: { global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); - if (HasOrderBook) { + if (result.hasOrderBook) { subBuilder.MergeFrom(OrderBook); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1901,52 +2343,57 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 40: { - Amount = input.ReadUInt64(); + result.hasAmount = input.ReadUInt64(ref result.amount_); break; } case 48: { - BestOfferPrice = input.ReadUInt64(); + result.hasBestOfferPrice = input.ReadUInt64(ref result.bestOfferPrice_); break; } case 56: { - BestBidPrice = input.ReadUInt64(); + result.hasBestBidPrice = input.ReadUInt64(ref result.bestBidPrice_); break; } case 64: { - EndTime = input.ReadUInt64(); + result.hasEndTime = input.ReadUInt64(ref result.endTime_); break; } case 72: { - Status = input.ReadInt32(); + result.hasStatus = input.ReadInt32(ref result.status_); break; } case 80: { - CreatedTime = input.ReadUInt64(); + result.hasCreatedTime = input.ReadUInt64(ref result.createdTime_); break; } case 88: { - ActiveTime = input.ReadUInt64(); + result.hasActiveTime = input.ReadUInt64(ref result.activeTime_); break; } case 96: { - ClosedTime = input.ReadUInt64(); + result.hasClosedTime = input.ReadUInt64(ref result.closedTime_); break; } case 104: { - Reason = input.ReadUInt32(); + result.hasReason = input.ReadUInt32(ref result.reason_); break; } case 112: { - OutBidUnitPrice = input.ReadUInt64(); + result.hasOutBidUnitPrice = input.ReadUInt64(ref result.outBidUnitPrice_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPartitionId { - get { return result.HasPartitionId; } + get { return result.hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { get { return result.PartitionId; } @@ -1954,19 +2401,22 @@ public bool HasPartitionId { } 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"); - if (result.HasPartitionId && + 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 { @@ -1976,49 +2426,54 @@ public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value return this; } public Builder ClearPartitionId() { + PrepareBuilder(); result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.partitionId_ = null; return this; } public bool HasOrderBookId { - get { return result.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; } + 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; } + get { return result.hasOrderBook; } } public global::bnet.protocol.exchange.OrderBook OrderBook { get { return result.OrderBook; } @@ -2026,19 +2481,22 @@ public bool HasOrderBook { } 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"); - if (result.HasOrderBook && + 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 { @@ -2048,186 +2506,207 @@ public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { return this; } public Builder ClearOrderBook() { + PrepareBuilder(); result.hasOrderBook = false; - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; + result.orderBook_ = null; return this; } public bool HasAmount { - get { return result.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; } + 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; } + 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; } + 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; } + 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; } + 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; } + 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; } + 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; } + 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; } + 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; @@ -2238,14 +2717,20 @@ static OrderBookSummary() { } } + [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 static readonly Order defaultInstance = new Builder().BuildPartial(); + 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", "start_time", "toon" }; + private static readonly uint[] _orderFieldTags = new uint[] { 42, 34, 8, 50, 24, 58, 16, 66 }; public static Order DefaultInstance { get { return defaultInstance; } } public override Order DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Order ThisMessage { @@ -2262,7 +2747,7 @@ protected override Order ThisMessage { public const int AmountFieldNumber = 1; private bool hasAmount; - private uint amount_ = 0; + private uint amount_; public bool HasAmount { get { return hasAmount; } } @@ -2272,7 +2757,7 @@ public uint Amount { public const int StartTimeFieldNumber = 2; private bool hasStartTime; - private ulong startTime_ = 0UL; + private ulong startTime_; public bool HasStartTime { get { return hasStartTime; } } @@ -2282,7 +2767,7 @@ public ulong StartTime { public const int EndTimeFieldNumber = 3; private bool hasEndTime; - private ulong endTime_ = 0UL; + private ulong endTime_; public bool HasEndTime { get { return hasEndTime; } } @@ -2292,52 +2777,52 @@ public ulong EndTime { public const int AccountForMoneyFieldNumber = 4; private bool hasAccountForMoney; - private global::bnet.protocol.exchange.BlobFrom accountForMoney_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; + private global::bnet.protocol.exchange.BlobFrom accountForMoney_; public bool HasAccountForMoney { get { return hasAccountForMoney; } } public global::bnet.protocol.exchange.BlobFrom AccountForMoney { - get { return 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_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; + private global::bnet.protocol.exchange.BlobFrom accountForItem_; public bool HasAccountForItem { get { return hasAccountForItem; } } public global::bnet.protocol.exchange.BlobFrom AccountForItem { - get { return accountForItem_; } + get { return accountForItem_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } } public const int BnetAccountFieldNumber = 6; private bool hasBnetAccount; - private global::bnet.protocol.EntityId bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId bnetAccount_; public bool HasBnetAccount { get { return hasBnetAccount; } } public global::bnet.protocol.EntityId BnetAccount { - get { return bnetAccount_; } + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int GameAccountFieldNumber = 7; private bool hasGameAccount; - private global::bnet.protocol.EntityId gameAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId gameAccount_; public bool HasGameAccount { get { return hasGameAccount; } } public global::bnet.protocol.EntityId GameAccount { - get { return gameAccount_; } + get { return gameAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ToonFieldNumber = 8; private bool hasToon; - private global::bnet.protocol.EntityId toon_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId toon_; public bool HasToon { get { return hasToon; } } public global::bnet.protocol.EntityId Toon { - get { return toon_; } + get { return toon_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -2362,31 +2847,32 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAmount) { - output.WriteUInt32(1, Amount); + string[] field_names = _orderFieldNames; + if (hasAmount) { + output.WriteUInt32(1, field_names[2], Amount); } - if (HasStartTime) { - output.WriteUInt64(2, StartTime); + if (hasStartTime) { + output.WriteUInt64(2, field_names[6], StartTime); } - if (HasEndTime) { - output.WriteUInt64(3, EndTime); + if (hasEndTime) { + output.WriteUInt64(3, field_names[4], EndTime); } - if (HasAccountForMoney) { - output.WriteMessage(4, AccountForMoney); + if (hasAccountForMoney) { + output.WriteMessage(4, field_names[1], AccountForMoney); } - if (HasAccountForItem) { - output.WriteMessage(5, AccountForItem); + if (hasAccountForItem) { + output.WriteMessage(5, field_names[0], AccountForItem); } - if (HasBnetAccount) { - output.WriteMessage(6, BnetAccount); + if (hasBnetAccount) { + output.WriteMessage(6, field_names[3], BnetAccount); } - if (HasGameAccount) { - output.WriteMessage(7, GameAccount); + if (hasGameAccount) { + output.WriteMessage(7, field_names[5], GameAccount); } - if (HasToon) { - output.WriteMessage(8, Toon); + if (hasToon) { + output.WriteMessage(8, field_names[7], Toon); } UnknownFields.WriteTo(output); } @@ -2398,28 +2884,28 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAmount) { + if (hasAmount) { size += pb::CodedOutputStream.ComputeUInt32Size(1, Amount); } - if (HasStartTime) { + if (hasStartTime) { size += pb::CodedOutputStream.ComputeUInt64Size(2, StartTime); } - if (HasEndTime) { + if (hasEndTime) { size += pb::CodedOutputStream.ComputeUInt64Size(3, EndTime); } - if (HasAccountForMoney) { + if (hasAccountForMoney) { size += pb::CodedOutputStream.ComputeMessageSize(4, AccountForMoney); } - if (HasAccountForItem) { + if (hasAccountForItem) { size += pb::CodedOutputStream.ComputeMessageSize(5, AccountForItem); } - if (HasBnetAccount) { + if (hasBnetAccount) { size += pb::CodedOutputStream.ComputeMessageSize(6, BnetAccount); } - if (HasGameAccount) { + if (hasGameAccount) { size += pb::CodedOutputStream.ComputeMessageSize(7, GameAccount); } - if (HasToon) { + if (hasToon) { size += pb::CodedOutputStream.ComputeMessageSize(8, Toon); } size += UnknownFields.SerializedSize; @@ -2452,38 +2938,72 @@ public static Order ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Order ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Order ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - Order result = new Order(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Order MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Order(); + 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 { @@ -2495,12 +3015,11 @@ public override Order DefaultInstanceForType { } public override Order BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Order returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2514,6 +3033,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Order other) { if (other == global::bnet.protocol.exchange.Order.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAmount) { Amount = other.Amount; } @@ -2542,20 +3062,31 @@ public override Builder MergeFrom(Order 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2567,24 +3098,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: { - Amount = input.ReadUInt32(); + result.hasAmount = input.ReadUInt32(ref result.amount_); break; } case 16: { - StartTime = input.ReadUInt64(); + result.hasStartTime = input.ReadUInt64(ref result.startTime_); break; } case 24: { - EndTime = input.ReadUInt64(); + result.hasEndTime = input.ReadUInt64(ref result.endTime_); break; } case 34: { global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); - if (HasAccountForMoney) { + if (result.hasAccountForMoney) { subBuilder.MergeFrom(AccountForMoney); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2593,7 +3124,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 42: { global::bnet.protocol.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); - if (HasAccountForItem) { + if (result.hasAccountForItem) { subBuilder.MergeFrom(AccountForItem); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2602,7 +3133,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 50: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccount) { + if (result.hasBnetAccount) { subBuilder.MergeFrom(BnetAccount); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2611,7 +3142,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 58: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccount) { + if (result.hasGameAccount) { subBuilder.MergeFrom(GameAccount); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2620,7 +3151,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 66: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToon) { + if (result.hasToon) { subBuilder.MergeFrom(Toon); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2629,65 +3160,76 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAmount { - get { return result.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; } + 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; } + 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; } + get { return result.hasAccountForMoney; } } public global::bnet.protocol.exchange.BlobFrom AccountForMoney { get { return result.AccountForMoney; } @@ -2695,19 +3237,22 @@ public bool HasAccountForMoney { } 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"); - if (result.HasAccountForMoney && + 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 { @@ -2717,13 +3262,14 @@ public Builder MergeAccountForMoney(global::bnet.protocol.exchange.BlobFrom valu return this; } public Builder ClearAccountForMoney() { + PrepareBuilder(); result.hasAccountForMoney = false; - result.accountForMoney_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; + result.accountForMoney_ = null; return this; } public bool HasAccountForItem { - get { return result.HasAccountForItem; } + get { return result.hasAccountForItem; } } public global::bnet.protocol.exchange.BlobFrom AccountForItem { get { return result.AccountForItem; } @@ -2731,19 +3277,22 @@ public bool HasAccountForItem { } 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"); - if (result.HasAccountForItem && + 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 { @@ -2753,13 +3302,14 @@ public Builder MergeAccountForItem(global::bnet.protocol.exchange.BlobFrom value return this; } public Builder ClearAccountForItem() { + PrepareBuilder(); result.hasAccountForItem = false; - result.accountForItem_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; + result.accountForItem_ = null; return this; } public bool HasBnetAccount { - get { return result.HasBnetAccount; } + get { return result.hasBnetAccount; } } public global::bnet.protocol.EntityId BnetAccount { get { return result.BnetAccount; } @@ -2767,19 +3317,22 @@ public bool HasBnetAccount { } 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"); - if (result.HasBnetAccount && + PrepareBuilder(); + if (result.hasBnetAccount && result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); } else { @@ -2789,13 +3342,14 @@ public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { return this; } public Builder ClearBnetAccount() { + PrepareBuilder(); result.hasBnetAccount = false; - result.bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + result.bnetAccount_ = null; return this; } public bool HasGameAccount { - get { return result.HasGameAccount; } + get { return result.hasGameAccount; } } public global::bnet.protocol.EntityId GameAccount { get { return result.GameAccount; } @@ -2803,19 +3357,22 @@ public bool HasGameAccount { } 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"); - if (result.HasGameAccount && + PrepareBuilder(); + if (result.hasGameAccount && result.gameAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { result.gameAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccount_).MergeFrom(value).BuildPartial(); } else { @@ -2825,13 +3382,14 @@ public Builder MergeGameAccount(global::bnet.protocol.EntityId value) { return this; } public Builder ClearGameAccount() { + PrepareBuilder(); result.hasGameAccount = false; - result.gameAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + result.gameAccount_ = null; return this; } public bool HasToon { - get { return result.HasToon; } + get { return result.hasToon; } } public global::bnet.protocol.EntityId Toon { get { return result.Toon; } @@ -2839,19 +3397,22 @@ public bool HasToon { } public Builder SetToon(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToon = true; result.toon_ = value; return this; } public Builder SetToon(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToon && result.toon_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toon_ = global::bnet.protocol.EntityId.CreateBuilder(result.toon_).MergeFrom(value).BuildPartial(); } else { @@ -2861,8 +3422,9 @@ public Builder MergeToon(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToon() { + PrepareBuilder(); result.hasToon = false; - result.toon_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toon_ = null; return this; } } @@ -2871,14 +3433,20 @@ static Order() { } } + [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 static readonly Extension defaultInstance = new Builder().BuildPartial(); + private Extension() { } + private static readonly Extension defaultInstance = new Extension().MakeReadOnly(); + private static readonly string[] _extensionFieldNames = new string[] { "authorized_time", "closed_time", "created_time", "filled_amount", "items_to_claim", "money_to_claim", "order_book", "order_book_id", "order_book_status", "order_id", "order_status", "partition_id", "reason", "risk_delayed" }; + private static readonly uint[] _extensionFieldTags = new uint[] { 48, 64, 56, 32, 104, 96, 82, 16, 88, 24, 40, 10, 72, 112 }; public static Extension DefaultInstance { get { return defaultInstance; } } public override Extension DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Extension ThisMessage { @@ -2895,17 +3463,17 @@ protected override Extension ThisMessage { public const int PartitionIdFieldNumber = 1; private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId partitionId_; public bool HasPartitionId { get { return hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return partitionId_; } + get { return partitionId_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } } public const int OrderBookIdFieldNumber = 2; private bool hasOrderBookId; - private ulong orderBookId_ = 0UL; + private ulong orderBookId_; public bool HasOrderBookId { get { return hasOrderBookId; } } @@ -2915,7 +3483,7 @@ public ulong OrderBookId { public const int OrderIdFieldNumber = 3; private bool hasOrderId; - private ulong orderId_ = 0UL; + private ulong orderId_; public bool HasOrderId { get { return hasOrderId; } } @@ -2925,7 +3493,7 @@ public ulong OrderId { public const int FilledAmountFieldNumber = 4; private bool hasFilledAmount; - private ulong filledAmount_ = 0UL; + private ulong filledAmount_; public bool HasFilledAmount { get { return hasFilledAmount; } } @@ -2935,7 +3503,7 @@ public ulong FilledAmount { public const int OrderStatusFieldNumber = 5; private bool hasOrderStatus; - private int orderStatus_ = 0; + private int orderStatus_; public bool HasOrderStatus { get { return hasOrderStatus; } } @@ -2945,7 +3513,7 @@ public int OrderStatus { public const int AuthorizedTimeFieldNumber = 6; private bool hasAuthorizedTime; - private ulong authorizedTime_ = 0UL; + private ulong authorizedTime_; public bool HasAuthorizedTime { get { return hasAuthorizedTime; } } @@ -2955,7 +3523,7 @@ public ulong AuthorizedTime { public const int CreatedTimeFieldNumber = 7; private bool hasCreatedTime; - private ulong createdTime_ = 0UL; + private ulong createdTime_; public bool HasCreatedTime { get { return hasCreatedTime; } } @@ -2965,7 +3533,7 @@ public ulong CreatedTime { public const int ClosedTimeFieldNumber = 8; private bool hasClosedTime; - private ulong closedTime_ = 0UL; + private ulong closedTime_; public bool HasClosedTime { get { return hasClosedTime; } } @@ -2975,7 +3543,7 @@ public ulong ClosedTime { public const int ReasonFieldNumber = 9; private bool hasReason; - private uint reason_ = 0; + private uint reason_; public bool HasReason { get { return hasReason; } } @@ -2985,17 +3553,17 @@ public uint Reason { public const int OrderBookFieldNumber = 10; private bool hasOrderBook; - private global::bnet.protocol.exchange.OrderBook orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; + private global::bnet.protocol.exchange.OrderBook orderBook_; public bool HasOrderBook { get { return hasOrderBook; } } public global::bnet.protocol.exchange.OrderBook OrderBook { - get { return orderBook_; } + get { return orderBook_ ?? global::bnet.protocol.exchange.OrderBook.DefaultInstance; } } public const int OrderBookStatusFieldNumber = 11; private bool hasOrderBookStatus; - private ulong orderBookStatus_ = 0UL; + private ulong orderBookStatus_; public bool HasOrderBookStatus { get { return hasOrderBookStatus; } } @@ -3005,7 +3573,7 @@ public ulong OrderBookStatus { public const int MoneyToClaimFieldNumber = 12; private bool hasMoneyToClaim; - private ulong moneyToClaim_ = 0UL; + private ulong moneyToClaim_; public bool HasMoneyToClaim { get { return hasMoneyToClaim; } } @@ -3015,7 +3583,7 @@ public ulong MoneyToClaim { public const int ItemsToClaimFieldNumber = 13; private bool hasItemsToClaim; - private ulong itemsToClaim_ = 0UL; + private ulong itemsToClaim_; public bool HasItemsToClaim { get { return hasItemsToClaim; } } @@ -3023,6 +3591,16 @@ 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 override bool IsInitialized { get { if (!hasPartitionId) return false; @@ -3036,46 +3614,50 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _extensionFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[11], PartitionId); } - if (HasOrderBookId) { - output.WriteUInt64(2, OrderBookId); + if (hasOrderBookId) { + output.WriteUInt64(2, field_names[7], OrderBookId); } - if (HasOrderId) { - output.WriteUInt64(3, OrderId); + if (hasOrderId) { + output.WriteUInt64(3, field_names[9], OrderId); } - if (HasFilledAmount) { - output.WriteUInt64(4, FilledAmount); + if (hasFilledAmount) { + output.WriteUInt64(4, field_names[3], FilledAmount); } - if (HasOrderStatus) { - output.WriteInt32(5, OrderStatus); + if (hasOrderStatus) { + output.WriteInt32(5, field_names[10], OrderStatus); } - if (HasAuthorizedTime) { - output.WriteUInt64(6, AuthorizedTime); + if (hasAuthorizedTime) { + output.WriteUInt64(6, field_names[0], AuthorizedTime); } - if (HasCreatedTime) { - output.WriteUInt64(7, CreatedTime); + if (hasCreatedTime) { + output.WriteUInt64(7, field_names[2], CreatedTime); } - if (HasClosedTime) { - output.WriteUInt64(8, ClosedTime); + if (hasClosedTime) { + output.WriteUInt64(8, field_names[1], ClosedTime); } - if (HasReason) { - output.WriteUInt32(9, Reason); + if (hasReason) { + output.WriteUInt32(9, field_names[12], Reason); } - if (HasOrderBook) { - output.WriteMessage(10, OrderBook); + if (hasOrderBook) { + output.WriteMessage(10, field_names[6], OrderBook); } - if (HasOrderBookStatus) { - output.WriteUInt64(11, OrderBookStatus); + if (hasOrderBookStatus) { + output.WriteUInt64(11, field_names[8], OrderBookStatus); } - if (HasMoneyToClaim) { - output.WriteUInt64(12, MoneyToClaim); + if (hasMoneyToClaim) { + output.WriteUInt64(12, field_names[5], MoneyToClaim); } - if (HasItemsToClaim) { - output.WriteUInt64(13, ItemsToClaim); + if (hasItemsToClaim) { + output.WriteUInt64(13, field_names[4], ItemsToClaim); + } + if (hasRiskDelayed) { + output.WriteBool(14, field_names[13], RiskDelayed); } UnknownFields.WriteTo(output); } @@ -3087,45 +3669,48 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { + if (hasPartitionId) { size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasOrderBookId) { + if (hasOrderBookId) { size += pb::CodedOutputStream.ComputeUInt64Size(2, OrderBookId); } - if (HasOrderId) { + if (hasOrderId) { size += pb::CodedOutputStream.ComputeUInt64Size(3, OrderId); } - if (HasFilledAmount) { + if (hasFilledAmount) { size += pb::CodedOutputStream.ComputeUInt64Size(4, FilledAmount); } - if (HasOrderStatus) { + if (hasOrderStatus) { size += pb::CodedOutputStream.ComputeInt32Size(5, OrderStatus); } - if (HasAuthorizedTime) { + if (hasAuthorizedTime) { size += pb::CodedOutputStream.ComputeUInt64Size(6, AuthorizedTime); } - if (HasCreatedTime) { + if (hasCreatedTime) { size += pb::CodedOutputStream.ComputeUInt64Size(7, CreatedTime); } - if (HasClosedTime) { + if (hasClosedTime) { size += pb::CodedOutputStream.ComputeUInt64Size(8, ClosedTime); } - if (HasReason) { + if (hasReason) { size += pb::CodedOutputStream.ComputeUInt32Size(9, Reason); } - if (HasOrderBook) { + if (hasOrderBook) { size += pb::CodedOutputStream.ComputeMessageSize(10, OrderBook); } - if (HasOrderBookStatus) { + if (hasOrderBookStatus) { size += pb::CodedOutputStream.ComputeUInt64Size(11, OrderBookStatus); } - if (HasMoneyToClaim) { + if (hasMoneyToClaim) { size += pb::CodedOutputStream.ComputeUInt64Size(12, MoneyToClaim); } - if (HasItemsToClaim) { + if (hasItemsToClaim) { size += pb::CodedOutputStream.ComputeUInt64Size(13, ItemsToClaim); } + if (hasRiskDelayed) { + size += pb::CodedOutputStream.ComputeBoolSize(14, RiskDelayed); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -3156,38 +3741,72 @@ public static Extension ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Extension ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Extension ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - Extension result = new Extension(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Extension MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Extension(); + 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 { @@ -3199,12 +3818,11 @@ public override Extension DefaultInstanceForType { } public override Extension BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Extension returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3218,6 +3836,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Extension other) { if (other == global::bnet.protocol.exchange.Extension.DefaultInstance) return this; + PrepareBuilder(); if (other.HasPartitionId) { MergePartitionId(other.PartitionId); } @@ -3257,24 +3876,38 @@ public override Builder MergeFrom(Extension other) { if (other.HasItemsToClaim) { ItemsToClaim = other.ItemsToClaim; } + if (other.HasRiskDelayed) { + RiskDelayed = other.RiskDelayed; + } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3286,12 +3919,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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { + if (result.hasPartitionId) { subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3299,40 +3932,40 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - OrderBookId = input.ReadUInt64(); + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); break; } case 24: { - OrderId = input.ReadUInt64(); + result.hasOrderId = input.ReadUInt64(ref result.orderId_); break; } case 32: { - FilledAmount = input.ReadUInt64(); + result.hasFilledAmount = input.ReadUInt64(ref result.filledAmount_); break; } case 40: { - OrderStatus = input.ReadInt32(); + result.hasOrderStatus = input.ReadInt32(ref result.orderStatus_); break; } case 48: { - AuthorizedTime = input.ReadUInt64(); + result.hasAuthorizedTime = input.ReadUInt64(ref result.authorizedTime_); break; } case 56: { - CreatedTime = input.ReadUInt64(); + result.hasCreatedTime = input.ReadUInt64(ref result.createdTime_); break; } case 64: { - ClosedTime = input.ReadUInt64(); + result.hasClosedTime = input.ReadUInt64(ref result.closedTime_); break; } case 72: { - Reason = input.ReadUInt32(); + result.hasReason = input.ReadUInt32(ref result.reason_); break; } case 82: { global::bnet.protocol.exchange.OrderBook.Builder subBuilder = global::bnet.protocol.exchange.OrderBook.CreateBuilder(); - if (HasOrderBook) { + if (result.hasOrderBook) { subBuilder.MergeFrom(OrderBook); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3340,24 +3973,33 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 88: { - OrderBookStatus = input.ReadUInt64(); + result.hasOrderBookStatus = input.ReadUInt64(ref result.orderBookStatus_); break; } case 96: { - MoneyToClaim = input.ReadUInt64(); + result.hasMoneyToClaim = input.ReadUInt64(ref result.moneyToClaim_); break; } case 104: { - ItemsToClaim = input.ReadUInt64(); + result.hasItemsToClaim = input.ReadUInt64(ref result.itemsToClaim_); + break; + } + case 112: { + result.hasRiskDelayed = input.ReadBool(ref result.riskDelayed_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPartitionId { - get { return result.HasPartitionId; } + get { return result.hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { get { return result.PartitionId; } @@ -3365,19 +4007,22 @@ public bool HasPartitionId { } 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"); - if (result.HasPartitionId && + 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 { @@ -3387,157 +4032,174 @@ public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value return this; } public Builder ClearPartitionId() { + PrepareBuilder(); result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.partitionId_ = null; return this; } public bool HasOrderBookId { - get { return result.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; } + 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; } + 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; } + 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; } + 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; } + 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; } + 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; } + 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; } + get { return result.hasOrderBook; } } public global::bnet.protocol.exchange.OrderBook OrderBook { get { return result.OrderBook; } @@ -3545,19 +4207,22 @@ public bool HasOrderBook { } 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"); - if (result.HasOrderBook && + 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 { @@ -3567,78 +4232,111 @@ public Builder MergeOrderBook(global::bnet.protocol.exchange.OrderBook value) { return this; } public Builder ClearOrderBook() { + PrepareBuilder(); result.hasOrderBook = false; - result.orderBook_ = global::bnet.protocol.exchange.OrderBook.DefaultInstance; + result.orderBook_ = null; return this; } public bool HasOrderBookStatus { - get { return result.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; } + 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; } + 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; + } } 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 static readonly Offer defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override Offer ThisMessage { @@ -3655,17 +4353,17 @@ protected override Offer ThisMessage { public const int OrderFieldNumber = 1; private bool hasOrder; - private global::bnet.protocol.exchange.Order order_ = global::bnet.protocol.exchange.Order.DefaultInstance; + private global::bnet.protocol.exchange.Order order_; public bool HasOrder { get { return hasOrder; } } public global::bnet.protocol.exchange.Order Order { - get { return order_; } + get { return order_ ?? global::bnet.protocol.exchange.Order.DefaultInstance; } } public const int TradeNowPriceFieldNumber = 2; private bool hasTradeNowPrice; - private ulong tradeNowPrice_ = 0UL; + private ulong tradeNowPrice_; public bool HasTradeNowPrice { get { return hasTradeNowPrice; } } @@ -3675,7 +4373,7 @@ public ulong TradeNowPrice { public const int ReservePriceFieldNumber = 3; private bool hasReservePrice; - private ulong reservePrice_ = 0UL; + private ulong reservePrice_; public bool HasReservePrice { get { return hasReservePrice; } } @@ -3685,7 +4383,7 @@ public ulong ReservePrice { public const int OutBidPriceFieldNumber = 4; private bool hasOutBidPrice; - private ulong outBidPrice_ = 0UL; + private ulong outBidPrice_; public bool HasOutBidPrice { get { return hasOutBidPrice; } } @@ -3701,19 +4399,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOrder) { - output.WriteMessage(1, Order); + string[] field_names = _offerFieldNames; + if (hasOrder) { + output.WriteMessage(1, field_names[0], Order); } - if (HasTradeNowPrice) { - output.WriteUInt64(2, TradeNowPrice); + if (hasTradeNowPrice) { + output.WriteUInt64(2, field_names[3], TradeNowPrice); } - if (HasReservePrice) { - output.WriteUInt64(3, ReservePrice); + if (hasReservePrice) { + output.WriteUInt64(3, field_names[2], ReservePrice); } - if (HasOutBidPrice) { - output.WriteUInt64(4, OutBidPrice); + if (hasOutBidPrice) { + output.WriteUInt64(4, field_names[1], OutBidPrice); } UnknownFields.WriteTo(output); } @@ -3725,16 +4424,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOrder) { + if (hasOrder) { size += pb::CodedOutputStream.ComputeMessageSize(1, Order); } - if (HasTradeNowPrice) { + if (hasTradeNowPrice) { size += pb::CodedOutputStream.ComputeUInt64Size(2, TradeNowPrice); } - if (HasReservePrice) { + if (hasReservePrice) { size += pb::CodedOutputStream.ComputeUInt64Size(3, ReservePrice); } - if (HasOutBidPrice) { + if (hasOutBidPrice) { size += pb::CodedOutputStream.ComputeUInt64Size(4, OutBidPrice); } size += UnknownFields.SerializedSize; @@ -3767,38 +4466,72 @@ public static Offer ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Offer ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Offer ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - Offer result = new Offer(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Offer MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Offer(); + 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 { @@ -3810,12 +4543,11 @@ public override Offer DefaultInstanceForType { } public override Offer BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Offer returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3829,6 +4561,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Offer other) { if (other == global::bnet.protocol.exchange.Offer.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOrder) { MergeOrder(other.Order); } @@ -3845,20 +4578,31 @@ public override Builder MergeFrom(Offer 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3870,12 +4614,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.exchange.Order.Builder subBuilder = global::bnet.protocol.exchange.Order.CreateBuilder(); - if (HasOrder) { + if (result.hasOrder) { subBuilder.MergeFrom(Order); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3883,24 +4627,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - TradeNowPrice = input.ReadUInt64(); + result.hasTradeNowPrice = input.ReadUInt64(ref result.tradeNowPrice_); break; } case 24: { - ReservePrice = input.ReadUInt64(); + result.hasReservePrice = input.ReadUInt64(ref result.reservePrice_); break; } case 32: { - OutBidPrice = input.ReadUInt64(); + result.hasOutBidPrice = input.ReadUInt64(ref result.outBidPrice_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasOrder { - get { return result.HasOrder; } + get { return result.hasOrder; } } public global::bnet.protocol.exchange.Order Order { get { return result.Order; } @@ -3908,19 +4657,22 @@ public bool HasOrder { } 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"); - if (result.HasOrder && + 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 { @@ -3930,60 +4682,67 @@ public Builder MergeOrder(global::bnet.protocol.exchange.Order value) { return this; } public Builder ClearOrder() { + PrepareBuilder(); result.hasOrder = false; - result.order_ = global::bnet.protocol.exchange.Order.DefaultInstance; + result.order_ = null; return this; } public bool HasTradeNowPrice { - get { return result.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; } + 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; } + 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; @@ -3994,14 +4753,20 @@ static Offer() { } } + [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 static readonly OfferExtended defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override OfferExtended ThisMessage { @@ -4018,27 +4783,27 @@ protected override OfferExtended ThisMessage { public const int OfferFieldNumber = 1; private bool hasOffer; - private global::bnet.protocol.exchange.Offer offer_ = global::bnet.protocol.exchange.Offer.DefaultInstance; + private global::bnet.protocol.exchange.Offer offer_; public bool HasOffer { get { return hasOffer; } } public global::bnet.protocol.exchange.Offer Offer { - get { return 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_ = global::bnet.protocol.exchange.Extension.DefaultInstance; + private global::bnet.protocol.exchange.Extension extension_; public bool HasExtension { get { return hasExtension; } } public global::bnet.protocol.exchange.Extension Extension { - get { return extension_; } + get { return extension_ ?? global::bnet.protocol.exchange.Extension.DefaultInstance; } } public const int CurrentWinningPriceFieldNumber = 3; private bool hasCurrentWinningPrice; - private ulong currentWinningPrice_ = 0UL; + private ulong currentWinningPrice_; public bool HasCurrentWinningPrice { get { return hasCurrentWinningPrice; } } @@ -4056,16 +4821,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOffer) { - output.WriteMessage(1, Offer); + string[] field_names = _offerExtendedFieldNames; + if (hasOffer) { + output.WriteMessage(1, field_names[2], Offer); } - if (HasExtension) { - output.WriteMessage(2, Extension); + if (hasExtension) { + output.WriteMessage(2, field_names[1], Extension); } - if (HasCurrentWinningPrice) { - output.WriteUInt64(3, CurrentWinningPrice); + if (hasCurrentWinningPrice) { + output.WriteUInt64(3, field_names[0], CurrentWinningPrice); } UnknownFields.WriteTo(output); } @@ -4077,13 +4843,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOffer) { + if (hasOffer) { size += pb::CodedOutputStream.ComputeMessageSize(1, Offer); } - if (HasExtension) { + if (hasExtension) { size += pb::CodedOutputStream.ComputeMessageSize(2, Extension); } - if (HasCurrentWinningPrice) { + if (hasCurrentWinningPrice) { size += pb::CodedOutputStream.ComputeUInt64Size(3, CurrentWinningPrice); } size += UnknownFields.SerializedSize; @@ -4116,38 +4882,72 @@ public static OfferExtended ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static OfferExtended ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OfferExtended ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - OfferExtended result = new OfferExtended(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override OfferExtended MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new OfferExtended(); + 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 { @@ -4159,12 +4959,11 @@ public override OfferExtended DefaultInstanceForType { } public override OfferExtended BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - OfferExtended returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4178,6 +4977,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(OfferExtended other) { if (other == global::bnet.protocol.exchange.OfferExtended.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOffer) { MergeOffer(other.Offer); } @@ -4191,20 +4991,31 @@ public override Builder MergeFrom(OfferExtended 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4216,12 +5027,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.exchange.Offer.Builder subBuilder = global::bnet.protocol.exchange.Offer.CreateBuilder(); - if (HasOffer) { + if (result.hasOffer) { subBuilder.MergeFrom(Offer); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4230,7 +5041,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.Extension.Builder subBuilder = global::bnet.protocol.exchange.Extension.CreateBuilder(); - if (HasExtension) { + if (result.hasExtension) { subBuilder.MergeFrom(Extension); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4238,16 +5049,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 24: { - CurrentWinningPrice = input.ReadUInt64(); + result.hasCurrentWinningPrice = input.ReadUInt64(ref result.currentWinningPrice_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasOffer { - get { return result.HasOffer; } + get { return result.hasOffer; } } public global::bnet.protocol.exchange.Offer Offer { get { return result.Offer; } @@ -4255,19 +5071,22 @@ public bool HasOffer { } 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"); - if (result.HasOffer && + 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 { @@ -4277,13 +5096,14 @@ public Builder MergeOffer(global::bnet.protocol.exchange.Offer value) { return this; } public Builder ClearOffer() { + PrepareBuilder(); result.hasOffer = false; - result.offer_ = global::bnet.protocol.exchange.Offer.DefaultInstance; + result.offer_ = null; return this; } public bool HasExtension { - get { return result.HasExtension; } + get { return result.hasExtension; } } public global::bnet.protocol.exchange.Extension Extension { get { return result.Extension; } @@ -4291,19 +5111,22 @@ public bool HasExtension { } 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"); - if (result.HasExtension && + 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 { @@ -4313,24 +5136,27 @@ public Builder MergeExtension(global::bnet.protocol.exchange.Extension value) { return this; } public Builder ClearExtension() { + PrepareBuilder(); result.hasExtension = false; - result.extension_ = global::bnet.protocol.exchange.Extension.DefaultInstance; + result.extension_ = null; return this; } public bool HasCurrentWinningPrice { - get { return result.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; @@ -4341,14 +5167,20 @@ static OfferExtended() { } } + [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 static readonly OfferCreation defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override OfferCreation ThisMessage { @@ -4365,17 +5197,17 @@ protected override OfferCreation ThisMessage { public const int OfferFieldNumber = 1; private bool hasOffer; - private global::bnet.protocol.exchange.Offer offer_ = global::bnet.protocol.exchange.Offer.DefaultInstance; + private global::bnet.protocol.exchange.Offer offer_; public bool HasOffer { get { return hasOffer; } } public global::bnet.protocol.exchange.Offer Offer { - get { return offer_; } + get { return offer_ ?? global::bnet.protocol.exchange.Offer.DefaultInstance; } } public const int AuctionDurationFieldNumber = 2; private bool hasAuctionDuration; - private ulong auctionDuration_ = 0UL; + private ulong auctionDuration_; public bool HasAuctionDuration { get { return hasAuctionDuration; } } @@ -4385,7 +5217,7 @@ public ulong AuctionDuration { public const int AuctionStartDelayFieldNumber = 3; private bool hasAuctionStartDelay; - private ulong auctionStartDelay_ = 0UL; + private ulong auctionStartDelay_; public bool HasAuctionStartDelay { get { return hasAuctionStartDelay; } } @@ -4395,12 +5227,12 @@ public ulong AuctionStartDelay { public const int BillingAddressFieldNumber = 4; private bool hasBillingAddress; - private global::bnet.protocol.exchange.BillingAddress billingAddress_ = global::bnet.protocol.exchange.BillingAddress.DefaultInstance; + private global::bnet.protocol.exchange.BillingAddress billingAddress_; public bool HasBillingAddress { get { return hasBillingAddress; } } public global::bnet.protocol.exchange.BillingAddress BillingAddress { - get { return billingAddress_; } + get { return billingAddress_ ?? global::bnet.protocol.exchange.BillingAddress.DefaultInstance; } } public override bool IsInitialized { @@ -4414,19 +5246,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOffer) { - output.WriteMessage(1, Offer); + string[] field_names = _offerCreationFieldNames; + if (hasOffer) { + output.WriteMessage(1, field_names[3], Offer); } - if (HasAuctionDuration) { - output.WriteUInt64(2, AuctionDuration); + if (hasAuctionDuration) { + output.WriteUInt64(2, field_names[0], AuctionDuration); } - if (HasAuctionStartDelay) { - output.WriteUInt64(3, AuctionStartDelay); + if (hasAuctionStartDelay) { + output.WriteUInt64(3, field_names[1], AuctionStartDelay); } - if (HasBillingAddress) { - output.WriteMessage(4, BillingAddress); + if (hasBillingAddress) { + output.WriteMessage(4, field_names[2], BillingAddress); } UnknownFields.WriteTo(output); } @@ -4438,16 +5271,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOffer) { + if (hasOffer) { size += pb::CodedOutputStream.ComputeMessageSize(1, Offer); } - if (HasAuctionDuration) { + if (hasAuctionDuration) { size += pb::CodedOutputStream.ComputeUInt64Size(2, AuctionDuration); } - if (HasAuctionStartDelay) { + if (hasAuctionStartDelay) { size += pb::CodedOutputStream.ComputeUInt64Size(3, AuctionStartDelay); } - if (HasBillingAddress) { + if (hasBillingAddress) { size += pb::CodedOutputStream.ComputeMessageSize(4, BillingAddress); } size += UnknownFields.SerializedSize; @@ -4480,38 +5313,72 @@ public static OfferCreation ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static OfferCreation ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OfferCreation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - OfferCreation result = new OfferCreation(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override OfferCreation MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new OfferCreation(); + 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 { @@ -4523,12 +5390,11 @@ public override OfferCreation DefaultInstanceForType { } public override OfferCreation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - OfferCreation returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4542,6 +5408,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(OfferCreation other) { if (other == global::bnet.protocol.exchange.OfferCreation.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOffer) { MergeOffer(other.Offer); } @@ -4558,20 +5425,31 @@ public override Builder MergeFrom(OfferCreation 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4583,12 +5461,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.exchange.Offer.Builder subBuilder = global::bnet.protocol.exchange.Offer.CreateBuilder(); - if (HasOffer) { + if (result.hasOffer) { subBuilder.MergeFrom(Offer); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4596,16 +5474,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - AuctionDuration = input.ReadUInt64(); + result.hasAuctionDuration = input.ReadUInt64(ref result.auctionDuration_); break; } case 24: { - AuctionStartDelay = input.ReadUInt64(); + result.hasAuctionStartDelay = input.ReadUInt64(ref result.auctionStartDelay_); break; } case 34: { global::bnet.protocol.exchange.BillingAddress.Builder subBuilder = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(); - if (HasBillingAddress) { + if (result.hasBillingAddress) { subBuilder.MergeFrom(BillingAddress); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4614,11 +5492,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasOffer { - get { return result.HasOffer; } + get { return result.hasOffer; } } public global::bnet.protocol.exchange.Offer Offer { get { return result.Offer; } @@ -4626,19 +5509,22 @@ public bool HasOffer { } 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"); - if (result.HasOffer && + 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 { @@ -4648,49 +5534,54 @@ public Builder MergeOffer(global::bnet.protocol.exchange.Offer value) { return this; } public Builder ClearOffer() { + PrepareBuilder(); result.hasOffer = false; - result.offer_ = global::bnet.protocol.exchange.Offer.DefaultInstance; + result.offer_ = null; return this; } public bool HasAuctionDuration { - get { return result.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; } + 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; } + get { return result.hasBillingAddress; } } public global::bnet.protocol.exchange.BillingAddress BillingAddress { get { return result.BillingAddress; } @@ -4698,19 +5589,22 @@ public bool HasBillingAddress { } 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"); - if (result.HasBillingAddress && + 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 { @@ -4720,8 +5614,9 @@ public Builder MergeBillingAddress(global::bnet.protocol.exchange.BillingAddress return this; } public Builder ClearBillingAddress() { + PrepareBuilder(); result.hasBillingAddress = false; - result.billingAddress_ = global::bnet.protocol.exchange.BillingAddress.DefaultInstance; + result.billingAddress_ = null; return this; } } @@ -4730,14 +5625,20 @@ static OfferCreation() { } } + [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 static readonly Bid defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override Bid ThisMessage { @@ -4754,17 +5655,17 @@ protected override Bid ThisMessage { public const int OrderFieldNumber = 1; private bool hasOrder; - private global::bnet.protocol.exchange.Order order_ = global::bnet.protocol.exchange.Order.DefaultInstance; + private global::bnet.protocol.exchange.Order order_; public bool HasOrder { get { return hasOrder; } } public global::bnet.protocol.exchange.Order Order { - get { return order_; } + get { return order_ ?? global::bnet.protocol.exchange.Order.DefaultInstance; } } public const int CurrentUnitPriceFieldNumber = 2; private bool hasCurrentUnitPrice; - private ulong currentUnitPrice_ = 0UL; + private ulong currentUnitPrice_; public bool HasCurrentUnitPrice { get { return hasCurrentUnitPrice; } } @@ -4774,7 +5675,7 @@ public ulong CurrentUnitPrice { public const int MaxUnitPriceFieldNumber = 3; private bool hasMaxUnitPrice; - private ulong maxUnitPrice_ = 0UL; + private ulong maxUnitPrice_; public bool HasMaxUnitPrice { get { return hasMaxUnitPrice; } } @@ -4790,16 +5691,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOrder) { - output.WriteMessage(1, Order); + string[] field_names = _bidFieldNames; + if (hasOrder) { + output.WriteMessage(1, field_names[2], Order); } - if (HasCurrentUnitPrice) { - output.WriteUInt64(2, CurrentUnitPrice); + if (hasCurrentUnitPrice) { + output.WriteUInt64(2, field_names[0], CurrentUnitPrice); } - if (HasMaxUnitPrice) { - output.WriteUInt64(3, MaxUnitPrice); + if (hasMaxUnitPrice) { + output.WriteUInt64(3, field_names[1], MaxUnitPrice); } UnknownFields.WriteTo(output); } @@ -4811,13 +5713,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOrder) { + if (hasOrder) { size += pb::CodedOutputStream.ComputeMessageSize(1, Order); } - if (HasCurrentUnitPrice) { + if (hasCurrentUnitPrice) { size += pb::CodedOutputStream.ComputeUInt64Size(2, CurrentUnitPrice); } - if (HasMaxUnitPrice) { + if (hasMaxUnitPrice) { size += pb::CodedOutputStream.ComputeUInt64Size(3, MaxUnitPrice); } size += UnknownFields.SerializedSize; @@ -4850,38 +5752,72 @@ public static Bid ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Bid ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Bid ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - Bid result = new Bid(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Bid MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Bid(); + 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 { @@ -4893,12 +5829,11 @@ public override Bid DefaultInstanceForType { } public override Bid BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Bid returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4912,6 +5847,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Bid other) { if (other == global::bnet.protocol.exchange.Bid.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOrder) { MergeOrder(other.Order); } @@ -4925,20 +5861,31 @@ public override Builder MergeFrom(Bid 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4950,12 +5897,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.exchange.Order.Builder subBuilder = global::bnet.protocol.exchange.Order.CreateBuilder(); - if (HasOrder) { + if (result.hasOrder) { subBuilder.MergeFrom(Order); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4963,20 +5910,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - CurrentUnitPrice = input.ReadUInt64(); + result.hasCurrentUnitPrice = input.ReadUInt64(ref result.currentUnitPrice_); break; } case 24: { - MaxUnitPrice = input.ReadUInt64(); + result.hasMaxUnitPrice = input.ReadUInt64(ref result.maxUnitPrice_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasOrder { - get { return result.HasOrder; } + get { return result.hasOrder; } } public global::bnet.protocol.exchange.Order Order { get { return result.Order; } @@ -4984,19 +5936,22 @@ public bool HasOrder { } 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"); - if (result.HasOrder && + 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 { @@ -5006,42 +5961,47 @@ public Builder MergeOrder(global::bnet.protocol.exchange.Order value) { return this; } public Builder ClearOrder() { + PrepareBuilder(); result.hasOrder = false; - result.order_ = global::bnet.protocol.exchange.Order.DefaultInstance; + result.order_ = null; return this; } public bool HasCurrentUnitPrice { - get { return result.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; } + 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; @@ -5052,14 +6012,20 @@ static Bid() { } } + [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 static readonly BidExtended defaultInstance = new Builder().BuildPartial(); + private BidExtended() { } + private static readonly BidExtended defaultInstance = new BidExtended().MakeReadOnly(); + private static readonly string[] _bidExtendedFieldNames = new string[] { "bid", "extension", "offer_current_winning_price", "offer_out_bid_price", "offer_trade_now_price" }; + private static readonly uint[] _bidExtendedFieldTags = new uint[] { 10, 18, 40, 24, 32 }; public static BidExtended DefaultInstance { get { return defaultInstance; } } public override BidExtended DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override BidExtended ThisMessage { @@ -5076,27 +6042,27 @@ protected override BidExtended ThisMessage { public const int BidFieldNumber = 1; private bool hasBid; - private global::bnet.protocol.exchange.Bid bid_ = global::bnet.protocol.exchange.Bid.DefaultInstance; + private global::bnet.protocol.exchange.Bid bid_; public bool HasBid { get { return hasBid; } } public global::bnet.protocol.exchange.Bid Bid { - get { return 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_ = global::bnet.protocol.exchange.Extension.DefaultInstance; + private global::bnet.protocol.exchange.Extension extension_; public bool HasExtension { get { return hasExtension; } } public global::bnet.protocol.exchange.Extension Extension { - get { return extension_; } + get { return extension_ ?? global::bnet.protocol.exchange.Extension.DefaultInstance; } } public const int OfferOutBidPriceFieldNumber = 3; private bool hasOfferOutBidPrice; - private ulong offerOutBidPrice_ = 0UL; + private ulong offerOutBidPrice_; public bool HasOfferOutBidPrice { get { return hasOfferOutBidPrice; } } @@ -5106,7 +6072,7 @@ public ulong OfferOutBidPrice { public const int OfferTradeNowPriceFieldNumber = 4; private bool hasOfferTradeNowPrice; - private ulong offerTradeNowPrice_ = 0UL; + private ulong offerTradeNowPrice_; public bool HasOfferTradeNowPrice { get { return hasOfferTradeNowPrice; } } @@ -5116,7 +6082,7 @@ public ulong OfferTradeNowPrice { public const int OfferCurrentWinningPriceFieldNumber = 5; private bool hasOfferCurrentWinningPrice; - private ulong offerCurrentWinningPrice_ = 0UL; + private ulong offerCurrentWinningPrice_; public bool HasOfferCurrentWinningPrice { get { return hasOfferCurrentWinningPrice; } } @@ -5134,22 +6100,23 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasBid) { - output.WriteMessage(1, Bid); + string[] field_names = _bidExtendedFieldNames; + if (hasBid) { + output.WriteMessage(1, field_names[0], Bid); } - if (HasExtension) { - output.WriteMessage(2, Extension); + if (hasExtension) { + output.WriteMessage(2, field_names[1], Extension); } - if (HasOfferOutBidPrice) { - output.WriteUInt64(3, OfferOutBidPrice); + if (hasOfferOutBidPrice) { + output.WriteUInt64(3, field_names[3], OfferOutBidPrice); } - if (HasOfferTradeNowPrice) { - output.WriteUInt64(4, OfferTradeNowPrice); + if (hasOfferTradeNowPrice) { + output.WriteUInt64(4, field_names[4], OfferTradeNowPrice); } - if (HasOfferCurrentWinningPrice) { - output.WriteUInt64(5, OfferCurrentWinningPrice); + if (hasOfferCurrentWinningPrice) { + output.WriteUInt64(5, field_names[2], OfferCurrentWinningPrice); } UnknownFields.WriteTo(output); } @@ -5161,19 +6128,19 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasBid) { + if (hasBid) { size += pb::CodedOutputStream.ComputeMessageSize(1, Bid); } - if (HasExtension) { + if (hasExtension) { size += pb::CodedOutputStream.ComputeMessageSize(2, Extension); } - if (HasOfferOutBidPrice) { + if (hasOfferOutBidPrice) { size += pb::CodedOutputStream.ComputeUInt64Size(3, OfferOutBidPrice); } - if (HasOfferTradeNowPrice) { + if (hasOfferTradeNowPrice) { size += pb::CodedOutputStream.ComputeUInt64Size(4, OfferTradeNowPrice); } - if (HasOfferCurrentWinningPrice) { + if (hasOfferCurrentWinningPrice) { size += pb::CodedOutputStream.ComputeUInt64Size(5, OfferCurrentWinningPrice); } size += UnknownFields.SerializedSize; @@ -5206,38 +6173,72 @@ public static BidExtended ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static BidExtended ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static BidExtended ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - BidExtended result = new BidExtended(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override BidExtended MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new BidExtended(); + 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 { @@ -5249,12 +6250,11 @@ public override BidExtended DefaultInstanceForType { } public override BidExtended BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - BidExtended returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -5268,6 +6268,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(BidExtended other) { if (other == global::bnet.protocol.exchange.BidExtended.DefaultInstance) return this; + PrepareBuilder(); if (other.HasBid) { MergeBid(other.Bid); } @@ -5287,20 +6288,31 @@ public override Builder MergeFrom(BidExtended 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -5312,12 +6324,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.exchange.Bid.Builder subBuilder = global::bnet.protocol.exchange.Bid.CreateBuilder(); - if (HasBid) { + if (result.hasBid) { subBuilder.MergeFrom(Bid); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5326,7 +6338,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.Extension.Builder subBuilder = global::bnet.protocol.exchange.Extension.CreateBuilder(); - if (HasExtension) { + if (result.hasExtension) { subBuilder.MergeFrom(Extension); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5334,24 +6346,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 24: { - OfferOutBidPrice = input.ReadUInt64(); + result.hasOfferOutBidPrice = input.ReadUInt64(ref result.offerOutBidPrice_); break; } case 32: { - OfferTradeNowPrice = input.ReadUInt64(); + result.hasOfferTradeNowPrice = input.ReadUInt64(ref result.offerTradeNowPrice_); break; } case 40: { - OfferCurrentWinningPrice = input.ReadUInt64(); + result.hasOfferCurrentWinningPrice = input.ReadUInt64(ref result.offerCurrentWinningPrice_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasBid { - get { return result.HasBid; } + get { return result.hasBid; } } public global::bnet.protocol.exchange.Bid Bid { get { return result.Bid; } @@ -5359,19 +6376,22 @@ public bool HasBid { } 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"); - if (result.HasBid && + 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 { @@ -5381,13 +6401,14 @@ public Builder MergeBid(global::bnet.protocol.exchange.Bid value) { return this; } public Builder ClearBid() { + PrepareBuilder(); result.hasBid = false; - result.bid_ = global::bnet.protocol.exchange.Bid.DefaultInstance; + result.bid_ = null; return this; } public bool HasExtension { - get { return result.HasExtension; } + get { return result.hasExtension; } } public global::bnet.protocol.exchange.Extension Extension { get { return result.Extension; } @@ -5395,19 +6416,22 @@ public bool HasExtension { } 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"); - if (result.HasExtension && + 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 { @@ -5417,60 +6441,67 @@ public Builder MergeExtension(global::bnet.protocol.exchange.Extension value) { return this; } public Builder ClearExtension() { + PrepareBuilder(); result.hasExtension = false; - result.extension_ = global::bnet.protocol.exchange.Extension.DefaultInstance; + result.extension_ = null; return this; } public bool HasOfferOutBidPrice { - get { return result.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; } + 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; } + 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; @@ -5481,14 +6512,20 @@ static BidExtended() { } } + [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 static readonly BidCreation defaultInstance = new Builder().BuildPartial(); + 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" }; + private static readonly uint[] _bidCreationFieldTags = new uint[] { 16, 24, 10, 34 }; public static BidCreation DefaultInstance { get { return defaultInstance; } } public override BidCreation DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override BidCreation ThisMessage { @@ -5505,17 +6542,17 @@ protected override BidCreation ThisMessage { public const int BidFieldNumber = 1; private bool hasBid; - private global::bnet.protocol.exchange.Bid bid_ = global::bnet.protocol.exchange.Bid.DefaultInstance; + private global::bnet.protocol.exchange.Bid bid_; public bool HasBid { get { return hasBid; } } public global::bnet.protocol.exchange.Bid Bid { - get { return bid_; } + get { return bid_ ?? global::bnet.protocol.exchange.Bid.DefaultInstance; } } public const int AuctionDurationFieldNumber = 2; private bool hasAuctionDuration; - private ulong auctionDuration_ = 0UL; + private ulong auctionDuration_; public bool HasAuctionDuration { get { return hasAuctionDuration; } } @@ -5525,7 +6562,7 @@ public ulong AuctionDuration { public const int AuctionStartDelayFieldNumber = 3; private bool hasAuctionStartDelay; - private ulong auctionStartDelay_ = 0UL; + private ulong auctionStartDelay_; public bool HasAuctionStartDelay { get { return hasAuctionStartDelay; } } @@ -5535,12 +6572,12 @@ public ulong AuctionStartDelay { public const int BillingAddressFieldNumber = 4; private bool hasBillingAddress; - private global::bnet.protocol.exchange.BillingAddress billingAddress_ = global::bnet.protocol.exchange.BillingAddress.DefaultInstance; + private global::bnet.protocol.exchange.BillingAddress billingAddress_; public bool HasBillingAddress { get { return hasBillingAddress; } } public global::bnet.protocol.exchange.BillingAddress BillingAddress { - get { return billingAddress_; } + get { return billingAddress_ ?? global::bnet.protocol.exchange.BillingAddress.DefaultInstance; } } public override bool IsInitialized { @@ -5554,19 +6591,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasBid) { - output.WriteMessage(1, Bid); + string[] field_names = _bidCreationFieldNames; + if (hasBid) { + output.WriteMessage(1, field_names[2], Bid); } - if (HasAuctionDuration) { - output.WriteUInt64(2, AuctionDuration); + if (hasAuctionDuration) { + output.WriteUInt64(2, field_names[0], AuctionDuration); } - if (HasAuctionStartDelay) { - output.WriteUInt64(3, AuctionStartDelay); + if (hasAuctionStartDelay) { + output.WriteUInt64(3, field_names[1], AuctionStartDelay); } - if (HasBillingAddress) { - output.WriteMessage(4, BillingAddress); + if (hasBillingAddress) { + output.WriteMessage(4, field_names[3], BillingAddress); } UnknownFields.WriteTo(output); } @@ -5578,16 +6616,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasBid) { + if (hasBid) { size += pb::CodedOutputStream.ComputeMessageSize(1, Bid); } - if (HasAuctionDuration) { + if (hasAuctionDuration) { size += pb::CodedOutputStream.ComputeUInt64Size(2, AuctionDuration); } - if (HasAuctionStartDelay) { + if (hasAuctionStartDelay) { size += pb::CodedOutputStream.ComputeUInt64Size(3, AuctionStartDelay); } - if (HasBillingAddress) { + if (hasBillingAddress) { size += pb::CodedOutputStream.ComputeMessageSize(4, BillingAddress); } size += UnknownFields.SerializedSize; @@ -5620,38 +6658,72 @@ public static BidCreation ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static BidCreation ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static BidCreation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - BidCreation result = new BidCreation(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override BidCreation MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new BidCreation(); + 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 { @@ -5663,12 +6735,11 @@ public override BidCreation DefaultInstanceForType { } public override BidCreation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - BidCreation returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -5682,6 +6753,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(BidCreation other) { if (other == global::bnet.protocol.exchange.BidCreation.DefaultInstance) return this; + PrepareBuilder(); if (other.HasBid) { MergeBid(other.Bid); } @@ -5698,20 +6770,31 @@ public override Builder MergeFrom(BidCreation 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -5723,12 +6806,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.exchange.Bid.Builder subBuilder = global::bnet.protocol.exchange.Bid.CreateBuilder(); - if (HasBid) { + if (result.hasBid) { subBuilder.MergeFrom(Bid); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5736,16 +6819,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - AuctionDuration = input.ReadUInt64(); + result.hasAuctionDuration = input.ReadUInt64(ref result.auctionDuration_); break; } case 24: { - AuctionStartDelay = input.ReadUInt64(); + result.hasAuctionStartDelay = input.ReadUInt64(ref result.auctionStartDelay_); break; } case 34: { global::bnet.protocol.exchange.BillingAddress.Builder subBuilder = global::bnet.protocol.exchange.BillingAddress.CreateBuilder(); - if (HasBillingAddress) { + if (result.hasBillingAddress) { subBuilder.MergeFrom(BillingAddress); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5754,11 +6837,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasBid { - get { return result.HasBid; } + get { return result.hasBid; } } public global::bnet.protocol.exchange.Bid Bid { get { return result.Bid; } @@ -5766,19 +6854,22 @@ public bool HasBid { } 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"); - if (result.HasBid && + 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 { @@ -5788,49 +6879,54 @@ public Builder MergeBid(global::bnet.protocol.exchange.Bid value) { return this; } public Builder ClearBid() { + PrepareBuilder(); result.hasBid = false; - result.bid_ = global::bnet.protocol.exchange.Bid.DefaultInstance; + result.bid_ = null; return this; } public bool HasAuctionDuration { - get { return result.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; } + 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; } + get { return result.hasBillingAddress; } } public global::bnet.protocol.exchange.BillingAddress BillingAddress { get { return result.BillingAddress; } @@ -5838,19 +6934,22 @@ public bool HasBillingAddress { } 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"); - if (result.HasBillingAddress && + 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 { @@ -5860,8 +6959,9 @@ public Builder MergeBillingAddress(global::bnet.protocol.exchange.BillingAddress return this; } public Builder ClearBillingAddress() { + PrepareBuilder(); result.hasBillingAddress = false; - result.billingAddress_ = global::bnet.protocol.exchange.BillingAddress.DefaultInstance; + result.billingAddress_ = null; return this; } } @@ -5870,62 +6970,88 @@ static BidCreation() { } } - public sealed partial class QueryFilterByOrderId : pb::GeneratedMessage { - private static readonly QueryFilterByOrderId defaultInstance = new Builder().BuildPartial(); - public static QueryFilterByOrderId DefaultInstance { + [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 QueryFilterByOrderId DefaultInstanceForType { - get { return defaultInstance; } + public override OrderExtended DefaultInstanceForType { + get { return DefaultInstance; } } - protected override QueryFilterByOrderId ThisMessage { + protected override OrderExtended ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_QueryFilterByOrderId__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_QueryFilterByOrderId__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_OrderExtended__FieldAccessorTable; } } - public const int MaxResultFieldNumber = 1; - private bool hasMaxResult; - private uint maxResult_ = 0; - public bool HasMaxResult { - get { return hasMaxResult; } + public const int OrderTypeFieldNumber = 1; + private bool hasOrderType; + private uint orderType_; + public bool HasOrderType { + get { return hasOrderType; } } - public uint MaxResult { - get { return maxResult_; } + public uint OrderType { + get { return orderType_; } } - public const int RefOrderIdFieldNumber = 2; - private bool hasRefOrderId; - private ulong refOrderId_ = 0UL; - public bool HasRefOrderId { - get { return hasRefOrderId; } + public const int BidExtendedFieldNumber = 2; + private bool hasBidExtended; + private global::bnet.protocol.exchange.BidExtended bidExtended_; + public bool HasBidExtended { + get { return hasBidExtended; } } - public ulong RefOrderId { - get { return refOrderId_; } + 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 (!hasMaxResult) return false; + 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::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasMaxResult) { - output.WriteUInt32(1, MaxResult); + string[] field_names = _orderExtendedFieldNames; + if (hasOrderType) { + output.WriteUInt32(1, field_names[2], OrderType); } - if (HasRefOrderId) { - output.WriteUInt64(2, RefOrderId); + if (hasBidExtended) { + output.WriteMessage(2, field_names[0], BidExtended); + } + if (hasOfferExtended) { + output.WriteMessage(3, field_names[1], OfferExtended); } UnknownFields.WriteTo(output); } @@ -5937,11 +7063,14 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasMaxResult) { - size += pb::CodedOutputStream.ComputeUInt32Size(1, MaxResult); + if (hasOrderType) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, OrderType); } - if (HasRefOrderId) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, RefOrderId); + if (hasBidExtended) { + size += pb::CodedOutputStream.ComputeMessageSize(2, BidExtended); + } + if (hasOfferExtended) { + size += pb::CodedOutputStream.ComputeMessageSize(3, OfferExtended); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -5949,116 +7078,164 @@ public override int SerializedSize { } } - public static QueryFilterByOrderId ParseFrom(pb::ByteString data) { + public static OrderExtended ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static QueryFilterByOrderId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static OrderExtended ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static QueryFilterByOrderId ParseFrom(byte[] data) { + public static OrderExtended ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static QueryFilterByOrderId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static OrderExtended ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static QueryFilterByOrderId ParseFrom(global::System.IO.Stream input) { + public static OrderExtended ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryFilterByOrderId ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static OrderExtended 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) { + public static OrderExtended ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static QueryFilterByOrderId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static OrderExtended ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static QueryFilterByOrderId ParseFrom(pb::CodedInputStream input) { + public static OrderExtended ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryFilterByOrderId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(QueryFilterByOrderId prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(OrderExtended 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(OrderExtended cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - QueryFilterByOrderId result = new QueryFilterByOrderId(); + private bool resultIsReadOnly; + private OrderExtended result; - protected override QueryFilterByOrderId MessageBeingBuilt { - get { return 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 = new QueryFilterByOrderId(); + 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.exchange.QueryFilterByOrderId.Descriptor; } + get { return global::bnet.protocol.exchange.OrderExtended.Descriptor; } } - public override QueryFilterByOrderId DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; } + public override OrderExtended DefaultInstanceForType { + get { return global::bnet.protocol.exchange.OrderExtended.DefaultInstance; } } - public override QueryFilterByOrderId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override OrderExtended BuildPartial() { + if (resultIsReadOnly) { + return result; } - QueryFilterByOrderId returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryFilterByOrderId) { - return MergeFrom((QueryFilterByOrderId) other); + if (other is OrderExtended) { + return MergeFrom((OrderExtended) 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; + 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.HasRefOrderId) { - RefOrderId = other.RefOrderId; + if (other.HasBidExtended) { + MergeBidExtended(other.BidExtended); + } + if (other.HasOfferExtended) { + MergeOfferExtended(other.OfferExtended); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -6070,88 +7247,177 @@ 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: { - MaxResult = input.ReadUInt32(); + result.hasOrderType = input.ReadUInt32(ref result.orderType_); break; } - case 16: { - RefOrderId = input.ReadUInt64(); + 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 HasMaxResult { - get { return result.HasMaxResult; } + public bool HasOrderType { + get { return result.hasOrderType; } } - public uint MaxResult { - get { return result.MaxResult; } - set { SetMaxResult(value); } + public uint OrderType { + get { return result.OrderType; } + set { SetOrderType(value); } } - public Builder SetMaxResult(uint value) { - result.hasMaxResult = true; - result.maxResult_ = value; + public Builder SetOrderType(uint value) { + PrepareBuilder(); + result.hasOrderType = true; + result.orderType_ = value; return this; } - public Builder ClearMaxResult() { - result.hasMaxResult = false; - result.maxResult_ = 0; + public Builder ClearOrderType() { + PrepareBuilder(); + result.hasOrderType = false; + result.orderType_ = 0; return this; } - public bool HasRefOrderId { - get { return result.HasRefOrderId; } + public bool HasBidExtended { + get { return result.hasBidExtended; } } - public ulong RefOrderId { - get { return result.RefOrderId; } - set { SetRefOrderId(value); } + public global::bnet.protocol.exchange.BidExtended BidExtended { + get { return result.BidExtended; } + set { SetBidExtended(value); } } - public Builder SetRefOrderId(ulong value) { - result.hasRefOrderId = true; - result.refOrderId_ = 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 ClearRefOrderId() { - result.hasRefOrderId = false; - result.refOrderId_ = 0UL; + 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 QueryFilterByOrderId() { + static OrderExtended() { 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 { + [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 QueryFilterByCreatedTime DefaultInstanceForType { - get { return defaultInstance; } + public override QueryFilterByOrderId DefaultInstanceForType { + get { return DefaultInstance; } } - protected override QueryFilterByCreatedTime ThisMessage { + protected override QueryFilterByOrderId ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__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_QueryFilterByCreatedTime__FieldAccessorTable; } + 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; + private uint maxResult_; public bool HasMaxResult { get { return hasMaxResult; } } @@ -6159,14 +7425,24 @@ 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 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 { @@ -6176,13 +7452,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasMaxResult) { - output.WriteUInt32(1, MaxResult); + string[] field_names = _queryFilterByOrderIdFieldNames; + if (hasMaxResult) { + output.WriteUInt32(1, field_names[0], MaxResult); + } + if (hasRefOrderId) { + output.WriteUInt64(2, field_names[1], RefOrderId); } - if (HasRefCreatedTime) { - output.WriteUInt64(2, RefCreatedTime); + if (hasRefPrice) { + output.WriteUInt64(3, field_names[2], RefPrice); } UnknownFields.WriteTo(output); } @@ -6194,11 +7474,14 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasMaxResult) { + if (hasMaxResult) { size += pb::CodedOutputStream.ComputeUInt32Size(1, MaxResult); } - if (HasRefCreatedTime) { - size += pb::CodedOutputStream.ComputeUInt64Size(2, RefCreatedTime); + if (hasRefOrderId) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, RefOrderId); + } + if (hasRefPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, RefPrice); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -6206,116 +7489,164 @@ public override int SerializedSize { } } - public static QueryFilterByCreatedTime ParseFrom(pb::ByteString data) { + public static QueryFilterByOrderId ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static QueryFilterByCreatedTime ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static QueryFilterByOrderId ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static QueryFilterByCreatedTime ParseFrom(byte[] data) { + public static QueryFilterByOrderId ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static QueryFilterByCreatedTime ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static QueryFilterByOrderId ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static QueryFilterByCreatedTime ParseFrom(global::System.IO.Stream input) { + public static QueryFilterByOrderId ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryFilterByCreatedTime ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static QueryFilterByOrderId 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) { + public static QueryFilterByOrderId ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static QueryFilterByCreatedTime ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static QueryFilterByOrderId ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static QueryFilterByCreatedTime ParseFrom(pb::CodedInputStream input) { + public static QueryFilterByOrderId ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryFilterByCreatedTime ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(QueryFilterByCreatedTime prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(QueryFilterByOrderId 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(QueryFilterByOrderId cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - QueryFilterByCreatedTime result = new QueryFilterByCreatedTime(); + private bool resultIsReadOnly; + private QueryFilterByOrderId result; - protected override QueryFilterByCreatedTime MessageBeingBuilt { - get { return 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 = new QueryFilterByCreatedTime(); + 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.exchange.QueryFilterByCreatedTime.Descriptor; } + get { return global::bnet.protocol.exchange.QueryFilterByOrderId.Descriptor; } } - public override QueryFilterByCreatedTime DefaultInstanceForType { - get { return global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; } + public override QueryFilterByOrderId DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryFilterByOrderId.DefaultInstance; } } - public override QueryFilterByCreatedTime BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override QueryFilterByOrderId BuildPartial() { + if (resultIsReadOnly) { + return result; } - QueryFilterByCreatedTime returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is QueryFilterByCreatedTime) { - return MergeFrom((QueryFilterByCreatedTime) other); + if (other is QueryFilterByOrderId) { + return MergeFrom((QueryFilterByOrderId) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(QueryFilterByCreatedTime other) { - if (other == global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance) 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.HasRefCreatedTime) { - RefCreatedTime = other.RefCreatedTime; + if (other.HasRefOrderId) { + RefOrderId = other.RefOrderId; + } + if (other.HasRefPrice) { + RefPrice = other.RefPrice; } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -6327,148 +7658,159 @@ 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: { - MaxResult = input.ReadUInt32(); + result.hasMaxResult = input.ReadUInt32(ref result.maxResult_); break; } case 16: { - RefCreatedTime = input.ReadUInt64(); + 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; } + 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 bool HasRefOrderId { + get { return result.hasRefOrderId; } } - public ulong RefCreatedTime { - get { return result.RefCreatedTime; } - set { SetRefCreatedTime(value); } + public ulong RefOrderId { + get { return result.RefOrderId; } + set { SetRefOrderId(value); } } - public Builder SetRefCreatedTime(ulong value) { - result.hasRefCreatedTime = true; - result.refCreatedTime_ = value; + public Builder SetRefOrderId(ulong value) { + PrepareBuilder(); + result.hasRefOrderId = true; + result.refOrderId_ = value; return this; } - public Builder ClearRefCreatedTime() { - result.hasRefCreatedTime = false; - result.refCreatedTime_ = 0UL; + 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 QueryFilterByCreatedTime() { + static QueryFilterByOrderId() { 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 { + [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[] { "max_result", "ref_created_time" }; + private static readonly uint[] _queryFilterByCreatedTimeFieldTags = new uint[] { 8, 16 }; + public static QueryFilterByCreatedTime DefaultInstance { get { return defaultInstance; } } - public override Settlement DefaultInstanceForType { - get { return defaultInstance; } + public override QueryFilterByCreatedTime DefaultInstanceForType { + get { return DefaultInstance; } } - protected override Settlement ThisMessage { + protected override QueryFilterByCreatedTime 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_; } + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__Descriptor; } } - public const int MoneyAmountFieldNumber = 2; - private bool hasMoneyAmount; - private ulong moneyAmount_ = 0UL; - public bool HasMoneyAmount { - get { return hasMoneyAmount; } - } - public ulong MoneyAmount { - get { return moneyAmount_; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_QueryFilterByCreatedTime__FieldAccessorTable; } } - public const int ItemsAmountFieldNumber = 3; - private bool hasItemsAmount; - private ulong itemsAmount_ = 0UL; - public bool HasItemsAmount { - get { return hasItemsAmount; } + public const int MaxResultFieldNumber = 1; + private bool hasMaxResult; + private uint maxResult_; + public bool HasMaxResult { + get { return hasMaxResult; } } - public ulong ItemsAmount { - get { return itemsAmount_; } + public uint MaxResult { + get { return maxResult_; } } - public const int OfferSettleIdFieldNumber = 4; - private bool hasOfferSettleId; - private ulong offerSettleId_ = 0UL; - public bool HasOfferSettleId { - get { return hasOfferSettleId; } + public const int RefCreatedTimeFieldNumber = 2; + private bool hasRefCreatedTime; + private ulong refCreatedTime_; + public bool HasRefCreatedTime { + get { return hasRefCreatedTime; } } - public ulong OfferSettleId { - get { return offerSettleId_; } + public ulong RefCreatedTime { + get { return refCreatedTime_; } } public override bool IsInitialized { get { - if (!hasOrderBookId) return false; - if (!hasMoneyAmount) return false; - if (!hasItemsAmount) return false; - if (!hasOfferSettleId) return false; + if (!hasMaxResult) return false; return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasOrderBookId) { - output.WriteUInt64(1, OrderBookId); + string[] field_names = _queryFilterByCreatedTimeFieldNames; + if (hasMaxResult) { + output.WriteUInt32(1, field_names[0], MaxResult); } - if (HasMoneyAmount) { - output.WriteUInt64(2, MoneyAmount); - } - if (HasItemsAmount) { - output.WriteUInt64(3, ItemsAmount); - } - if (HasOfferSettleId) { - output.WriteUInt64(4, OfferSettleId); + if (hasRefCreatedTime) { + output.WriteUInt64(2, field_names[1], RefCreatedTime); } UnknownFields.WriteTo(output); } @@ -6480,17 +7822,11 @@ public override int SerializedSize { 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 (hasMaxResult) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, MaxResult); } - if (HasOfferSettleId) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, OfferSettleId); + if (hasRefCreatedTime) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, RefCreatedTime); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -6498,122 +7834,161 @@ public override int SerializedSize { } } - public static Settlement ParseFrom(pb::ByteString data) { + public static QueryFilterByCreatedTime ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static Settlement ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static QueryFilterByCreatedTime ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static Settlement ParseFrom(byte[] data) { + public static QueryFilterByCreatedTime ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static Settlement ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static QueryFilterByCreatedTime ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static Settlement ParseFrom(global::System.IO.Stream input) { + public static QueryFilterByCreatedTime ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Settlement ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static QueryFilterByCreatedTime 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) { + public static QueryFilterByCreatedTime ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static Settlement ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static QueryFilterByCreatedTime ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static Settlement ParseFrom(pb::CodedInputStream input) { + public static QueryFilterByCreatedTime ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Settlement ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(Settlement prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(QueryFilterByCreatedTime 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(QueryFilterByCreatedTime cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - Settlement result = new Settlement(); + private bool resultIsReadOnly; + private QueryFilterByCreatedTime result; - protected override Settlement MessageBeingBuilt { - get { return 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 = new Settlement(); + 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.exchange.Settlement.Descriptor; } + get { return global::bnet.protocol.exchange.QueryFilterByCreatedTime.Descriptor; } } - public override Settlement DefaultInstanceForType { - get { return global::bnet.protocol.exchange.Settlement.DefaultInstance; } + public override QueryFilterByCreatedTime DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; } } - public override Settlement BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override QueryFilterByCreatedTime BuildPartial() { + if (resultIsReadOnly) { + return result; } - Settlement returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is Settlement) { - return MergeFrom((Settlement) other); + if (other is QueryFilterByCreatedTime) { + return MergeFrom((QueryFilterByCreatedTime) 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; + 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.HasOfferSettleId) { - OfferSettleId = other.OfferSettleId; + if (other.HasRefCreatedTime) { + RefCreatedTime = other.RefCreatedTime; } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -6625,127 +8000,98 @@ 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: { - OrderBookId = input.ReadUInt64(); + result.hasMaxResult = input.ReadUInt32(ref result.maxResult_); break; } case 16: { - MoneyAmount = input.ReadUInt64(); - break; - } - case 24: { - ItemsAmount = input.ReadUInt64(); - break; - } - case 32: { - OfferSettleId = input.ReadUInt64(); + result.hasRefCreatedTime = input.ReadUInt64(ref result.refCreatedTime_); 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; + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } 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 bool HasMaxResult { + get { return result.hasMaxResult; } } - public ulong ItemsAmount { - get { return result.ItemsAmount; } - set { SetItemsAmount(value); } + public uint MaxResult { + get { return result.MaxResult; } + set { SetMaxResult(value); } } - public Builder SetItemsAmount(ulong value) { - result.hasItemsAmount = true; - result.itemsAmount_ = value; + public Builder SetMaxResult(uint value) { + PrepareBuilder(); + result.hasMaxResult = true; + result.maxResult_ = value; return this; } - public Builder ClearItemsAmount() { - result.hasItemsAmount = false; - result.itemsAmount_ = 0UL; + public Builder ClearMaxResult() { + PrepareBuilder(); + result.hasMaxResult = false; + result.maxResult_ = 0; return this; } - public bool HasOfferSettleId { - get { return result.HasOfferSettleId; } + public bool HasRefCreatedTime { + get { return result.hasRefCreatedTime; } } - public ulong OfferSettleId { - get { return result.OfferSettleId; } - set { SetOfferSettleId(value); } + public ulong RefCreatedTime { + get { return result.RefCreatedTime; } + set { SetRefCreatedTime(value); } } - public Builder SetOfferSettleId(ulong value) { - result.hasOfferSettleId = true; - result.offerSettleId_ = value; + public Builder SetRefCreatedTime(ulong value) { + PrepareBuilder(); + result.hasRefCreatedTime = true; + result.refCreatedTime_ = value; return this; } - public Builder ClearOfferSettleId() { - result.hasOfferSettleId = false; - result.offerSettleId_ = 0UL; + public Builder ClearRefCreatedTime() { + PrepareBuilder(); + result.hasRefCreatedTime = false; + result.refCreatedTime_ = 0UL; return this; } } - static Settlement() { + static QueryFilterByCreatedTime() { 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 { + [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_status", "order_type", "specialist", "time_filter" }; + private static readonly uint[] _queryOrderFilterFieldTags = new uint[] { 32, 10, 40, 24, 16, 50 }; + public static QueryOrderFilter DefaultInstance { get { return defaultInstance; } } - public override CurrencyConfig DefaultInstanceForType { - get { return defaultInstance; } + public override QueryOrderFilter DefaultInstanceForType { + get { return DefaultInstance; } } - protected override CurrencyConfig ThisMessage { + protected override QueryOrderFilter ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_CurrencyConfig__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_CurrencyConfig__FieldAccessorTable; } + 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; @@ -6758,129 +8104,85 @@ 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 const int SpecialistFieldNumber = 2; + private bool hasSpecialist; + private uint specialist_; + public bool HasSpecialist { + get { return hasSpecialist; } } - public ulong MinStartingUnitPrice { - get { return minStartingUnitPrice_; } + public uint Specialist { + get { return specialist_; } } - public const int MaxStartingUnitPriceFieldNumber = 6; - private bool hasMaxStartingUnitPrice; - private ulong maxStartingUnitPrice_ = 0UL; - public bool HasMaxStartingUnitPrice { - get { return hasMaxStartingUnitPrice; } + public const int OrderTypeFieldNumber = 3; + private bool hasOrderType; + private uint orderType_; + public bool HasOrderType { + get { return hasOrderType; } } - public ulong MaxStartingUnitPrice { - get { return maxStartingUnitPrice_; } + public uint OrderType { + get { return orderType_; } } - public const int MaxUnitPriceFieldNumber = 7; - private bool hasMaxUnitPrice; - private ulong maxUnitPrice_ = 0UL; - public bool HasMaxUnitPrice { - get { return hasMaxUnitPrice; } + public const int ClaimableFieldNumber = 4; + private bool hasClaimable; + private uint claimable_; + public bool HasClaimable { + get { return hasClaimable; } } - public ulong MaxUnitPrice { - get { return maxUnitPrice_; } + public uint Claimable { + get { return claimable_; } } - public const int MaxTotalAmountFieldNumber = 8; - private bool hasMaxTotalAmount; - private ulong maxTotalAmount_ = 0UL; - public bool HasMaxTotalAmount { - get { return hasMaxTotalAmount; } + public const int OrderStatusFieldNumber = 5; + private bool hasOrderStatus; + private int orderStatus_; + public bool HasOrderStatus { + get { return hasOrderStatus; } } - public ulong MaxTotalAmount { - get { return maxTotalAmount_; } + public int OrderStatus { + get { return orderStatus_; } } - public const int BuyoutRuleFieldNumber = 9; - private bool hasBuyoutRule; - private int buyoutRule_ = 0; - public bool HasBuyoutRule { - get { return hasBuyoutRule; } + public const int TimeFilterFieldNumber = 6; + private bool hasTimeFilter; + private global::bnet.protocol.exchange.QueryFilterByCreatedTime timeFilter_; + public bool HasTimeFilter { + get { return hasTimeFilter; } } - public int BuyoutRule { - get { return buyoutRule_; } + public global::bnet.protocol.exchange.QueryFilterByCreatedTime TimeFilter { + get { return timeFilter_ ?? global::bnet.protocol.exchange.QueryFilterByCreatedTime.DefaultInstance; } } 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; + if (!hasOrderStatus) return false; + if (!hasTimeFilter) return false; + if (!TimeFilter.IsInitialized) return false; return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasCurrency) { - output.WriteString(1, Currency); + string[] field_names = _queryOrderFilterFieldNames; + if (hasCurrency) { + output.WriteString(1, field_names[1], Currency); } - if (HasTickSize) { - output.WriteUInt64(2, TickSize); + if (hasSpecialist) { + output.WriteUInt32(2, field_names[4], Specialist); } - if (HasFlatOutbidIncr) { - output.WriteUInt64(3, FlatOutbidIncr); + if (hasOrderType) { + output.WriteUInt32(3, field_names[3], OrderType); } - if (HasScaleOutbidIncr) { - output.WriteUInt64(4, ScaleOutbidIncr); + if (hasClaimable) { + output.WriteUInt32(4, field_names[0], Claimable); } - if (HasMinStartingUnitPrice) { - output.WriteUInt64(5, MinStartingUnitPrice); + if (hasOrderStatus) { + output.WriteInt32(5, field_names[2], OrderStatus); } - if (HasMaxStartingUnitPrice) { - output.WriteUInt64(6, MaxStartingUnitPrice); - } - if (HasMaxUnitPrice) { - output.WriteUInt64(7, MaxUnitPrice); - } - if (HasMaxTotalAmount) { - output.WriteUInt64(8, MaxTotalAmount); - } - if (HasBuyoutRule) { - output.WriteInt32(9, BuyoutRule); + if (hasTimeFilter) { + output.WriteMessage(6, field_names[5], TimeFilter); } UnknownFields.WriteTo(output); } @@ -6892,32 +8194,23 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasCurrency) { + 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 (hasSpecialist) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Specialist); } - if (HasMinStartingUnitPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(5, MinStartingUnitPrice); + if (hasOrderType) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, OrderType); } - if (HasMaxStartingUnitPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(6, MaxStartingUnitPrice); + if (hasClaimable) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, Claimable); } - if (HasMaxUnitPrice) { - size += pb::CodedOutputStream.ComputeUInt64Size(7, MaxUnitPrice); - } - if (HasMaxTotalAmount) { - size += pb::CodedOutputStream.ComputeUInt64Size(8, MaxTotalAmount); + if (hasOrderStatus) { + size += pb::CodedOutputStream.ComputeInt32Size(5, OrderStatus); } - if (HasBuyoutRule) { - size += pb::CodedOutputStream.ComputeInt32Size(9, BuyoutRule); + if (hasTimeFilter) { + size += pb::CodedOutputStream.ComputeMessageSize(6, TimeFilter); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -6925,137 +8218,173 @@ public override int SerializedSize { } } - public static CurrencyConfig ParseFrom(pb::ByteString data) { + public static QueryOrderFilter ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static CurrencyConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static QueryOrderFilter ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static CurrencyConfig ParseFrom(byte[] data) { + public static QueryOrderFilter ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static CurrencyConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static QueryOrderFilter ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static CurrencyConfig ParseFrom(global::System.IO.Stream input) { + public static QueryOrderFilter ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CurrencyConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static QueryOrderFilter 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) { + public static QueryOrderFilter ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static CurrencyConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static QueryOrderFilter ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static CurrencyConfig ParseFrom(pb::CodedInputStream input) { + public static QueryOrderFilter ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CurrencyConfig ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(CurrencyConfig prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(QueryOrderFilter 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(QueryOrderFilter cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - CurrencyConfig result = new CurrencyConfig(); + private bool resultIsReadOnly; + private QueryOrderFilter result; - protected override CurrencyConfig MessageBeingBuilt { - get { return 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 = new CurrencyConfig(); + 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.exchange.CurrencyConfig.Descriptor; } + get { return global::bnet.protocol.exchange.QueryOrderFilter.Descriptor; } } - public override CurrencyConfig DefaultInstanceForType { - get { return global::bnet.protocol.exchange.CurrencyConfig.DefaultInstance; } + public override QueryOrderFilter DefaultInstanceForType { + get { return global::bnet.protocol.exchange.QueryOrderFilter.DefaultInstance; } } - public override CurrencyConfig BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override QueryOrderFilter BuildPartial() { + if (resultIsReadOnly) { + return result; } - CurrencyConfig returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is CurrencyConfig) { - return MergeFrom((CurrencyConfig) other); + if (other is QueryOrderFilter) { + return MergeFrom((QueryOrderFilter) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(CurrencyConfig other) { - if (other == global::bnet.protocol.exchange.CurrencyConfig.DefaultInstance) 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.HasTickSize) { - TickSize = other.TickSize; - } - if (other.HasFlatOutbidIncr) { - FlatOutbidIncr = other.FlatOutbidIncr; - } - if (other.HasScaleOutbidIncr) { - ScaleOutbidIncr = other.ScaleOutbidIncr; - } - if (other.HasMinStartingUnitPrice) { - MinStartingUnitPrice = other.MinStartingUnitPrice; + if (other.HasSpecialist) { + Specialist = other.Specialist; } - if (other.HasMaxStartingUnitPrice) { - MaxStartingUnitPrice = other.MaxStartingUnitPrice; + if (other.HasOrderType) { + OrderType = other.OrderType; } - if (other.HasMaxUnitPrice) { - MaxUnitPrice = other.MaxUnitPrice; + if (other.HasClaimable) { + Claimable = other.Claimable; } - if (other.HasMaxTotalAmount) { - MaxTotalAmount = other.MaxTotalAmount; + if (other.HasOrderStatus) { + OrderStatus = other.OrderStatus; } - if (other.HasBuyoutRule) { - BuyoutRule = other.BuyoutRule; + if (other.HasTimeFilter) { + MergeTimeFilter(other.TimeFilter); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -7067,52 +8396,50 @@ 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: { - Currency = input.ReadString(); + result.hasCurrency = input.ReadString(ref result.currency_); break; } case 16: { - TickSize = input.ReadUInt64(); + result.hasSpecialist = input.ReadUInt32(ref result.specialist_); break; } case 24: { - FlatOutbidIncr = input.ReadUInt64(); + result.hasOrderType = input.ReadUInt32(ref result.orderType_); break; } case 32: { - ScaleOutbidIncr = input.ReadUInt64(); + result.hasClaimable = input.ReadUInt32(ref result.claimable_); break; } case 40: { - MinStartingUnitPrice = input.ReadUInt64(); - break; - } - case 48: { - MaxStartingUnitPrice = input.ReadUInt64(); - break; - } - case 56: { - MaxUnitPrice = input.ReadUInt64(); - break; - } - case 64: { - MaxTotalAmount = input.ReadUInt64(); + result.hasOrderStatus = input.ReadInt32(ref result.orderStatus_); break; } - case 72: { - BuyoutRule = input.ReadInt32(); + case 50: { + 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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasCurrency { - get { return result.HasCurrency; } + get { return result.hasCurrency; } } public string Currency { get { return result.Currency; } @@ -7120,274 +8447,235 @@ public string Currency { } 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) { - 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 bool HasSpecialist { + get { return result.hasSpecialist; } } - public ulong ScaleOutbidIncr { - get { return result.ScaleOutbidIncr; } - set { SetScaleOutbidIncr(value); } + public uint Specialist { + get { return result.Specialist; } + set { SetSpecialist(value); } } - public Builder SetScaleOutbidIncr(ulong value) { - result.hasScaleOutbidIncr = true; - result.scaleOutbidIncr_ = value; + public Builder SetSpecialist(uint value) { + PrepareBuilder(); + result.hasSpecialist = true; + result.specialist_ = value; return this; } - public Builder ClearScaleOutbidIncr() { - result.hasScaleOutbidIncr = false; - result.scaleOutbidIncr_ = 0UL; + public Builder ClearSpecialist() { + PrepareBuilder(); + result.hasSpecialist = false; + result.specialist_ = 0; return this; } - public bool HasMinStartingUnitPrice { - get { return result.HasMinStartingUnitPrice; } + public bool HasOrderType { + get { return result.hasOrderType; } } - public ulong MinStartingUnitPrice { - get { return result.MinStartingUnitPrice; } - set { SetMinStartingUnitPrice(value); } + public uint OrderType { + get { return result.OrderType; } + set { SetOrderType(value); } } - public Builder SetMinStartingUnitPrice(ulong value) { - result.hasMinStartingUnitPrice = true; - result.minStartingUnitPrice_ = value; + public Builder SetOrderType(uint value) { + PrepareBuilder(); + result.hasOrderType = true; + result.orderType_ = value; return this; } - public Builder ClearMinStartingUnitPrice() { - result.hasMinStartingUnitPrice = false; - result.minStartingUnitPrice_ = 0UL; + public Builder ClearOrderType() { + PrepareBuilder(); + result.hasOrderType = false; + result.orderType_ = 0; return this; } - public bool HasMaxStartingUnitPrice { - get { return result.HasMaxStartingUnitPrice; } + public bool HasClaimable { + get { return result.hasClaimable; } } - public ulong MaxStartingUnitPrice { - get { return result.MaxStartingUnitPrice; } - set { SetMaxStartingUnitPrice(value); } + public uint Claimable { + get { return result.Claimable; } + set { SetClaimable(value); } } - public Builder SetMaxStartingUnitPrice(ulong value) { - result.hasMaxStartingUnitPrice = true; - result.maxStartingUnitPrice_ = value; + public Builder SetClaimable(uint value) { + PrepareBuilder(); + result.hasClaimable = true; + result.claimable_ = value; return this; } - public Builder ClearMaxStartingUnitPrice() { - result.hasMaxStartingUnitPrice = false; - result.maxStartingUnitPrice_ = 0UL; + public Builder ClearClaimable() { + PrepareBuilder(); + result.hasClaimable = false; + result.claimable_ = 0; return this; } - public bool HasMaxUnitPrice { - get { return result.HasMaxUnitPrice; } + public bool HasOrderStatus { + get { return result.hasOrderStatus; } } - public ulong MaxUnitPrice { - get { return result.MaxUnitPrice; } - set { SetMaxUnitPrice(value); } + public int OrderStatus { + get { return result.OrderStatus; } + set { SetOrderStatus(value); } } - public Builder SetMaxUnitPrice(ulong value) { - result.hasMaxUnitPrice = true; - result.maxUnitPrice_ = value; + public Builder SetOrderStatus(int value) { + PrepareBuilder(); + result.hasOrderStatus = true; + result.orderStatus_ = value; return this; } - public Builder ClearMaxUnitPrice() { - result.hasMaxUnitPrice = false; - result.maxUnitPrice_ = 0UL; + public Builder ClearOrderStatus() { + PrepareBuilder(); + result.hasOrderStatus = false; + result.orderStatus_ = 0; return this; } - public bool HasMaxTotalAmount { - get { return result.HasMaxTotalAmount; } + public bool HasTimeFilter { + get { return result.hasTimeFilter; } } - public ulong MaxTotalAmount { - get { return result.MaxTotalAmount; } - set { SetMaxTotalAmount(value); } + public global::bnet.protocol.exchange.QueryFilterByCreatedTime TimeFilter { + get { return result.TimeFilter; } + set { SetTimeFilter(value); } } - public Builder SetMaxTotalAmount(ulong value) { - result.hasMaxTotalAmount = true; - result.maxTotalAmount_ = 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 ClearMaxTotalAmount() { - result.hasMaxTotalAmount = false; - result.maxTotalAmount_ = 0UL; + 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 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; + 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 ClearBuyoutRule() { - result.hasBuyoutRule = false; - result.buyoutRule_ = 0; + public Builder ClearTimeFilter() { + PrepareBuilder(); + result.hasTimeFilter = false; + result.timeFilter_ = null; return this; } } - static CurrencyConfig() { + static QueryOrderFilter() { 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 { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Settlement : pb::GeneratedMessage { + private Settlement() { } + private static readonly Settlement defaultInstance = new Settlement().MakeReadOnly(); + private static readonly string[] _settlementFieldNames = new string[] { "items_amount", "money_amount", "offer_settle_id", "order_book_id" }; + private static readonly uint[] _settlementFieldTags = new uint[] { 24, 16, 32, 8 }; + public static Settlement DefaultInstance { get { return defaultInstance; } } - public override SpecialistConfig DefaultInstanceForType { - get { return defaultInstance; } + public override Settlement DefaultInstanceForType { + get { return DefaultInstance; } } - protected override SpecialistConfig ThisMessage { + protected override Settlement 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; } + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Settlement__Descriptor; } } - public const int SpecialistFieldNumber = 1; - private bool hasSpecialist; - private int specialist_ = 0; - public bool HasSpecialist { - get { return hasSpecialist; } - } - public int Specialist { - get { return specialist_; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_Settlement__FieldAccessorTable; } } - 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 const int OrderBookIdFieldNumber = 1; + private bool hasOrderBookId; + private ulong orderBookId_; + public bool HasOrderBookId { + get { return hasOrderBookId; } } - public ulong GetAuctionDurations(int index) { - return auctionDurations_[index]; + public ulong OrderBookId { + get { return orderBookId_; } } - 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 const int MoneyAmountFieldNumber = 2; + private bool hasMoneyAmount; + private ulong moneyAmount_; + public bool HasMoneyAmount { + get { return hasMoneyAmount; } } - public ulong GetAuctionStartDelays(int index) { - return auctionStartDelays_[index]; + public ulong MoneyAmount { + get { return moneyAmount_; } } - public const int AntiSnipingExtensionDelayFieldNumber = 4; - private bool hasAntiSnipingExtensionDelay; - private ulong antiSnipingExtensionDelay_ = 0UL; - public bool HasAntiSnipingExtensionDelay { - get { return hasAntiSnipingExtensionDelay; } + public const int ItemsAmountFieldNumber = 3; + private bool hasItemsAmount; + private ulong itemsAmount_; + public bool HasItemsAmount { + get { return hasItemsAmount; } } - public ulong AntiSnipingExtensionDelay { - get { return antiSnipingExtensionDelay_; } + public ulong ItemsAmount { + get { return itemsAmount_; } } - 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 const int OfferSettleIdFieldNumber = 4; + private bool hasOfferSettleId; + private ulong offerSettleId_; + public bool HasOfferSettleId { + get { return hasOfferSettleId; } } - public global::bnet.protocol.exchange.CurrencyConfig GetCurrencyConfig(int index) { - return currencyConfig_[index]; + public ulong OfferSettleId { + get { return offerSettleId_; } } 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; - } + 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) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSpecialist) { - output.WriteInt32(1, Specialist); - } - if (auctionDurations_.Count > 0) { - foreach (ulong element in auctionDurations_) { - output.WriteUInt64(2, element); - } + string[] field_names = _settlementFieldNames; + if (hasOrderBookId) { + output.WriteUInt64(1, field_names[3], OrderBookId); } - if (auctionStartDelays_.Count > 0) { - foreach (ulong element in auctionStartDelays_) { - output.WriteUInt64(3, element); - } + if (hasMoneyAmount) { + output.WriteUInt64(2, field_names[1], MoneyAmount); } - if (HasAntiSnipingExtensionDelay) { - output.WriteUInt64(4, AntiSnipingExtensionDelay); + if (hasItemsAmount) { + output.WriteUInt64(3, field_names[0], ItemsAmount); } - foreach (global::bnet.protocol.exchange.CurrencyConfig element in CurrencyConfigList) { - output.WriteMessage(5, element); + if (hasOfferSettleId) { + output.WriteUInt64(4, field_names[2], OfferSettleId); } UnknownFields.WriteTo(output); } @@ -7399,30 +8687,17 @@ public override int SerializedSize { 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; + if (hasOrderBookId) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, OrderBookId); } - { - int dataSize = 0; - foreach (ulong element in AuctionStartDelaysList) { - dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); - } - size += dataSize; - size += 1 * auctionStartDelays_.Count; + if (hasMoneyAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, MoneyAmount); } - if (HasAntiSnipingExtensionDelay) { - size += pb::CodedOutputStream.ComputeUInt64Size(4, AntiSnipingExtensionDelay); + if (hasItemsAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, ItemsAmount); } - foreach (global::bnet.protocol.exchange.CurrencyConfig element in CurrencyConfigList) { - size += pb::CodedOutputStream.ComputeMessageSize(5, element); + if (hasOfferSettleId) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, OfferSettleId); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -7430,128 +8705,167 @@ public override int SerializedSize { } } - public static SpecialistConfig ParseFrom(pb::ByteString data) { + public static Settlement ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static SpecialistConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static Settlement ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static SpecialistConfig ParseFrom(byte[] data) { + public static Settlement ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static SpecialistConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static Settlement ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static SpecialistConfig ParseFrom(global::System.IO.Stream input) { + public static Settlement ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SpecialistConfig ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static Settlement 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) { + public static Settlement ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static SpecialistConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static Settlement ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static SpecialistConfig ParseFrom(pb::CodedInputStream input) { + public static Settlement ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SpecialistConfig ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Settlement ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Settlement MakeReadOnly() { + return this; + } + public 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 static Builder CreateBuilder(Settlement 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(Settlement cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SpecialistConfig result = new SpecialistConfig(); + private bool resultIsReadOnly; + private Settlement result; - protected override SpecialistConfig MessageBeingBuilt { - get { return result; } + private Settlement PrepareBuilder() { + if (resultIsReadOnly) { + Settlement original = result; + result = new Settlement(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Settlement MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SpecialistConfig(); + 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.exchange.SpecialistConfig.Descriptor; } + get { return global::bnet.protocol.exchange.Settlement.Descriptor; } } - public override SpecialistConfig DefaultInstanceForType { - get { return global::bnet.protocol.exchange.SpecialistConfig.DefaultInstance; } + public override Settlement DefaultInstanceForType { + get { return global::bnet.protocol.exchange.Settlement.DefaultInstance; } } - public override SpecialistConfig BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override Settlement BuildPartial() { + if (resultIsReadOnly) { + return result; } - result.auctionDurations_.MakeReadOnly(); - result.auctionStartDelays_.MakeReadOnly(); - result.currencyConfig_.MakeReadOnly(); - SpecialistConfig returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is SpecialistConfig) { - return MergeFrom((SpecialistConfig) other); + if (other is Settlement) { + return MergeFrom((Settlement) 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_); + public override Builder MergeFrom(Settlement other) { + if (other == global::bnet.protocol.exchange.Settlement.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrderBookId) { + OrderBookId = other.OrderBookId; } - if (other.auctionStartDelays_.Count != 0) { - base.AddRange(other.auctionStartDelays_, result.auctionStartDelays_); + if (other.HasMoneyAmount) { + MoneyAmount = other.MoneyAmount; } - if (other.HasAntiSnipingExtensionDelay) { - AntiSnipingExtensionDelay = other.AntiSnipingExtensionDelay; + if (other.HasItemsAmount) { + ItemsAmount = other.ItemsAmount; } - if (other.currencyConfig_.Count != 0) { - base.AddRange(other.currencyConfig_, result.currencyConfig_); + if (other.HasOfferSettleId) { + OfferSettleId = other.OfferSettleId; } 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(_settlementFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _settlementFieldTags[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)) { @@ -7563,250 +8877,226 @@ 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: { - Specialist = input.ReadInt32(); + result.hasOrderBookId = input.ReadUInt64(ref result.orderBookId_); break; } case 16: { - AddAuctionDurations(input.ReadUInt64()); + result.hasMoneyAmount = input.ReadUInt64(ref result.moneyAmount_); break; } case 24: { - AddAuctionStartDelays(input.ReadUInt64()); + result.hasItemsAmount = input.ReadUInt64(ref result.itemsAmount_); 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()); + result.hasOfferSettleId = input.ReadUInt64(ref result.offerSettleId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasSpecialist { - get { return result.HasSpecialist; } + public bool HasOrderBookId { + get { return result.hasOrderBookId; } } - public int Specialist { - get { return result.Specialist; } - set { SetSpecialist(value); } + public ulong OrderBookId { + get { return result.OrderBookId; } + set { SetOrderBookId(value); } } - public Builder SetSpecialist(int value) { - result.hasSpecialist = true; - result.specialist_ = value; + public Builder SetOrderBookId(ulong value) { + PrepareBuilder(); + result.hasOrderBookId = true; + result.orderBookId_ = value; return this; } - public Builder ClearSpecialist() { - result.hasSpecialist = false; - result.specialist_ = 0; + public Builder ClearOrderBookId() { + PrepareBuilder(); + result.hasOrderBookId = false; + result.orderBookId_ = 0UL; 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 bool HasMoneyAmount { + get { return result.hasMoneyAmount; } } - public Builder AddAuctionDurations(ulong value) { - result.auctionDurations_.Add(value); - return this; + public ulong MoneyAmount { + get { return result.MoneyAmount; } + set { SetMoneyAmount(value); } } - public Builder AddRangeAuctionDurations(scg::IEnumerable values) { - base.AddRange(values, result.auctionDurations_); + public Builder SetMoneyAmount(ulong value) { + PrepareBuilder(); + result.hasMoneyAmount = true; + result.moneyAmount_ = value; return this; } - public Builder ClearAuctionDurations() { - result.auctionDurations_.Clear(); + public Builder ClearMoneyAmount() { + PrepareBuilder(); + result.hasMoneyAmount = false; + result.moneyAmount_ = 0UL; return this; } - public pbc::IPopsicleList AuctionStartDelaysList { - get { return result.auctionStartDelays_; } - } - public int AuctionStartDelaysCount { - get { return result.AuctionStartDelaysCount; } + public bool HasItemsAmount { + get { return result.hasItemsAmount; } } - public ulong GetAuctionStartDelays(int index) { - return result.GetAuctionStartDelays(index); + public ulong ItemsAmount { + get { return result.ItemsAmount; } + set { SetItemsAmount(value); } } - public Builder SetAuctionStartDelays(int index, ulong value) { - result.auctionStartDelays_[index] = value; + public Builder SetItemsAmount(ulong value) { + PrepareBuilder(); + result.hasItemsAmount = true; + result.itemsAmount_ = 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; + public Builder ClearItemsAmount() { + PrepareBuilder(); + result.hasItemsAmount = false; + result.itemsAmount_ = 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 bool HasOfferSettleId { + get { return result.hasOfferSettleId; } } - public Builder AddCurrencyConfig(global::bnet.protocol.exchange.CurrencyConfig.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.currencyConfig_.Add(builderForValue.Build()); - return this; + public ulong OfferSettleId { + get { return result.OfferSettleId; } + set { SetOfferSettleId(value); } } - public Builder AddRangeCurrencyConfig(scg::IEnumerable values) { - base.AddRange(values, result.currencyConfig_); + public Builder SetOfferSettleId(ulong value) { + PrepareBuilder(); + result.hasOfferSettleId = true; + result.offerSettleId_ = value; return this; } - public Builder ClearCurrencyConfig() { - result.currencyConfig_.Clear(); + public Builder ClearOfferSettleId() { + PrepareBuilder(); + result.hasOfferSettleId = false; + result.offerSettleId_ = 0UL; return this; } } - static SpecialistConfig() { + static Settlement() { 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 { + [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_unit_price", "tick_size" }; + private static readonly uint[] _currencyConfigFieldTags = new uint[] { 10, 56, 32, 24, 16 }; + public static CurrencyConfig DefaultInstance { get { return defaultInstance; } } - public override BillingAddress DefaultInstanceForType { - get { return defaultInstance; } + public override CurrencyConfig DefaultInstanceForType { + get { return DefaultInstance; } } - protected override BillingAddress ThisMessage { + protected override CurrencyConfig ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_BillingAddress__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_BillingAddress__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_CurrencyConfig__FieldAccessorTable; } } - public const int CountryIdFieldNumber = 1; - private bool hasCountryId; - private int countryId_ = 0; - public bool HasCountryId { - get { return hasCountryId; } + public const int CurrencyFieldNumber = 1; + private bool hasCurrency; + private string currency_ = ""; + public bool HasCurrency { + get { return hasCurrency; } } - public int CountryId { - get { return countryId_; } + public string Currency { + get { return currency_; } } - public const int CityFieldNumber = 2; - private bool hasCity; - private string city_ = ""; - public bool HasCity { - get { return hasCity; } + public const int TickSizeFieldNumber = 2; + private bool hasTickSize; + private ulong tickSize_; + public bool HasTickSize { + get { return hasTickSize; } } - public string City { - get { return city_; } + public ulong TickSize { + get { return tickSize_; } } - public const int StateFieldNumber = 3; - private bool hasState; - private string state_ = ""; - public bool HasState { - get { return hasState; } + public const int MinUnitPriceFieldNumber = 3; + private bool hasMinUnitPrice; + private ulong minUnitPrice_; + public bool HasMinUnitPrice { + get { return hasMinUnitPrice; } } - public string State { - get { return state_; } + public ulong MinUnitPrice { + get { return minUnitPrice_; } } - public const int PostalCodeFieldNumber = 4; - private bool hasPostalCode; - private string postalCode_ = ""; - public bool HasPostalCode { - get { return hasPostalCode; } + public const int MaxUnitPriceFieldNumber = 4; + private bool hasMaxUnitPrice; + private ulong maxUnitPrice_; + public bool HasMaxUnitPrice { + get { return hasMaxUnitPrice; } } - public string PostalCode { - get { return postalCode_; } + public ulong MaxUnitPrice { + get { return maxUnitPrice_; } + } + + public const int MaxTotalPriceFieldNumber = 7; + private bool hasMaxTotalPrice; + private ulong maxTotalPrice_; + public bool HasMaxTotalPrice { + get { return hasMaxTotalPrice; } + } + public ulong MaxTotalPrice { + get { return maxTotalPrice_; } } public override bool IsInitialized { get { - if (!hasCountryId) return false; - if (!hasCity) return false; + if (!hasCurrency) return false; + if (!hasTickSize) return false; + if (!hasMinUnitPrice) return false; + if (!hasMaxUnitPrice) return false; + if (!hasMaxTotalPrice) return false; return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasCountryId) { - output.WriteInt32(1, CountryId); + string[] field_names = _currencyConfigFieldNames; + if (hasCurrency) { + output.WriteString(1, field_names[0], Currency); } - if (HasCity) { - output.WriteString(2, City); + if (hasTickSize) { + output.WriteUInt64(2, field_names[4], TickSize); } - if (HasState) { - output.WriteString(3, State); + if (hasMinUnitPrice) { + output.WriteUInt64(3, field_names[3], MinUnitPrice); } - if (HasPostalCode) { - output.WriteString(4, PostalCode); + if (hasMaxUnitPrice) { + output.WriteUInt64(4, field_names[2], MaxUnitPrice); + } + if (hasMaxTotalPrice) { + output.WriteUInt64(7, field_names[1], MaxTotalPrice); } UnknownFields.WriteTo(output); } @@ -7818,17 +9108,20 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasCountryId) { - size += pb::CodedOutputStream.ComputeInt32Size(1, CountryId); + if (hasCurrency) { + size += pb::CodedOutputStream.ComputeStringSize(1, Currency); } - if (HasCity) { - size += pb::CodedOutputStream.ComputeStringSize(2, City); + if (hasTickSize) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, TickSize); } - if (HasState) { - size += pb::CodedOutputStream.ComputeStringSize(3, State); + if (hasMinUnitPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(3, MinUnitPrice); } - if (HasPostalCode) { - size += pb::CodedOutputStream.ComputeStringSize(4, PostalCode); + if (hasMaxUnitPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(4, MaxUnitPrice); + } + if (hasMaxTotalPrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(7, MaxTotalPrice); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -7836,122 +9129,170 @@ public override int SerializedSize { } } - public static BillingAddress ParseFrom(pb::ByteString data) { + public static CurrencyConfig ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static BillingAddress ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static CurrencyConfig ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static BillingAddress ParseFrom(byte[] data) { + public static CurrencyConfig ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static BillingAddress ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static CurrencyConfig ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static BillingAddress ParseFrom(global::System.IO.Stream input) { + public static CurrencyConfig ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static BillingAddress ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static CurrencyConfig 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) { + public static CurrencyConfig ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static BillingAddress ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static CurrencyConfig ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static BillingAddress ParseFrom(pb::CodedInputStream input) { + public static CurrencyConfig ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static BillingAddress ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(BillingAddress prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(CurrencyConfig 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(CurrencyConfig cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - BillingAddress result = new BillingAddress(); + private bool resultIsReadOnly; + private CurrencyConfig result; - protected override BillingAddress MessageBeingBuilt { - get { return 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 = new BillingAddress(); + 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.exchange.BillingAddress.Descriptor; } + get { return global::bnet.protocol.exchange.CurrencyConfig.Descriptor; } } - public override BillingAddress DefaultInstanceForType { - get { return global::bnet.protocol.exchange.BillingAddress.DefaultInstance; } + public override CurrencyConfig DefaultInstanceForType { + get { return global::bnet.protocol.exchange.CurrencyConfig.DefaultInstance; } } - public override BillingAddress BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override CurrencyConfig BuildPartial() { + if (resultIsReadOnly) { + return result; } - BillingAddress returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is BillingAddress) { - return MergeFrom((BillingAddress) other); + if (other is CurrencyConfig) { + return MergeFrom((CurrencyConfig) 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; + 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.HasCity) { - City = other.City; + if (other.HasTickSize) { + TickSize = other.TickSize; } - if (other.HasState) { - State = other.State; + if (other.HasMinUnitPrice) { + MinUnitPrice = other.MinUnitPrice; } - if (other.HasPostalCode) { - PostalCode = other.PostalCode; + if (other.HasMaxUnitPrice) { + MaxUnitPrice = other.MaxUnitPrice; + } + if (other.HasMaxTotalPrice) { + MaxTotalPrice = other.MaxTotalPrice; } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -7963,145 +9304,176 @@ 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: { - CountryId = input.ReadInt32(); + case 10: { + result.hasCurrency = input.ReadString(ref result.currency_); break; } - case 18: { - City = input.ReadString(); + case 16: { + result.hasTickSize = input.ReadUInt64(ref result.tickSize_); break; } - case 26: { - State = input.ReadString(); + case 24: { + result.hasMinUnitPrice = input.ReadUInt64(ref result.minUnitPrice_); break; } - case 34: { - PostalCode = input.ReadString(); + case 32: { + result.hasMaxUnitPrice = input.ReadUInt64(ref result.maxUnitPrice_); + break; + } + case 56: { + result.hasMaxTotalPrice = input.ReadUInt64(ref result.maxTotalPrice_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasCountryId { - get { return result.HasCountryId; } + public bool HasCurrency { + get { return result.hasCurrency; } } - public int CountryId { - get { return result.CountryId; } - set { SetCountryId(value); } + public string Currency { + get { return result.Currency; } + set { SetCurrency(value); } } - public Builder SetCountryId(int value) { - result.hasCountryId = true; - result.countryId_ = value; + public Builder SetCurrency(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCurrency = true; + result.currency_ = value; return this; } - public Builder ClearCountryId() { - result.hasCountryId = false; - result.countryId_ = 0; + public Builder ClearCurrency() { + PrepareBuilder(); + result.hasCurrency = false; + result.currency_ = ""; return this; } - public bool HasCity { - get { return result.HasCity; } + public bool HasTickSize { + get { return result.hasTickSize; } } - public string City { - get { return result.City; } - set { SetCity(value); } + public ulong TickSize { + get { return result.TickSize; } + set { SetTickSize(value); } } - public Builder SetCity(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasCity = true; - result.city_ = value; + public Builder SetTickSize(ulong value) { + PrepareBuilder(); + result.hasTickSize = true; + result.tickSize_ = value; return this; } - public Builder ClearCity() { - result.hasCity = false; - result.city_ = ""; + public Builder ClearTickSize() { + PrepareBuilder(); + result.hasTickSize = false; + result.tickSize_ = 0UL; return this; } - public bool HasState { - get { return result.HasState; } + public bool HasMinUnitPrice { + get { return result.hasMinUnitPrice; } } - public string State { - get { return result.State; } - set { SetState(value); } + public ulong MinUnitPrice { + get { return result.MinUnitPrice; } + set { SetMinUnitPrice(value); } } - public Builder SetState(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasState = true; - result.state_ = value; + public Builder SetMinUnitPrice(ulong value) { + PrepareBuilder(); + result.hasMinUnitPrice = true; + result.minUnitPrice_ = value; return this; } - public Builder ClearState() { - result.hasState = false; - result.state_ = ""; + public Builder ClearMinUnitPrice() { + PrepareBuilder(); + result.hasMinUnitPrice = false; + result.minUnitPrice_ = 0UL; return this; } - public bool HasPostalCode { - get { return result.HasPostalCode; } + public bool HasMaxUnitPrice { + get { return result.hasMaxUnitPrice; } } - public string PostalCode { - get { return result.PostalCode; } - set { SetPostalCode(value); } + public ulong MaxUnitPrice { + get { return result.MaxUnitPrice; } + set { SetMaxUnitPrice(value); } } - public Builder SetPostalCode(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPostalCode = true; - result.postalCode_ = value; + public Builder SetMaxUnitPrice(ulong value) { + PrepareBuilder(); + result.hasMaxUnitPrice = true; + result.maxUnitPrice_ = value; return this; } - public Builder ClearPostalCode() { - result.hasPostalCode = false; - result.postalCode_ = ""; + public Builder ClearMaxUnitPrice() { + PrepareBuilder(); + result.hasMaxUnitPrice = false; + result.maxUnitPrice_ = 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 BillingAddress() { + static CurrencyConfig() { 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 { + [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", "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, 40, 80, 56, 8, 48, 64 }; + public static SpecialistConfig DefaultInstance { get { return defaultInstance; } } - public override FeeEstimationData DefaultInstanceForType { - get { return defaultInstance; } + public override SpecialistConfig DefaultInstanceForType { + get { return DefaultInstance; } } - protected override FeeEstimationData ThisMessage { + protected override SpecialistConfig 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; } + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_SpecialistConfig__Descriptor; } } - public const int ProgramFieldNumber = 1; - private bool hasProgram; - private uint program_ = 0; - public bool HasProgram { - get { return hasProgram; } - } - public uint Program { - get { return program_; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange.ExchangeTypes.internal__static_bnet_protocol_exchange_SpecialistConfig__FieldAccessorTable; } } - public const int SpecialistFieldNumber = 2; + public const int SpecialistFieldNumber = 1; private bool hasSpecialist; - private int specialist_ = 0; + private int specialist_; public bool HasSpecialist { get { return hasSpecialist; } } @@ -8109,29 +9481,2811 @@ public int Specialist { get { return specialist_; } } - public const int CurrencyFieldNumber = 3; - private bool hasCurrency; - private string currency_ = ""; - public bool HasCurrency { - get { return hasCurrency; } + 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 string Currency { - get { return currency_; } + public int AuctionDurationsCount { + get { return auctionDurations_.Count; } + } + public ulong GetAuctionDurations(int index) { + return auctionDurations_[index]; } - public const int SourceFieldNumber = 4; - private bool hasSource; - private uint source_ = 0; - public bool HasSource { - get { return hasSource; } + 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 uint Source { - get { return source_; } + 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 override bool IsInitialized { + get { + if (!hasSpecialist) return false; + if (!hasAntiSnipingExtensionDelay) return false; + if (!hasMaxItemsAmount) return false; + if (!hasStartingUnitPriceRule) return false; + if (!hasReservedUnitPriceRule) return false; + if (!hasTradeNowUnitPriceRule) return false; + if (!hasCurrentUnitPriceRule) return false; + if (!hasMaximumUnitPriceRule) 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[8], 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[5], MaxItemsAmount); + } + if (hasStartingUnitPriceRule) { + output.WriteInt32(6, field_names[9], StartingUnitPriceRule); + } + if (hasReservedUnitPriceRule) { + output.WriteInt32(7, field_names[7], ReservedUnitPriceRule); + } + if (hasTradeNowUnitPriceRule) { + output.WriteInt32(8, field_names[10], TradeNowUnitPriceRule); + } + if (hasCurrentUnitPriceRule) { + output.WriteInt32(9, field_names[4], CurrentUnitPriceRule); + } + if (hasMaximumUnitPriceRule) { + output.WriteInt32(10, field_names[6], MaximumUnitPriceRule); + } + if (currencyConfig_.Count > 0) { + output.WriteMessageArray(11, field_names[3], currencyConfig_); + } + 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); + } + 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_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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; + } + } + 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 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.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_; + 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::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.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_amount" }; + private static readonly uint[] _feeDetailFieldTags = new uint[] { 104, 122, 112, 40, 32, 16, 90, 48, 58, 24, 64, 96, 136, 128, 80, 8, 72 }; + 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 ScalingFeeAmountFieldNumber = 9; + private bool hasScalingFeeAmount; + private ulong scalingFeeAmount_; + public bool HasScalingFeeAmount { + get { return hasScalingFeeAmount; } + } + public ulong ScalingFeeAmount { + get { return scalingFeeAmount_; } + } + + 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 (hasScalingFeeAmount) { + output.WriteUInt64(9, field_names[16], ScalingFeeAmount); + } + 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 (hasScalingFeeAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(9, ScalingFeeAmount); + } + 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.HasScalingFeeAmount) { + ScalingFeeAmount = other.ScalingFeeAmount; + } + 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 72: { + result.hasScalingFeeAmount = input.ReadUInt64(ref result.scalingFeeAmount_); + 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 HasScalingFeeAmount { + get { return result.hasScalingFeeAmount; } + } + public ulong ScalingFeeAmount { + get { return result.ScalingFeeAmount; } + set { SetScalingFeeAmount(value); } + } + public Builder SetScalingFeeAmount(ulong value) { + PrepareBuilder(); + result.hasScalingFeeAmount = true; + result.scalingFeeAmount_ = value; + return this; + } + public Builder ClearScalingFeeAmount() { + PrepareBuilder(); + result.hasScalingFeeAmount = false; + result.scalingFeeAmount_ = 0UL; + 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 = 5; + public const int AmountFieldNumber = 2; private bool hasAmount; - private ulong amount_ = 0UL; + private ulong amount_; public bool HasAmount { get { return hasAmount; } } @@ -8139,65 +12293,22 @@ 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 (!hasTradePrice) 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) { + public override void WriteTo(pb::ICodedOutputStream 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); + string[] field_names = _priceDetailFieldNames; + if (hasTradePrice) { + output.WriteUInt64(1, field_names[1], TradePrice); } - if (HasBillingAddress) { - output.WriteMessage(7, BillingAddress); + if (hasAmount) { + output.WriteUInt64(2, field_names[0], Amount); } UnknownFields.WriteTo(output); } @@ -8209,26 +12320,11 @@ public override int SerializedSize { 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 (hasTradePrice) { + size += pb::CodedOutputStream.ComputeUInt64Size(1, TradePrice); } - if (HasBillingAddress) { - size += pb::CodedOutputStream.ComputeMessageSize(7, BillingAddress); + if (hasAmount) { + size += pb::CodedOutputStream.ComputeUInt64Size(2, Amount); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -8236,131 +12332,161 @@ public override int SerializedSize { } } - public static FeeEstimationData ParseFrom(pb::ByteString data) { + public static PriceDetail ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static FeeEstimationData ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static PriceDetail ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static FeeEstimationData ParseFrom(byte[] data) { + public static PriceDetail ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static FeeEstimationData ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static PriceDetail ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static FeeEstimationData ParseFrom(global::System.IO.Stream input) { + public static PriceDetail ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FeeEstimationData ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static PriceDetail 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) { + public static PriceDetail ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static FeeEstimationData ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static PriceDetail ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static FeeEstimationData ParseFrom(pb::CodedInputStream input) { + public static PriceDetail ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FeeEstimationData ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(FeeEstimationData prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(PriceDetail 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(PriceDetail cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - FeeEstimationData result = new FeeEstimationData(); + private bool resultIsReadOnly; + private PriceDetail result; - protected override FeeEstimationData MessageBeingBuilt { - get { return 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 = new FeeEstimationData(); + 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.exchange.FeeEstimationData.Descriptor; } + get { return global::bnet.protocol.exchange.PriceDetail.Descriptor; } } - public override FeeEstimationData DefaultInstanceForType { - get { return global::bnet.protocol.exchange.FeeEstimationData.DefaultInstance; } + public override PriceDetail DefaultInstanceForType { + get { return global::bnet.protocol.exchange.PriceDetail.DefaultInstance; } } - public override FeeEstimationData BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override PriceDetail BuildPartial() { + if (resultIsReadOnly) { + return result; } - FeeEstimationData returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is FeeEstimationData) { - return MergeFrom((FeeEstimationData) other); + if (other is PriceDetail) { + return MergeFrom((PriceDetail) 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; + 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; } - 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) { + 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -8372,216 +12498,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 13: { - Program = input.ReadFixed32(); + case 8: { + result.hasTradePrice = input.ReadUInt64(ref result.tradePrice_); 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(); + result.hasAmount = input.ReadUInt64(ref result.amount_); 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; + + 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"); - 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 bool HasTradePrice { + get { return result.hasTradePrice; } } - public uint Source { - get { return result.Source; } - set { SetSource(value); } + public ulong TradePrice { + get { return result.TradePrice; } + set { SetTradePrice(value); } } - public Builder SetSource(uint value) { - result.hasSource = true; - result.source_ = value; + public Builder SetTradePrice(ulong value) { + PrepareBuilder(); + result.hasTradePrice = true; + result.tradePrice_ = value; return this; } - public Builder ClearSource() { - result.hasSource = false; - result.source_ = 0; + public Builder ClearTradePrice() { + PrepareBuilder(); + result.hasTradePrice = false; + result.tradePrice_ = 0UL; return this; } public bool HasAmount { - get { return result.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 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() { + static PriceDetail() { object.ReferenceEquals(global::bnet.protocol.exchange.ExchangeTypes.Descriptor, null); } } @@ -8589,3 +12567,5 @@ static FeeEstimationData() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/exchange_object_provider/ExchangeObjectProvider.cs b/src/LibMooNet/bnet/protocol/exchange_object_provider/ExchangeObjectProvider.cs similarity index 62% rename from source/D3Proto/bnet/protocol/exchange_object_provider/ExchangeObjectProvider.cs rename to src/LibMooNet/bnet/protocol/exchange_object_provider/ExchangeObjectProvider.cs index c55a1c74..b2e7c885 100644 --- a/source/D3Proto/bnet/protocol/exchange_object_provider/ExchangeObjectProvider.cs +++ b/src/LibMooNet/bnet/protocol/exchange_object_provider/ExchangeObjectProvider.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.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 ExchangeObjectProvider { #region Extension registration @@ -43,23 +48,30 @@ static ExchangeObjectProvider() { "cnRpdGlvbklkEg4KBnJlc3VsdBgDIAIoBBI7CgthdXRoX2hhbmRsZRgEIAEo" + "CzImLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuQmxvYkZyb21PZlR5cGUSFgoO" + "ZGVmZXJfZGVsaXZlcnkYBSABKAgSMAoPYm5ldF9hY2NvdW50X2lkGAYgAigL" + - "MhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCKUAQoTUmVwb3J0U2V0dGxlUmVx" + + "MhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCLXAQoTUmVwb3J0U2V0dGxlUmVx" + "dWVzdBI5CgxwYXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4" + "Y2hhbmdlLlBhcnRpdGlvbklkEjIKBXRva2VuGAIgAigLMiMuYm5ldC5wcm90" + - "b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBIOCgZyZXN1bHQYAyACKAQilAEK" + - "E1JlcG9ydENhbmNlbFJlcXVlc3QSOQoMcGFydGl0aW9uX2lkGAEgAigLMiMu" + - "Ym5ldC5wcm90b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBIyCgV0b2tlbhgC" + - "IAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2UuUGFydGl0aW9uSWQSDgoG" + - "cmVzdWx0GAMgAigEIssBChhHZXRQYXltZW50TWV0aG9kc1JlcXVlc3QSLQoM" + - "Ym5ldF9hY2NvdW50GAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIt" + - "CgxnYW1lX2FjY291bnQYAiABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlk" + - "EiUKBHRvb24YAyABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhAKCGN1" + - "cnJlbmN5GAQgAigJEhgKEGNhc2hfaW5fb3V0X21hc2sYBSACKA0iZwoNUGF5" + - "bWVudE1ldGhvZBIxCgdhY2NvdW50GAEgAigLMiAuYm5ldC5wcm90b2NvbC5l" + - "eGNoYW5nZS5CbG9iRnJvbRITCgtkZXNjcmlwdGlvbhgCIAIoCRIOCgZhbW91" + - "bnQYAyABKAQiYwoZR2V0UGF5bWVudE1ldGhvZHNSZXNwb25zZRJGCgdtZXRo" + - "b2RzGAEgAygLMjUuYm5ldC5wcm90b2NvbC5leGNoYW5nZV9vYmplY3RfcHJv" + - "dmlkZXIuUGF5bWVudE1ldGhvZEIDgAEB"); + "b2NvbC5leGNoYW5nZS5QYXJ0aXRpb25JZBIOCgZyZXN1bHQYAyACKAQSQQoX" + + "bm90aWZpY2F0aW9uX2V4dHJhX2luZm8YBCABKAsyIC5ibmV0LnByb3RvY29s" + + "LmV4Y2hhbmdlLkJsb2JGcm9tItcBChNSZXBvcnRDYW5jZWxSZXF1ZXN0EjkK" + + "DHBhcnRpdGlvbl9pZBgBIAIoCzIjLmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Uu" + + "UGFydGl0aW9uSWQSMgoFdG9rZW4YAiACKAsyIy5ibmV0LnByb3RvY29sLmV4" + + "Y2hhbmdlLlBhcnRpdGlvbklkEg4KBnJlc3VsdBgDIAIoBBJBChdub3RpZmlj" + + "YXRpb25fZXh0cmFfaW5mbxgEIAEoCzIgLmJuZXQucHJvdG9jb2wuZXhjaGFu" + + "Z2UuQmxvYkZyb20ioAIKGEdldFBheW1lbnRNZXRob2RzUmVxdWVzdBItCgxi" + + "bmV0X2FjY291bnQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEi0K" + + "DGdhbWVfYWNjb3VudBgCIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + + "JQoEdG9vbhgDIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSEAoIY3Vy" + + "cmVuY3kYBCACKAkSGAoQY2FzaF9pbl9vdXRfbWFzaxgFIAIoDRIrChxyZWZy" + + "ZXNoX3BheW1lbnRfbWV0aG9kX2NhY2hlGAYgASgIOgVmYWxzZRImChdyZWZy" + + "ZXNoX2VfYmFsYW5jZV9jYWNoZRgHIAEoCDoFZmFsc2UiygEKDVBheW1lbnRN" + + "ZXRob2QSMQoHYWNjb3VudBgBIAIoCzIgLmJuZXQucHJvdG9jb2wuZXhjaGFu" + + "Z2UuQmxvYkZyb20SEwoLZGVzY3JpcHRpb24YAiACKAkSDgoGYW1vdW50GAMg" + + "ASgEEhsKEGNhc2hfaW5fb3V0X21hc2sYBCABKA06ATMSEgoKY291bnRyeV9p" + + "ZBgFIAEoDRINCgVzdGF0ZRgGIAEoCRIMCgRjaXR5GAcgASgJEhMKC3Bvc3Rh" + + "bF9jb2RlGAggASgJImMKGUdldFBheW1lbnRNZXRob2RzUmVzcG9uc2USRgoH" + + "bWV0aG9kcxgBIAMoCzI1LmJuZXQucHJvdG9jb2wuZXhjaGFuZ2Vfb2JqZWN0" + + "X3Byb3ZpZGVyLlBheW1lbnRNZXRob2RCA4ABAA=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_exchange_object_provider_ReportAuthorizeRequest__Descriptor = Descriptor.MessageTypes[0]; @@ -69,19 +81,19 @@ static ExchangeObjectProvider() { 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", }); + new string[] { "PartitionId", "Token", "Result", "NotificationExtraInfo", }); 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", }); + new string[] { "PartitionId", "Token", "Result", "NotificationExtraInfo", }); 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", }); + new string[] { "BnetAccount", "GameAccount", "Toon", "Currency", "CashInOutMask", "RefreshPaymentMethodCache", "RefreshEBalanceCache", }); 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", }); + new string[] { "Account", "Description", "Amount", "CashInOutMask", "CountryId", "State", "City", "PostalCode", }); 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, @@ -98,14 +110,20 @@ static ExchangeObjectProvider() { } #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 static readonly ReportAuthorizeRequest defaultInstance = new Builder().BuildPartial(); + private ReportAuthorizeRequest() { } + private static readonly ReportAuthorizeRequest defaultInstance = new ReportAuthorizeRequest().MakeReadOnly(); + private static readonly string[] _reportAuthorizeRequestFieldNames = new string[] { "auth_handle", "bnet_account_id", "defer_delivery", "partition_id", "result", "token" }; + private static readonly uint[] _reportAuthorizeRequestFieldTags = new uint[] { 34, 50, 40, 10, 24, 18 }; public static ReportAuthorizeRequest DefaultInstance { get { return defaultInstance; } } public override ReportAuthorizeRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ReportAuthorizeRequest ThisMessage { @@ -122,27 +140,27 @@ protected override ReportAuthorizeRequest ThisMessage { public const int PartitionIdFieldNumber = 1; private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId partitionId_; public bool HasPartitionId { get { return hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return 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_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId token_; public bool HasToken { get { return hasToken; } } public global::bnet.protocol.exchange.PartitionId Token { - get { return token_; } + get { return token_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } } public const int ResultFieldNumber = 3; private bool hasResult; - private ulong result_ = 0UL; + private ulong result_; public bool HasResult { get { return hasResult; } } @@ -152,17 +170,17 @@ public ulong Result { public const int AuthHandleFieldNumber = 4; private bool hasAuthHandle; - private global::bnet.protocol.exchange.BlobFromOfType authHandle_ = global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance; + private global::bnet.protocol.exchange.BlobFromOfType authHandle_; public bool HasAuthHandle { get { return hasAuthHandle; } } public global::bnet.protocol.exchange.BlobFromOfType AuthHandle { - get { return authHandle_; } + get { return authHandle_ ?? global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance; } } public const int DeferDeliveryFieldNumber = 5; private bool hasDeferDelivery; - private bool deferDelivery_ = false; + private bool deferDelivery_; public bool HasDeferDelivery { get { return hasDeferDelivery; } } @@ -172,12 +190,12 @@ public bool DeferDelivery { public const int BnetAccountIdFieldNumber = 6; private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId bnetAccountId_; public bool HasBnetAccountId { get { return hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } + get { return bnetAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -196,25 +214,26 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _reportAuthorizeRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[3], PartitionId); } - if (HasToken) { - output.WriteMessage(2, Token); + if (hasToken) { + output.WriteMessage(2, field_names[5], Token); } - if (HasResult) { - output.WriteUInt64(3, Result); + if (hasResult) { + output.WriteUInt64(3, field_names[4], Result); } - if (HasAuthHandle) { - output.WriteMessage(4, AuthHandle); + if (hasAuthHandle) { + output.WriteMessage(4, field_names[0], AuthHandle); } - if (HasDeferDelivery) { - output.WriteBool(5, DeferDelivery); + if (hasDeferDelivery) { + output.WriteBool(5, field_names[2], DeferDelivery); } - if (HasBnetAccountId) { - output.WriteMessage(6, BnetAccountId); + if (hasBnetAccountId) { + output.WriteMessage(6, field_names[1], BnetAccountId); } UnknownFields.WriteTo(output); } @@ -226,22 +245,22 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { + if (hasPartitionId) { size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasToken) { + if (hasToken) { size += pb::CodedOutputStream.ComputeMessageSize(2, Token); } - if (HasResult) { + if (hasResult) { size += pb::CodedOutputStream.ComputeUInt64Size(3, Result); } - if (HasAuthHandle) { + if (hasAuthHandle) { size += pb::CodedOutputStream.ComputeMessageSize(4, AuthHandle); } - if (HasDeferDelivery) { + if (hasDeferDelivery) { size += pb::CodedOutputStream.ComputeBoolSize(5, DeferDelivery); } - if (HasBnetAccountId) { + if (hasBnetAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(6, BnetAccountId); } size += UnknownFields.SerializedSize; @@ -274,38 +293,72 @@ public static ReportAuthorizeRequest ParseDelimitedFrom(global::System.IO.Stream 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) { + public static ReportAuthorizeRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ReportAuthorizeRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - ReportAuthorizeRequest result = new ReportAuthorizeRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ReportAuthorizeRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ReportAuthorizeRequest(); + 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 { @@ -317,12 +370,11 @@ public override ReportAuthorizeRequest DefaultInstanceForType { } public override ReportAuthorizeRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ReportAuthorizeRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -336,6 +388,7 @@ public override Builder MergeFrom(pb::IMessage other) { 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); } @@ -358,20 +411,31 @@ public override Builder MergeFrom(ReportAuthorizeRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -383,12 +447,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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { + if (result.hasPartitionId) { subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -397,7 +461,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasToken) { + if (result.hasToken) { subBuilder.MergeFrom(Token); } input.ReadMessage(subBuilder, extensionRegistry); @@ -405,12 +469,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 24: { - Result = input.ReadUInt64(); + result.hasResult = input.ReadUInt64(ref result.result_); break; } case 34: { global::bnet.protocol.exchange.BlobFromOfType.Builder subBuilder = global::bnet.protocol.exchange.BlobFromOfType.CreateBuilder(); - if (HasAuthHandle) { + if (result.hasAuthHandle) { subBuilder.MergeFrom(AuthHandle); } input.ReadMessage(subBuilder, extensionRegistry); @@ -418,12 +482,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 40: { - DeferDelivery = input.ReadBool(); + result.hasDeferDelivery = input.ReadBool(ref result.deferDelivery_); break; } case 50: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccountId) { + if (result.hasBnetAccountId) { subBuilder.MergeFrom(BnetAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -432,11 +496,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPartitionId { - get { return result.HasPartitionId; } + get { return result.hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { get { return result.PartitionId; } @@ -444,19 +513,22 @@ public bool HasPartitionId { } 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"); - if (result.HasPartitionId && + 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 { @@ -466,13 +538,14 @@ public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value return this; } public Builder ClearPartitionId() { + PrepareBuilder(); result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.partitionId_ = null; return this; } public bool HasToken { - get { return result.HasToken; } + get { return result.hasToken; } } public global::bnet.protocol.exchange.PartitionId Token { get { return result.Token; } @@ -480,19 +553,22 @@ public bool HasToken { } 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"); - if (result.HasToken && + 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 { @@ -502,31 +578,34 @@ public Builder MergeToken(global::bnet.protocol.exchange.PartitionId value) { return this; } public Builder ClearToken() { + PrepareBuilder(); result.hasToken = false; - result.token_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.token_ = null; return this; } public bool HasResult { - get { return result.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; } + get { return result.hasAuthHandle; } } public global::bnet.protocol.exchange.BlobFromOfType AuthHandle { get { return result.AuthHandle; } @@ -534,19 +613,22 @@ public bool HasAuthHandle { } 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"); - if (result.HasAuthHandle && + 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 { @@ -556,31 +638,34 @@ public Builder MergeAuthHandle(global::bnet.protocol.exchange.BlobFromOfType val return this; } public Builder ClearAuthHandle() { + PrepareBuilder(); result.hasAuthHandle = false; - result.authHandle_ = global::bnet.protocol.exchange.BlobFromOfType.DefaultInstance; + result.authHandle_ = null; return this; } public bool HasDeferDelivery { - get { return result.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; } + get { return result.hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { get { return result.BnetAccountId; } @@ -588,19 +673,22 @@ public bool HasBnetAccountId { } 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"); - if (result.HasBnetAccountId && + PrepareBuilder(); + if (result.hasBnetAccountId && result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -610,8 +698,9 @@ public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearBnetAccountId() { + PrepareBuilder(); result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.bnetAccountId_ = null; return this; } } @@ -620,14 +709,20 @@ static ReportAuthorizeRequest() { } } + [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 static readonly ReportSettleRequest defaultInstance = new Builder().BuildPartial(); + private ReportSettleRequest() { } + private static readonly ReportSettleRequest defaultInstance = new ReportSettleRequest().MakeReadOnly(); + private static readonly string[] _reportSettleRequestFieldNames = new string[] { "notification_extra_info", "partition_id", "result", "token" }; + private static readonly uint[] _reportSettleRequestFieldTags = new uint[] { 34, 10, 24, 18 }; public static ReportSettleRequest DefaultInstance { get { return defaultInstance; } } public override ReportSettleRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ReportSettleRequest ThisMessage { @@ -644,27 +739,27 @@ protected override ReportSettleRequest ThisMessage { public const int PartitionIdFieldNumber = 1; private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId partitionId_; public bool HasPartitionId { get { return hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return 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_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId token_; public bool HasToken { get { return hasToken; } } public global::bnet.protocol.exchange.PartitionId Token { - get { return token_; } + get { return token_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } } public const int ResultFieldNumber = 3; private bool hasResult; - private ulong result_ = 0UL; + private ulong result_; public bool HasResult { get { return hasResult; } } @@ -672,6 +767,16 @@ 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 override bool IsInitialized { get { if (!hasPartitionId) return false; @@ -679,20 +784,27 @@ public override bool IsInitialized { if (!hasResult) return false; if (!PartitionId.IsInitialized) return false; if (!Token.IsInitialized) return false; + if (HasNotificationExtraInfo) { + if (!NotificationExtraInfo.IsInitialized) return false; + } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _reportSettleRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); + } + if (hasToken) { + output.WriteMessage(2, field_names[3], Token); } - if (HasToken) { - output.WriteMessage(2, Token); + if (hasResult) { + output.WriteUInt64(3, field_names[2], Result); } - if (HasResult) { - output.WriteUInt64(3, Result); + if (hasNotificationExtraInfo) { + output.WriteMessage(4, field_names[0], NotificationExtraInfo); } UnknownFields.WriteTo(output); } @@ -704,15 +816,18 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { + if (hasPartitionId) { size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasToken) { + if (hasToken) { size += pb::CodedOutputStream.ComputeMessageSize(2, Token); } - if (HasResult) { + if (hasResult) { size += pb::CodedOutputStream.ComputeUInt64Size(3, Result); } + if (hasNotificationExtraInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(4, NotificationExtraInfo); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -743,38 +858,72 @@ public static ReportSettleRequest ParseDelimitedFrom(global::System.IO.Stream in 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) { + public static ReportSettleRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ReportSettleRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - ReportSettleRequest result = new ReportSettleRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ReportSettleRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ReportSettleRequest(); + 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 { @@ -786,12 +935,11 @@ public override ReportSettleRequest DefaultInstanceForType { } public override ReportSettleRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ReportSettleRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -805,6 +953,7 @@ public override Builder MergeFrom(pb::IMessage other) { 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); } @@ -814,24 +963,38 @@ public override Builder MergeFrom(ReportSettleRequest other) { if (other.HasResult) { Result = other.Result; } + if (other.HasNotificationExtraInfo) { + MergeNotificationExtraInfo(other.NotificationExtraInfo); + } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -843,12 +1006,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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { + if (result.hasPartitionId) { subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -857,7 +1020,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasToken) { + if (result.hasToken) { subBuilder.MergeFrom(Token); } input.ReadMessage(subBuilder, extensionRegistry); @@ -865,16 +1028,30 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 24: { - Result = input.ReadUInt64(); + 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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPartitionId { - get { return result.HasPartitionId; } + get { return result.hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { get { return result.PartitionId; } @@ -882,19 +1059,22 @@ public bool HasPartitionId { } 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"); - if (result.HasPartitionId && + 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 { @@ -904,13 +1084,14 @@ public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value return this; } public Builder ClearPartitionId() { + PrepareBuilder(); result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.partitionId_ = null; return this; } public bool HasToken { - get { return result.HasToken; } + get { return result.hasToken; } } public global::bnet.protocol.exchange.PartitionId Token { get { return result.Token; } @@ -918,19 +1099,22 @@ public bool HasToken { } 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"); - if (result.HasToken && + 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 { @@ -940,42 +1124,91 @@ public Builder MergeToken(global::bnet.protocol.exchange.PartitionId value) { return this; } public Builder ClearToken() { + PrepareBuilder(); result.hasToken = false; - result.token_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.token_ = null; return this; } public bool HasResult { - get { return result.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; + } } static ReportSettleRequest() { object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.Descriptor, 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 static readonly ReportCancelRequest defaultInstance = new Builder().BuildPartial(); + private ReportCancelRequest() { } + private static readonly ReportCancelRequest defaultInstance = new ReportCancelRequest().MakeReadOnly(); + private static readonly string[] _reportCancelRequestFieldNames = new string[] { "notification_extra_info", "partition_id", "result", "token" }; + private static readonly uint[] _reportCancelRequestFieldTags = new uint[] { 34, 10, 24, 18 }; public static ReportCancelRequest DefaultInstance { get { return defaultInstance; } } public override ReportCancelRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ReportCancelRequest ThisMessage { @@ -992,27 +1225,27 @@ protected override ReportCancelRequest ThisMessage { public const int PartitionIdFieldNumber = 1; private bool hasPartitionId; - private global::bnet.protocol.exchange.PartitionId partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId partitionId_; public bool HasPartitionId { get { return hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { - get { return 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_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + private global::bnet.protocol.exchange.PartitionId token_; public bool HasToken { get { return hasToken; } } public global::bnet.protocol.exchange.PartitionId Token { - get { return token_; } + get { return token_ ?? global::bnet.protocol.exchange.PartitionId.DefaultInstance; } } public const int ResultFieldNumber = 3; private bool hasResult; - private ulong result_ = 0UL; + private ulong result_; public bool HasResult { get { return hasResult; } } @@ -1020,6 +1253,16 @@ 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 override bool IsInitialized { get { if (!hasPartitionId) return false; @@ -1027,20 +1270,27 @@ public override bool IsInitialized { if (!hasResult) return false; if (!PartitionId.IsInitialized) return false; if (!Token.IsInitialized) return false; + if (HasNotificationExtraInfo) { + if (!NotificationExtraInfo.IsInitialized) return false; + } return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasPartitionId) { - output.WriteMessage(1, PartitionId); + string[] field_names = _reportCancelRequestFieldNames; + if (hasPartitionId) { + output.WriteMessage(1, field_names[1], PartitionId); } - if (HasToken) { - output.WriteMessage(2, Token); + if (hasToken) { + output.WriteMessage(2, field_names[3], Token); } - if (HasResult) { - output.WriteUInt64(3, Result); + if (hasResult) { + output.WriteUInt64(3, field_names[2], Result); + } + if (hasNotificationExtraInfo) { + output.WriteMessage(4, field_names[0], NotificationExtraInfo); } UnknownFields.WriteTo(output); } @@ -1052,15 +1302,18 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasPartitionId) { + if (hasPartitionId) { size += pb::CodedOutputStream.ComputeMessageSize(1, PartitionId); } - if (HasToken) { + if (hasToken) { size += pb::CodedOutputStream.ComputeMessageSize(2, Token); } - if (HasResult) { + if (hasResult) { size += pb::CodedOutputStream.ComputeUInt64Size(3, Result); } + if (hasNotificationExtraInfo) { + size += pb::CodedOutputStream.ComputeMessageSize(4, NotificationExtraInfo); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -1091,38 +1344,72 @@ public static ReportCancelRequest ParseDelimitedFrom(global::System.IO.Stream in 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) { + public static ReportCancelRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ReportCancelRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - ReportCancelRequest result = new ReportCancelRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ReportCancelRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ReportCancelRequest(); + 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 +1421,11 @@ public override ReportCancelRequest DefaultInstanceForType { } public override ReportCancelRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ReportCancelRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1153,6 +1439,7 @@ public override Builder MergeFrom(pb::IMessage other) { 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); } @@ -1162,24 +1449,38 @@ public override Builder MergeFrom(ReportCancelRequest other) { if (other.HasResult) { Result = other.Result; } + if (other.HasNotificationExtraInfo) { + MergeNotificationExtraInfo(other.NotificationExtraInfo); + } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1191,12 +1492,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.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasPartitionId) { + if (result.hasPartitionId) { subBuilder.MergeFrom(PartitionId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1205,7 +1506,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.exchange.PartitionId.Builder subBuilder = global::bnet.protocol.exchange.PartitionId.CreateBuilder(); - if (HasToken) { + if (result.hasToken) { subBuilder.MergeFrom(Token); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1213,16 +1514,30 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 24: { - Result = input.ReadUInt64(); + 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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasPartitionId { - get { return result.HasPartitionId; } + get { return result.hasPartitionId; } } public global::bnet.protocol.exchange.PartitionId PartitionId { get { return result.PartitionId; } @@ -1230,19 +1545,22 @@ public bool HasPartitionId { } 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"); - if (result.HasPartitionId && + 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 { @@ -1252,13 +1570,14 @@ public Builder MergePartitionId(global::bnet.protocol.exchange.PartitionId value return this; } public Builder ClearPartitionId() { + PrepareBuilder(); result.hasPartitionId = false; - result.partitionId_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.partitionId_ = null; return this; } public bool HasToken { - get { return result.HasToken; } + get { return result.hasToken; } } public global::bnet.protocol.exchange.PartitionId Token { get { return result.Token; } @@ -1266,19 +1585,22 @@ public bool HasToken { } 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"); - if (result.HasToken && + 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 { @@ -1288,42 +1610,91 @@ public Builder MergeToken(global::bnet.protocol.exchange.PartitionId value) { return this; } public Builder ClearToken() { + PrepareBuilder(); result.hasToken = false; - result.token_ = global::bnet.protocol.exchange.PartitionId.DefaultInstance; + result.token_ = null; return this; } public bool HasResult { - get { return result.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; + } } static ReportCancelRequest() { object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.Descriptor, 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 static readonly GetPaymentMethodsRequest defaultInstance = new Builder().BuildPartial(); + 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", "toon" }; + private static readonly uint[] _getPaymentMethodsRequestFieldTags = new uint[] { 10, 40, 34, 18, 56, 48, 26 }; public static GetPaymentMethodsRequest DefaultInstance { get { return defaultInstance; } } public override GetPaymentMethodsRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GetPaymentMethodsRequest ThisMessage { @@ -1340,32 +1711,32 @@ protected override GetPaymentMethodsRequest ThisMessage { public const int BnetAccountFieldNumber = 1; private bool hasBnetAccount; - private global::bnet.protocol.EntityId bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId bnetAccount_; public bool HasBnetAccount { get { return hasBnetAccount; } } public global::bnet.protocol.EntityId BnetAccount { - get { return bnetAccount_; } + get { return bnetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int GameAccountFieldNumber = 2; private bool hasGameAccount; - private global::bnet.protocol.EntityId gameAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId gameAccount_; public bool HasGameAccount { get { return hasGameAccount; } } public global::bnet.protocol.EntityId GameAccount { - get { return gameAccount_; } + get { return gameAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ToonFieldNumber = 3; private bool hasToon; - private global::bnet.protocol.EntityId toon_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId toon_; public bool HasToon { get { return hasToon; } } public global::bnet.protocol.EntityId Toon { - get { return toon_; } + get { return toon_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int CurrencyFieldNumber = 4; @@ -1380,7 +1751,7 @@ public string Currency { public const int CashInOutMaskFieldNumber = 5; private bool hasCashInOutMask; - private uint cashInOutMask_ = 0; + private uint cashInOutMask_; public bool HasCashInOutMask { get { return hasCashInOutMask; } } @@ -1388,6 +1759,26 @@ public uint CashInOutMask { get { return cashInOutMask_; } } + public const int RefreshPaymentMethodCacheFieldNumber = 6; + private bool hasRefreshPaymentMethodCache; + private bool refreshPaymentMethodCache_; + public bool HasRefreshPaymentMethodCache { + get { return hasRefreshPaymentMethodCache; } + } + public bool RefreshPaymentMethodCache { + get { return refreshPaymentMethodCache_; } + } + + public const int RefreshEBalanceCacheFieldNumber = 7; + private bool hasRefreshEBalanceCache; + private bool refreshEBalanceCache_; + public bool HasRefreshEBalanceCache { + get { return hasRefreshEBalanceCache; } + } + public bool RefreshEBalanceCache { + get { return refreshEBalanceCache_; } + } + public override bool IsInitialized { get { if (!hasCurrency) return false; @@ -1405,22 +1796,29 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasBnetAccount) { - output.WriteMessage(1, BnetAccount); + string[] field_names = _getPaymentMethodsRequestFieldNames; + if (hasBnetAccount) { + output.WriteMessage(1, field_names[0], BnetAccount); } - if (HasGameAccount) { - output.WriteMessage(2, GameAccount); + if (hasGameAccount) { + output.WriteMessage(2, field_names[3], GameAccount); } - if (HasToon) { - output.WriteMessage(3, Toon); + if (hasToon) { + output.WriteMessage(3, field_names[6], Toon); } - if (HasCurrency) { - output.WriteString(4, Currency); + if (hasCurrency) { + output.WriteString(4, field_names[2], Currency); } - if (HasCashInOutMask) { - output.WriteUInt32(5, CashInOutMask); + if (hasCashInOutMask) { + output.WriteUInt32(5, field_names[1], CashInOutMask); + } + if (hasRefreshPaymentMethodCache) { + output.WriteBool(6, field_names[5], RefreshPaymentMethodCache); + } + if (hasRefreshEBalanceCache) { + output.WriteBool(7, field_names[4], RefreshEBalanceCache); } UnknownFields.WriteTo(output); } @@ -1432,21 +1830,27 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasBnetAccount) { + if (hasBnetAccount) { size += pb::CodedOutputStream.ComputeMessageSize(1, BnetAccount); } - if (HasGameAccount) { + if (hasGameAccount) { size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccount); } - if (HasToon) { + if (hasToon) { size += pb::CodedOutputStream.ComputeMessageSize(3, Toon); } - if (HasCurrency) { + if (hasCurrency) { size += pb::CodedOutputStream.ComputeStringSize(4, Currency); } - if (HasCashInOutMask) { + if (hasCashInOutMask) { size += pb::CodedOutputStream.ComputeUInt32Size(5, CashInOutMask); } + if (hasRefreshPaymentMethodCache) { + size += pb::CodedOutputStream.ComputeBoolSize(6, RefreshPaymentMethodCache); + } + if (hasRefreshEBalanceCache) { + size += pb::CodedOutputStream.ComputeBoolSize(7, RefreshEBalanceCache); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -1477,38 +1881,72 @@ public static GetPaymentMethodsRequest ParseDelimitedFrom(global::System.IO.Stre 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) { + public static GetPaymentMethodsRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetPaymentMethodsRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - GetPaymentMethodsRequest result = new GetPaymentMethodsRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GetPaymentMethodsRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GetPaymentMethodsRequest(); + 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 { @@ -1520,12 +1958,11 @@ public override GetPaymentMethodsRequest DefaultInstanceForType { } public override GetPaymentMethodsRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - GetPaymentMethodsRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1539,6 +1976,7 @@ public override Builder MergeFrom(pb::IMessage other) { 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); } @@ -1554,24 +1992,41 @@ public override Builder MergeFrom(GetPaymentMethodsRequest other) { if (other.HasCashInOutMask) { CashInOutMask = other.CashInOutMask; } + if (other.HasRefreshPaymentMethodCache) { + RefreshPaymentMethodCache = other.RefreshPaymentMethodCache; + } + if (other.HasRefreshEBalanceCache) { + RefreshEBalanceCache = other.RefreshEBalanceCache; + } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1583,12 +2038,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 (HasBnetAccount) { + if (result.hasBnetAccount) { subBuilder.MergeFrom(BnetAccount); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1597,7 +2052,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccount) { + if (result.hasGameAccount) { subBuilder.MergeFrom(GameAccount); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1606,7 +2061,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToon) { + if (result.hasToon) { subBuilder.MergeFrom(Toon); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1614,20 +2069,33 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 34: { - Currency = input.ReadString(); + result.hasCurrency = input.ReadString(ref result.currency_); break; } case 40: { - CashInOutMask = input.ReadUInt32(); + result.hasCashInOutMask = input.ReadUInt32(ref result.cashInOutMask_); + break; + } + case 48: { + result.hasRefreshPaymentMethodCache = input.ReadBool(ref result.refreshPaymentMethodCache_); + break; + } + case 56: { + result.hasRefreshEBalanceCache = input.ReadBool(ref result.refreshEBalanceCache_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasBnetAccount { - get { return result.HasBnetAccount; } + get { return result.hasBnetAccount; } } public global::bnet.protocol.EntityId BnetAccount { get { return result.BnetAccount; } @@ -1635,19 +2103,22 @@ public bool HasBnetAccount { } 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"); - if (result.HasBnetAccount && + PrepareBuilder(); + if (result.hasBnetAccount && result.bnetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { result.bnetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccount_).MergeFrom(value).BuildPartial(); } else { @@ -1657,13 +2128,14 @@ public Builder MergeBnetAccount(global::bnet.protocol.EntityId value) { return this; } public Builder ClearBnetAccount() { + PrepareBuilder(); result.hasBnetAccount = false; - result.bnetAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + result.bnetAccount_ = null; return this; } public bool HasGameAccount { - get { return result.HasGameAccount; } + get { return result.hasGameAccount; } } public global::bnet.protocol.EntityId GameAccount { get { return result.GameAccount; } @@ -1671,19 +2143,22 @@ public bool HasGameAccount { } 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"); - if (result.HasGameAccount && + PrepareBuilder(); + if (result.hasGameAccount && result.gameAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { result.gameAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccount_).MergeFrom(value).BuildPartial(); } else { @@ -1693,13 +2168,14 @@ public Builder MergeGameAccount(global::bnet.protocol.EntityId value) { return this; } public Builder ClearGameAccount() { + PrepareBuilder(); result.hasGameAccount = false; - result.gameAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + result.gameAccount_ = null; return this; } public bool HasToon { - get { return result.HasToon; } + get { return result.hasToon; } } public global::bnet.protocol.EntityId Toon { get { return result.Toon; } @@ -1707,19 +2183,22 @@ public bool HasToon { } public Builder SetToon(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToon = true; result.toon_ = value; return this; } public Builder SetToon(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToon && result.toon_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toon_ = global::bnet.protocol.EntityId.CreateBuilder(result.toon_).MergeFrom(value).BuildPartial(); } else { @@ -1729,13 +2208,14 @@ public Builder MergeToon(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToon() { + PrepareBuilder(); result.hasToon = false; - result.toon_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toon_ = null; return this; } public bool HasCurrency { - get { return result.HasCurrency; } + get { return result.hasCurrency; } } public string Currency { get { return result.Currency; } @@ -1743,47 +2223,97 @@ public string Currency { } 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; } + 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; + } } static GetPaymentMethodsRequest() { object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.Descriptor, 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 static readonly PaymentMethod defaultInstance = new Builder().BuildPartial(); + private PaymentMethod() { } + private static readonly PaymentMethod defaultInstance = new PaymentMethod().MakeReadOnly(); + private static readonly string[] _paymentMethodFieldNames = new string[] { "account", "amount", "cash_in_out_mask", "city", "country_id", "description", "postal_code", "state" }; + private static readonly uint[] _paymentMethodFieldTags = new uint[] { 10, 24, 32, 58, 40, 18, 66, 50 }; public static PaymentMethod DefaultInstance { get { return defaultInstance; } } public override PaymentMethod DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override PaymentMethod ThisMessage { @@ -1800,12 +2330,12 @@ protected override PaymentMethod ThisMessage { public const int AccountFieldNumber = 1; private bool hasAccount; - private global::bnet.protocol.exchange.BlobFrom account_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; + private global::bnet.protocol.exchange.BlobFrom account_; public bool HasAccount { get { return hasAccount; } } public global::bnet.protocol.exchange.BlobFrom Account { - get { return account_; } + get { return account_ ?? global::bnet.protocol.exchange.BlobFrom.DefaultInstance; } } public const int DescriptionFieldNumber = 2; @@ -1820,7 +2350,7 @@ public string Description { public const int AmountFieldNumber = 3; private bool hasAmount; - private ulong amount_ = 0UL; + private ulong amount_; public bool HasAmount { get { return hasAmount; } } @@ -1828,6 +2358,56 @@ 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 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 override bool IsInitialized { get { if (!hasAccount) return false; @@ -1837,16 +2417,32 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasAccount) { - output.WriteMessage(1, Account); + string[] field_names = _paymentMethodFieldNames; + if (hasAccount) { + output.WriteMessage(1, field_names[0], Account); + } + if (hasDescription) { + output.WriteString(2, field_names[5], Description); } - if (HasDescription) { - output.WriteString(2, Description); + if (hasAmount) { + output.WriteUInt64(3, field_names[1], Amount); } - if (HasAmount) { - output.WriteUInt64(3, Amount); + if (hasCashInOutMask) { + output.WriteUInt32(4, field_names[2], CashInOutMask); + } + if (hasCountryId) { + output.WriteUInt32(5, field_names[4], CountryId); + } + if (hasState) { + output.WriteString(6, field_names[7], State); + } + if (hasCity) { + output.WriteString(7, field_names[3], City); + } + if (hasPostalCode) { + output.WriteString(8, field_names[6], PostalCode); } UnknownFields.WriteTo(output); } @@ -1858,15 +2454,30 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAccount) { + if (hasAccount) { size += pb::CodedOutputStream.ComputeMessageSize(1, Account); } - if (HasDescription) { + if (hasDescription) { size += pb::CodedOutputStream.ComputeStringSize(2, Description); } - if (HasAmount) { + if (hasAmount) { size += pb::CodedOutputStream.ComputeUInt64Size(3, Amount); } + if (hasCashInOutMask) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, CashInOutMask); + } + 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); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -1897,38 +2508,72 @@ public static PaymentMethod ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static PaymentMethod ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PaymentMethod ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - PaymentMethod result = new PaymentMethod(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override PaymentMethod MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PaymentMethod(); + 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 { @@ -1940,12 +2585,11 @@ public override PaymentMethod DefaultInstanceForType { } public override PaymentMethod BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - PaymentMethod returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1959,6 +2603,7 @@ public override Builder MergeFrom(pb::IMessage other) { 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); } @@ -1968,24 +2613,50 @@ public override Builder MergeFrom(PaymentMethod other) { if (other.HasAmount) { Amount = other.Amount; } + if (other.HasCashInOutMask) { + CashInOutMask = other.CashInOutMask; + } + if (other.HasCountryId) { + CountryId = other.CountryId; + } + if (other.HasState) { + State = other.State; + } + if (other.HasCity) { + City = other.City; + } + if (other.HasPostalCode) { + PostalCode = other.PostalCode; + } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1997,12 +2668,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.exchange.BlobFrom.Builder subBuilder = global::bnet.protocol.exchange.BlobFrom.CreateBuilder(); - if (HasAccount) { + if (result.hasAccount) { subBuilder.MergeFrom(Account); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2010,20 +2681,45 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 18: { - Description = input.ReadString(); + result.hasDescription = input.ReadString(ref result.description_); break; } case 24: { - Amount = input.ReadUInt64(); + result.hasAmount = input.ReadUInt64(ref result.amount_); + break; + } + case 32: { + result.hasCashInOutMask = input.ReadUInt32(ref result.cashInOutMask_); + 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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAccount { - get { return result.HasAccount; } + get { return result.hasAccount; } } public global::bnet.protocol.exchange.BlobFrom Account { get { return result.Account; } @@ -2031,19 +2727,22 @@ public bool HasAccount { } 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"); - if (result.HasAccount && + 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 { @@ -2053,13 +2752,14 @@ public Builder MergeAccount(global::bnet.protocol.exchange.BlobFrom value) { return this; } public Builder ClearAccount() { + PrepareBuilder(); result.hasAccount = false; - result.account_ = global::bnet.protocol.exchange.BlobFrom.DefaultInstance; + result.account_ = null; return this; } public bool HasDescription { - get { return result.HasDescription; } + get { return result.hasDescription; } } public string Description { get { return result.Description; } @@ -2067,47 +2767,160 @@ public string Description { } 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; } + 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 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; + } } static PaymentMethod() { object.ReferenceEquals(global::bnet.protocol.exchange_object_provider.ExchangeObjectProvider.Descriptor, 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 static readonly GetPaymentMethodsResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override GetPaymentMethodsResponse ThisMessage { @@ -2143,10 +2956,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.exchange_object_provider.PaymentMethod element in MethodsList) { - output.WriteMessage(1, element); + string[] field_names = _getPaymentMethodsResponseFieldNames; + if (methods_.Count > 0) { + output.WriteMessageArray(1, field_names[0], methods_); } UnknownFields.WriteTo(output); } @@ -2191,38 +3005,73 @@ public static GetPaymentMethodsResponse ParseDelimitedFrom(global::System.IO.Str 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) { + public static GetPaymentMethodsResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GetPaymentMethodsResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - GetPaymentMethodsResponse result = new GetPaymentMethodsResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GetPaymentMethodsResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GetPaymentMethodsResponse(); + 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 { @@ -2234,13 +3083,11 @@ public override GetPaymentMethodsResponse DefaultInstanceForType { } public override GetPaymentMethodsResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.methods_.MakeReadOnly(); - GetPaymentMethodsResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2254,27 +3101,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GetPaymentMethodsResponse other) { if (other == global::bnet.protocol.exchange_object_provider.GetPaymentMethodsResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.methods_.Count != 0) { - base.AddRange(other.methods_, result.methods_); + result.methods_.Add(other.methods_); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2286,22 +3145,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.exchange_object_provider.PaymentMethod.Builder subBuilder = global::bnet.protocol.exchange_object_provider.PaymentMethod.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddMethods(subBuilder.BuildPartial()); + 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 result.methods_; } + get { return PrepareBuilder().methods_; } } public int MethodsCount { get { return result.MethodsCount; } @@ -2311,29 +3173,35 @@ public int MethodsCount { } 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) { - base.AddRange(values, result.methods_); + PrepareBuilder(); + result.methods_.Add(values); return this; } public Builder ClearMethods() { + PrepareBuilder(); result.methods_.Clear(); return this; } @@ -2346,3 +3214,5 @@ static GetPaymentMethodsResponse() { #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/exchange_risk/ExchangeRisk.cs b/src/LibMooNet/bnet/protocol/exchange_risk/ExchangeRisk.cs new file mode 100644 index 00000000..f50bc315 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/exchange_risk/ExchangeRisk.cs @@ -0,0 +1,1286 @@ +// 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 ExchangeRisk { + + #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 ExchangeRisk() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "CiBsaWIvcHJvdG9jb2wvZXhjaGFuZ2Vfcmlzay5wcm90bxIbYm5ldC5wcm90" + + "b2NvbC5leGNoYW5nZV9yaXNrGhtsaWIvcHJvdG9jb2wvZXhjaGFuZ2UucHJv" + + "dG8ikAEKIVJlcG9ydEF1dGhvcml6ZVJpc2tWZXJkaWN0UmVxdWVzdBI5Cgxw" + + "YXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4Y2hhbmdlLlBh" + + "cnRpdGlvbklkEg8KB2F1dGhfaWQYAiACKAQSDgoGcmVzdWx0GAMgAigEEg8K" + + "B3ZlcmRpY3QYBCABKAQijwEKHlJlcG9ydFNldHRsZVJpc2tWZXJkaWN0UmVx" + + "dWVzdBI5CgxwYXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnByb3RvY29sLmV4" + + "Y2hhbmdlLlBhcnRpdGlvbklkEhEKCXNldHRsZV9pZBgCIAIoBBIOCgZyZXN1" + + "bHQYAyACKAQSDwoHdmVyZGljdBgEIAEoBCJtCh1EZWxheVNldHRsZVJpc2tW" + + "ZXJkaWN0UmVxdWVzdBI5CgxwYXJ0aXRpb25faWQYASACKAsyIy5ibmV0LnBy" + + "b3RvY29sLmV4Y2hhbmdlLlBhcnRpdGlvbklkEhEKCXNldHRsZV9pZBgCIAIo" + + "BEIDgAEA"); + 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", }); + 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.ExchangeRisk.internal__static_bnet_protocol_exchange_risk_ReportAuthorizeRiskVerdictRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange_risk.ExchangeRisk.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.ExchangeRisk.Descriptor, 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.ExchangeRisk.internal__static_bnet_protocol_exchange_risk_ReportSettleRiskVerdictRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange_risk.ExchangeRisk.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.ExchangeRisk.Descriptor, 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[] { "partition_id", "settle_id" }; + private static readonly uint[] _delaySettleRiskVerdictRequestFieldTags = new uint[] { 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.ExchangeRisk.internal__static_bnet_protocol_exchange_risk_DelaySettleRiskVerdictRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.exchange_risk.ExchangeRisk.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 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[0], PartitionId); + } + if (hasSettleId) { + output.WriteUInt64(2, field_names[1], SettleId); + } + 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); + } + 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; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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; + } + } + } + + 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; + } + } + static DelaySettleRiskVerdictRequest() { + object.ReferenceEquals(global::bnet.protocol.exchange_risk.ExchangeRisk.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/followers/Followers.cs b/src/LibMooNet/bnet/protocol/followers/Followers.cs similarity index 71% rename from source/D3Proto/bnet/protocol/followers/Followers.cs rename to src/LibMooNet/bnet/protocol/followers/Followers.cs index fe1ecd94..61080c44 100644 --- a/source/D3Proto/bnet/protocol/followers/Followers.cs +++ b/src/LibMooNet/bnet/protocol/followers/Followers.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.followers { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class Followers { #region Extension registration @@ -51,40 +56,40 @@ static Followers() { "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" + + "JS5ibmV0LnByb3RvY29sLmZvbGxvd2Vycy5Gb2xsb3dlZFVzZXIibgoVU3Rh" + + "cnRGb2xsb3dpbmdSZXF1ZXN0EikKCGFnZW50X2lkGAEgASgLMhcuYm5ldC5w" + + "cm90b2NvbC5FbnRpdHlJZBIqCgl0YXJnZXRfaWQYAiACKAsyFy5ibmV0LnBy" + + "b3RvY29sLkVudGl0eUlkIlYKFlN0YXJ0Rm9sbG93aW5nUmVzcG9uc2USPAoN" + + "Zm9sbG93ZWRfdXNlchgCIAEoCzIlLmJuZXQucHJvdG9jb2wuZm9sbG93ZXJz" + + "LkZvbGxvd2VkVXNlciJtChRTdG9wRm9sbG93aW5nUmVxdWVzdBIpCghhZ2Vu" + + "dF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSKgoJdGFyZ2V0" + + "X2lkGAIgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCJVChVTdG9wRm9s" + + "bG93aW5nUmVzcG9uc2USPAoNZm9sbG93ZWRfdXNlchgCIAEoCzIlLmJuZXQu" + + "cHJvdG9jb2wuZm9sbG93ZXJzLkZvbGxvd2VkVXNlciKqAQoaVXBkYXRlRm9s" + + "bG93ZXJTdGF0ZVJlcXVlc3QSKQoIYWdlbnRfaWQYASABKAsyFy5ibmV0LnBy" + + "b3RvY29sLkVudGl0eUlkEioKCXRhcmdldF9pZBgCIAIoCzIXLmJuZXQucHJv" + + "dG9jb2wuRW50aXR5SWQSNQoJYXR0cmlidXRlGAMgAygLMiIuYm5ldC5wcm90" + + "b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlIoABChtVcGRhdGVGb2xsb3dlclN0" + + "YXRlUmVzcG9uc2USKgoJdGFyZ2V0X2lkGAIgAigLMhcuYm5ldC5wcm90b2Nv" + + "bC5FbnRpdHlJZBI1CglhdHRyaWJ1dGUYAyADKAsyIi5ibmV0LnByb3RvY29s" + + "LmF0dHJpYnV0ZS5BdHRyaWJ1dGUiVAoURm9sbG93ZXJOb3RpZmljYXRpb24S" + + "PAoNZm9sbG93ZWRfdXNlchgBIAIoCzIlLmJuZXQucHJvdG9jb2wuZm9sbG93" + + "ZXJzLkZvbGxvd2VkVXNlcjKWBAoQRm9sbG93ZXJzU2VydmljZRKJAQoUU3Vi" + + "c2NyaWJlVG9Gb2xsb3dlcnMSNC5ibmV0LnByb3RvY29sLmZvbGxvd2Vycy5T" + + "dWJzY3JpYmVUb0ZvbGxvd2Vyc1JlcXVlc3QaNS5ibmV0LnByb3RvY29sLmZv" + + "bGxvd2Vycy5TdWJzY3JpYmVUb0ZvbGxvd2Vyc1Jlc3BvbnNlIgSAtRgBEncK" + + "DlN0YXJ0Rm9sbG93aW5nEi4uYm5ldC5wcm90b2NvbC5mb2xsb3dlcnMuU3Rh" + + "cnRGb2xsb3dpbmdSZXF1ZXN0Gi8uYm5ldC5wcm90b2NvbC5mb2xsb3dlcnMu" + + "U3RhcnRGb2xsb3dpbmdSZXNwb25zZSIEgLUYAhJ0Cg1TdG9wRm9sbG93aW5n" + + "Ei0uYm5ldC5wcm90b2NvbC5mb2xsb3dlcnMuU3RvcEZvbGxvd2luZ1JlcXVl" + + "c3QaLi5ibmV0LnByb3RvY29sLmZvbGxvd2Vycy5TdG9wRm9sbG93aW5nUmVz" + + "cG9uc2UiBIC1GAMShgEKE1VwZGF0ZUZvbGxvd2VyU3RhdGUSMy5ibmV0LnBy" + + "b3RvY29sLmZvbGxvd2Vycy5VcGRhdGVGb2xsb3dlclN0YXRlUmVxdWVzdBo0" + + "LmJuZXQucHJvdG9jb2wuZm9sbG93ZXJzLlVwZGF0ZUZvbGxvd2VyU3RhdGVS" + + "ZXNwb25zZSIEgLUYCDJ7Cg9Gb2xsb3dlcnNOb3RpZnkSaAoVTm90aWZ5Rm9s" + "bG93ZXJSZW1vdmVkEi0uYm5ldC5wcm90b2NvbC5mb2xsb3dlcnMuRm9sbG93" + - "ZXJOb3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFQgOA" + - "AQE="); + "ZXJOb3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSA" + + "tRgBQgOAAQA="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_followers_FollowedUser__Descriptor = Descriptor.MessageTypes[0]; @@ -102,7 +107,7 @@ static Followers() { 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", }); + new string[] { "AgentId", "TargetId", }); 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, @@ -127,7 +132,12 @@ static Followers() { internal__static_bnet_protocol_followers_FollowerNotification__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_followers_FollowerNotification__Descriptor, new string[] { "FollowedUser", }); - 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[] { @@ -140,14 +150,20 @@ static Followers() { } #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 FollowedUser : pb::GeneratedMessage { - private static readonly FollowedUser defaultInstance = new Builder().BuildPartial(); + private FollowedUser() { } + private static readonly FollowedUser defaultInstance = new FollowedUser().MakeReadOnly(); + private static readonly string[] _followedUserFieldNames = new string[] { "attribute", "id" }; + private static readonly uint[] _followedUserFieldTags = new uint[] { 18, 10 }; public static FollowedUser DefaultInstance { get { return defaultInstance; } } public override FollowedUser DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override FollowedUser ThisMessage { @@ -164,12 +180,12 @@ protected override FollowedUser ThisMessage { public const int IdFieldNumber = 1; private bool hasId; - private global::bnet.protocol.EntityId id_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId id_; public bool HasId { get { return hasId; } } public global::bnet.protocol.EntityId Id { - get { return id_; } + get { return id_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int AttributeFieldNumber = 2; @@ -195,13 +211,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 = _followedUserFieldNames; + if (hasId) { + output.WriteMessage(1, field_names[1], Id); } - 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); } @@ -213,7 +230,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasId) { + if (hasId) { size += pb::CodedOutputStream.ComputeMessageSize(1, Id); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { @@ -249,38 +266,73 @@ public static FollowedUser ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static FollowedUser ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FollowedUser ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static FollowedUser ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private FollowedUser 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(FollowedUser 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(FollowedUser cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FollowedUser result; + + private FollowedUser PrepareBuilder() { + if (resultIsReadOnly) { + FollowedUser original = result; + result = new FollowedUser(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - FollowedUser result = new FollowedUser(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override FollowedUser MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new FollowedUser(); + 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 { @@ -292,13 +344,11 @@ public override FollowedUser DefaultInstanceForType { } public override FollowedUser BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - FollowedUser returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -312,30 +362,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(FollowedUser other) { if (other == global::bnet.protocol.followers.FollowedUser.DefaultInstance) return this; + PrepareBuilder(); if (other.HasId) { MergeId(other.Id); } 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(_followedUserFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _followedUserFieldTags[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)) { @@ -347,12 +409,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 (HasId) { + if (result.hasId) { subBuilder.MergeFrom(Id); } input.ReadMessage(subBuilder, extensionRegistry); @@ -360,18 +422,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis 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 HasId { - get { return result.HasId; } + get { return result.hasId; } } public global::bnet.protocol.EntityId Id { get { return result.Id; } @@ -379,19 +444,22 @@ public bool HasId { } 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"); - if (result.HasId && + PrepareBuilder(); + if (result.hasId && result.id_ != global::bnet.protocol.EntityId.DefaultInstance) { result.id_ = global::bnet.protocol.EntityId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); } else { @@ -401,13 +469,14 @@ public Builder MergeId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearId() { + PrepareBuilder(); result.hasId = false; - result.id_ = global::bnet.protocol.EntityId.DefaultInstance; + result.id_ = null; return this; } public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -417,29 +486,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; } @@ -449,14 +524,20 @@ static FollowedUser() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SubscribeToFollowersRequest : pb::GeneratedMessage { - private static readonly SubscribeToFollowersRequest defaultInstance = new Builder().BuildPartial(); + private SubscribeToFollowersRequest() { } + private static readonly SubscribeToFollowersRequest defaultInstance = new SubscribeToFollowersRequest().MakeReadOnly(); + private static readonly string[] _subscribeToFollowersRequestFieldNames = new string[] { "agent_id", "object_id" }; + private static readonly uint[] _subscribeToFollowersRequestFieldTags = new uint[] { 10, 16 }; public static SubscribeToFollowersRequest DefaultInstance { get { return defaultInstance; } } public override SubscribeToFollowersRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SubscribeToFollowersRequest ThisMessage { @@ -473,17 +554,17 @@ protected override SubscribeToFollowersRequest ThisMessage { 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; } } @@ -501,13 +582,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 = _subscribeToFollowersRequestFieldNames; + 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); } @@ -519,10 +601,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; @@ -555,38 +637,72 @@ public static SubscribeToFollowersRequest ParseDelimitedFrom(global::System.IO.S 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) { + public static SubscribeToFollowersRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SubscribeToFollowersRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeToFollowersRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SubscribeToFollowersRequest MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(SubscribeToFollowersRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SubscribeToFollowersRequest result = new SubscribeToFollowersRequest(); + private bool resultIsReadOnly; + private SubscribeToFollowersRequest result; + + private SubscribeToFollowersRequest PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeToFollowersRequest original = result; + result = new SubscribeToFollowersRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SubscribeToFollowersRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SubscribeToFollowersRequest(); + 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 { @@ -598,12 +714,11 @@ public override SubscribeToFollowersRequest DefaultInstanceForType { } public override SubscribeToFollowersRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SubscribeToFollowersRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -617,6 +732,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SubscribeToFollowersRequest other) { if (other == global::bnet.protocol.followers.SubscribeToFollowersRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -627,20 +743,31 @@ public override Builder MergeFrom(SubscribeToFollowersRequest 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(_subscribeToFollowersRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeToFollowersRequestFieldTags[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)) { @@ -652,12 +779,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); @@ -665,16 +792,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; } @@ -682,19 +814,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 { @@ -704,24 +839,27 @@ 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; @@ -732,14 +870,20 @@ static SubscribeToFollowersRequest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SubscribeToFollowersResponse : pb::GeneratedMessage { - private static readonly SubscribeToFollowersResponse defaultInstance = new Builder().BuildPartial(); + private SubscribeToFollowersResponse() { } + private static readonly SubscribeToFollowersResponse defaultInstance = new SubscribeToFollowersResponse().MakeReadOnly(); + private static readonly string[] _subscribeToFollowersResponseFieldNames = new string[] { "followed_users" }; + private static readonly uint[] _subscribeToFollowersResponseFieldTags = new uint[] { 18 }; public static SubscribeToFollowersResponse DefaultInstance { get { return defaultInstance; } } public override SubscribeToFollowersResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SubscribeToFollowersResponse ThisMessage { @@ -775,10 +919,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.followers.FollowedUser element in FollowedUsersList) { - output.WriteMessage(2, element); + string[] field_names = _subscribeToFollowersResponseFieldNames; + if (followedUsers_.Count > 0) { + output.WriteMessageArray(2, field_names[0], followedUsers_); } UnknownFields.WriteTo(output); } @@ -823,38 +968,73 @@ public static SubscribeToFollowersResponse ParseDelimitedFrom(global::System.IO. 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) { + public static SubscribeToFollowersResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SubscribeToFollowersResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SubscribeToFollowersResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SubscribeToFollowersResponse MakeReadOnly() { + followedUsers_.MakeReadOnly(); + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(SubscribeToFollowersResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SubscribeToFollowersResponse result = new SubscribeToFollowersResponse(); + private bool resultIsReadOnly; + private SubscribeToFollowersResponse result; + + private SubscribeToFollowersResponse PrepareBuilder() { + if (resultIsReadOnly) { + SubscribeToFollowersResponse original = result; + result = new SubscribeToFollowersResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SubscribeToFollowersResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SubscribeToFollowersResponse(); + 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 { @@ -866,13 +1046,11 @@ public override SubscribeToFollowersResponse DefaultInstanceForType { } public override SubscribeToFollowersResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.followedUsers_.MakeReadOnly(); - SubscribeToFollowersResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -886,27 +1064,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SubscribeToFollowersResponse other) { if (other == global::bnet.protocol.followers.SubscribeToFollowersResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.followedUsers_.Count != 0) { - base.AddRange(other.followedUsers_, result.followedUsers_); + result.followedUsers_.Add(other.followedUsers_); } 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(_subscribeToFollowersResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _subscribeToFollowersResponseFieldTags[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)) { @@ -918,22 +1108,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 18: { - global::bnet.protocol.followers.FollowedUser.Builder subBuilder = global::bnet.protocol.followers.FollowedUser.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddFollowedUsers(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.followedUsers_, global::bnet.protocol.followers.FollowedUser.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList FollowedUsersList { - get { return result.followedUsers_; } + get { return PrepareBuilder().followedUsers_; } } public int FollowedUsersCount { get { return result.FollowedUsersCount; } @@ -943,29 +1136,35 @@ public int FollowedUsersCount { } public Builder SetFollowedUsers(int index, global::bnet.protocol.followers.FollowedUser value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.followedUsers_[index] = value; return this; } public Builder SetFollowedUsers(int index, global::bnet.protocol.followers.FollowedUser.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.followedUsers_[index] = builderForValue.Build(); return this; } public Builder AddFollowedUsers(global::bnet.protocol.followers.FollowedUser value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.followedUsers_.Add(value); return this; } public Builder AddFollowedUsers(global::bnet.protocol.followers.FollowedUser.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.followedUsers_.Add(builderForValue.Build()); return this; } public Builder AddRangeFollowedUsers(scg::IEnumerable values) { - base.AddRange(values, result.followedUsers_); + PrepareBuilder(); + result.followedUsers_.Add(values); return this; } public Builder ClearFollowedUsers() { + PrepareBuilder(); result.followedUsers_.Clear(); return this; } @@ -975,14 +1174,20 @@ static SubscribeToFollowersResponse() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class StartFollowingRequest : pb::GeneratedMessage { - private static readonly StartFollowingRequest defaultInstance = new Builder().BuildPartial(); + private StartFollowingRequest() { } + private static readonly StartFollowingRequest defaultInstance = new StartFollowingRequest().MakeReadOnly(); + private static readonly string[] _startFollowingRequestFieldNames = new string[] { "agent_id", "target_id" }; + private static readonly uint[] _startFollowingRequestFieldTags = new uint[] { 10, 18 }; public static StartFollowingRequest DefaultInstance { get { return defaultInstance; } } public override StartFollowingRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override StartFollowingRequest ThisMessage { @@ -999,56 +1204,43 @@ protected override StartFollowingRequest ThisMessage { 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_; } - } - - public const int FollowerNameFieldNumber = 3; - private bool hasFollowerName; - private string followerName_ = ""; - public bool HasFollowerName { - get { return hasFollowerName; } - } - public string FollowerName { - get { return followerName_; } + 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 (HasTargetId) { - if (!TargetId.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 (HasAgentId) { - output.WriteMessage(1, AgentId); + string[] field_names = _startFollowingRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasTargetId) { - output.WriteMessage(2, TargetId); - } - if (HasFollowerName) { - output.WriteString(3, FollowerName); + if (hasTargetId) { + output.WriteMessage(2, field_names[1], TargetId); } UnknownFields.WriteTo(output); } @@ -1060,15 +1252,12 @@ 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 (HasFollowerName) { - size += pb::CodedOutputStream.ComputeStringSize(3, FollowerName); - } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -1099,38 +1288,72 @@ public static StartFollowingRequest ParseDelimitedFrom(global::System.IO.Stream 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) { + public static StartFollowingRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static StartFollowingRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static StartFollowingRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private StartFollowingRequest MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(StartFollowingRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private StartFollowingRequest result; - StartFollowingRequest result = new StartFollowingRequest(); + private StartFollowingRequest PrepareBuilder() { + if (resultIsReadOnly) { + StartFollowingRequest original = result; + result = new StartFollowingRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override StartFollowingRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new StartFollowingRequest(); + 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 +1365,11 @@ public override StartFollowingRequest DefaultInstanceForType { } public override StartFollowingRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - StartFollowingRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1161,33 +1383,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(StartFollowingRequest other) { if (other == global::bnet.protocol.followers.StartFollowingRequest.DefaultInstance) return this; + PrepareBuilder(); 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) { + 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(_startFollowingRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _startFollowingRequestFieldTags[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)) { @@ -1199,12 +1430,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); @@ -1213,24 +1444,25 @@ 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); TargetId = subBuilder.BuildPartial(); break; } - case 26: { - FollowerName = input.ReadString(); - 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; } @@ -1238,19 +1470,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 { @@ -1260,13 +1495,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; } @@ -1274,19 +1510,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 { @@ -1296,27 +1535,9 @@ public Builder MergeTargetId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearTargetId() { + PrepareBuilder(); 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_ = ""; + result.targetId_ = null; return this; } } @@ -1325,14 +1546,20 @@ static StartFollowingRequest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class StartFollowingResponse : pb::GeneratedMessage { - private static readonly StartFollowingResponse defaultInstance = new Builder().BuildPartial(); + private StartFollowingResponse() { } + private static readonly StartFollowingResponse defaultInstance = new StartFollowingResponse().MakeReadOnly(); + private static readonly string[] _startFollowingResponseFieldNames = new string[] { "followed_user" }; + private static readonly uint[] _startFollowingResponseFieldTags = new uint[] { 18 }; public static StartFollowingResponse DefaultInstance { get { return defaultInstance; } } public override StartFollowingResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override StartFollowingResponse ThisMessage { @@ -1349,12 +1576,12 @@ protected override StartFollowingResponse ThisMessage { public const int FollowedUserFieldNumber = 2; private bool hasFollowedUser; - private global::bnet.protocol.followers.FollowedUser followedUser_ = global::bnet.protocol.followers.FollowedUser.DefaultInstance; + private global::bnet.protocol.followers.FollowedUser followedUser_; public bool HasFollowedUser { get { return hasFollowedUser; } } public global::bnet.protocol.followers.FollowedUser FollowedUser { - get { return followedUser_; } + get { return followedUser_ ?? global::bnet.protocol.followers.FollowedUser.DefaultInstance; } } public override bool IsInitialized { @@ -1366,10 +1593,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasFollowedUser) { - output.WriteMessage(2, FollowedUser); + string[] field_names = _startFollowingResponseFieldNames; + if (hasFollowedUser) { + output.WriteMessage(2, field_names[0], FollowedUser); } UnknownFields.WriteTo(output); } @@ -1381,7 +1609,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasFollowedUser) { + if (hasFollowedUser) { size += pb::CodedOutputStream.ComputeMessageSize(2, FollowedUser); } size += UnknownFields.SerializedSize; @@ -1414,38 +1642,72 @@ public static StartFollowingResponse ParseDelimitedFrom(global::System.IO.Stream 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) { + public static StartFollowingResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static StartFollowingResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static StartFollowingResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private StartFollowingResponse MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(StartFollowingResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private StartFollowingResponse result; - StartFollowingResponse result = new StartFollowingResponse(); + private StartFollowingResponse PrepareBuilder() { + if (resultIsReadOnly) { + StartFollowingResponse original = result; + result = new StartFollowingResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override StartFollowingResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new StartFollowingResponse(); + 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 { @@ -1457,12 +1719,11 @@ public override StartFollowingResponse DefaultInstanceForType { } public override StartFollowingResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - StartFollowingResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1476,6 +1737,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(StartFollowingResponse other) { if (other == global::bnet.protocol.followers.StartFollowingResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasFollowedUser) { MergeFollowedUser(other.FollowedUser); } @@ -1483,20 +1745,31 @@ public override Builder MergeFrom(StartFollowingResponse 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(_startFollowingResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _startFollowingResponseFieldTags[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)) { @@ -1508,12 +1781,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: { global::bnet.protocol.followers.FollowedUser.Builder subBuilder = global::bnet.protocol.followers.FollowedUser.CreateBuilder(); - if (HasFollowedUser) { + if (result.hasFollowedUser) { subBuilder.MergeFrom(FollowedUser); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1522,11 +1795,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasFollowedUser { - get { return result.HasFollowedUser; } + get { return result.hasFollowedUser; } } public global::bnet.protocol.followers.FollowedUser FollowedUser { get { return result.FollowedUser; } @@ -1534,19 +1812,22 @@ public bool HasFollowedUser { } public Builder SetFollowedUser(global::bnet.protocol.followers.FollowedUser value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasFollowedUser = true; result.followedUser_ = value; return this; } public Builder SetFollowedUser(global::bnet.protocol.followers.FollowedUser.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -1556,8 +1837,9 @@ public Builder MergeFollowedUser(global::bnet.protocol.followers.FollowedUser va return this; } public Builder ClearFollowedUser() { + PrepareBuilder(); result.hasFollowedUser = false; - result.followedUser_ = global::bnet.protocol.followers.FollowedUser.DefaultInstance; + result.followedUser_ = null; return this; } } @@ -1566,14 +1848,20 @@ static StartFollowingResponse() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class StopFollowingRequest : pb::GeneratedMessage { - private static readonly StopFollowingRequest defaultInstance = new Builder().BuildPartial(); + private StopFollowingRequest() { } + private static readonly StopFollowingRequest defaultInstance = new StopFollowingRequest().MakeReadOnly(); + private static readonly string[] _stopFollowingRequestFieldNames = new string[] { "agent_id", "target_id" }; + private static readonly uint[] _stopFollowingRequestFieldTags = new uint[] { 10, 18 }; public static StopFollowingRequest DefaultInstance { get { return defaultInstance; } } public override StopFollowingRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override StopFollowingRequest ThisMessage { @@ -1590,22 +1878,22 @@ protected override StopFollowingRequest ThisMessage { 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 { @@ -1619,13 +1907,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 = _stopFollowingRequestFieldNames; + 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); } @@ -1637,10 +1926,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; @@ -1673,38 +1962,72 @@ public static StopFollowingRequest ParseDelimitedFrom(global::System.IO.Stream i 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) { + public static StopFollowingRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static StopFollowingRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static StopFollowingRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private StopFollowingRequest MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(StopFollowingRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - StopFollowingRequest result = new StopFollowingRequest(); + private bool resultIsReadOnly; + private StopFollowingRequest result; + + private StopFollowingRequest PrepareBuilder() { + if (resultIsReadOnly) { + StopFollowingRequest original = result; + result = new StopFollowingRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override StopFollowingRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new StopFollowingRequest(); + 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,12 +2039,11 @@ public override StopFollowingRequest DefaultInstanceForType { } public override StopFollowingRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - StopFollowingRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1735,6 +2057,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(StopFollowingRequest other) { if (other == global::bnet.protocol.followers.StopFollowingRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -1745,20 +2068,31 @@ public override Builder MergeFrom(StopFollowingRequest 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(_stopFollowingRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _stopFollowingRequestFieldTags[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)) { @@ -1770,12 +2104,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); @@ -1784,7 +2118,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); @@ -1793,11 +2127,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; } @@ -1805,19 +2144,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 { @@ -1827,13 +2169,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; } @@ -1841,19 +2184,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 { @@ -1863,8 +2209,9 @@ 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; } } @@ -1873,14 +2220,20 @@ static StopFollowingRequest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class StopFollowingResponse : pb::GeneratedMessage { - private static readonly StopFollowingResponse defaultInstance = new Builder().BuildPartial(); + private StopFollowingResponse() { } + private static readonly StopFollowingResponse defaultInstance = new StopFollowingResponse().MakeReadOnly(); + private static readonly string[] _stopFollowingResponseFieldNames = new string[] { "followed_user" }; + private static readonly uint[] _stopFollowingResponseFieldTags = new uint[] { 18 }; public static StopFollowingResponse DefaultInstance { get { return defaultInstance; } } public override StopFollowingResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override StopFollowingResponse ThisMessage { @@ -1897,12 +2250,12 @@ protected override StopFollowingResponse ThisMessage { public const int FollowedUserFieldNumber = 2; private bool hasFollowedUser; - private global::bnet.protocol.followers.FollowedUser followedUser_ = global::bnet.protocol.followers.FollowedUser.DefaultInstance; + private global::bnet.protocol.followers.FollowedUser followedUser_; public bool HasFollowedUser { get { return hasFollowedUser; } } public global::bnet.protocol.followers.FollowedUser FollowedUser { - get { return followedUser_; } + get { return followedUser_ ?? global::bnet.protocol.followers.FollowedUser.DefaultInstance; } } public override bool IsInitialized { @@ -1914,10 +2267,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasFollowedUser) { - output.WriteMessage(2, FollowedUser); + string[] field_names = _stopFollowingResponseFieldNames; + if (hasFollowedUser) { + output.WriteMessage(2, field_names[0], FollowedUser); } UnknownFields.WriteTo(output); } @@ -1929,7 +2283,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasFollowedUser) { + if (hasFollowedUser) { size += pb::CodedOutputStream.ComputeMessageSize(2, FollowedUser); } size += UnknownFields.SerializedSize; @@ -1962,38 +2316,72 @@ public static StopFollowingResponse ParseDelimitedFrom(global::System.IO.Stream 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) { + public static StopFollowingResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static StopFollowingResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static StopFollowingResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private StopFollowingResponse MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(StopFollowingResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - StopFollowingResponse result = new StopFollowingResponse(); + private bool resultIsReadOnly; + private StopFollowingResponse result; + + private StopFollowingResponse PrepareBuilder() { + if (resultIsReadOnly) { + StopFollowingResponse original = result; + result = new StopFollowingResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override StopFollowingResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new StopFollowingResponse(); + 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 { @@ -2005,12 +2393,11 @@ public override StopFollowingResponse DefaultInstanceForType { } public override StopFollowingResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - StopFollowingResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2024,6 +2411,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(StopFollowingResponse other) { if (other == global::bnet.protocol.followers.StopFollowingResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasFollowedUser) { MergeFollowedUser(other.FollowedUser); } @@ -2031,20 +2419,31 @@ public override Builder MergeFrom(StopFollowingResponse 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(_stopFollowingResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _stopFollowingResponseFieldTags[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)) { @@ -2056,12 +2455,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: { global::bnet.protocol.followers.FollowedUser.Builder subBuilder = global::bnet.protocol.followers.FollowedUser.CreateBuilder(); - if (HasFollowedUser) { + if (result.hasFollowedUser) { subBuilder.MergeFrom(FollowedUser); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2070,11 +2469,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasFollowedUser { - get { return result.HasFollowedUser; } + get { return result.hasFollowedUser; } } public global::bnet.protocol.followers.FollowedUser FollowedUser { get { return result.FollowedUser; } @@ -2082,19 +2486,22 @@ public bool HasFollowedUser { } public Builder SetFollowedUser(global::bnet.protocol.followers.FollowedUser value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasFollowedUser = true; result.followedUser_ = value; return this; } public Builder SetFollowedUser(global::bnet.protocol.followers.FollowedUser.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -2104,8 +2511,9 @@ public Builder MergeFollowedUser(global::bnet.protocol.followers.FollowedUser va return this; } public Builder ClearFollowedUser() { + PrepareBuilder(); result.hasFollowedUser = false; - result.followedUser_ = global::bnet.protocol.followers.FollowedUser.DefaultInstance; + result.followedUser_ = null; return this; } } @@ -2114,14 +2522,20 @@ static StopFollowingResponse() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class UpdateFollowerStateRequest : pb::GeneratedMessage { - private static readonly UpdateFollowerStateRequest defaultInstance = new Builder().BuildPartial(); + private UpdateFollowerStateRequest() { } + private static readonly UpdateFollowerStateRequest defaultInstance = new UpdateFollowerStateRequest().MakeReadOnly(); + private static readonly string[] _updateFollowerStateRequestFieldNames = new string[] { "agent_id", "attribute", "target_id" }; + private static readonly uint[] _updateFollowerStateRequestFieldTags = new uint[] { 10, 26, 18 }; public static UpdateFollowerStateRequest DefaultInstance { get { return defaultInstance; } } public override UpdateFollowerStateRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override UpdateFollowerStateRequest ThisMessage { @@ -2138,22 +2552,22 @@ protected override UpdateFollowerStateRequest ThisMessage { 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; @@ -2182,16 +2596,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 = _updateFollowerStateRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasTargetId) { - output.WriteMessage(2, TargetId); + if (hasTargetId) { + output.WriteMessage(2, field_names[2], 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_); } UnknownFields.WriteTo(output); } @@ -2203,10 +2618,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); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { @@ -2242,38 +2657,73 @@ public static UpdateFollowerStateRequest ParseDelimitedFrom(global::System.IO.St 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) { + public static UpdateFollowerStateRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UpdateFollowerStateRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static UpdateFollowerStateRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private UpdateFollowerStateRequest 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(UpdateFollowerStateRequest 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(UpdateFollowerStateRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UpdateFollowerStateRequest result; + + private UpdateFollowerStateRequest PrepareBuilder() { + if (resultIsReadOnly) { + UpdateFollowerStateRequest original = result; + result = new UpdateFollowerStateRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - UpdateFollowerStateRequest result = new UpdateFollowerStateRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override UpdateFollowerStateRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UpdateFollowerStateRequest(); + 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 { @@ -2285,13 +2735,11 @@ public override UpdateFollowerStateRequest DefaultInstanceForType { } public override UpdateFollowerStateRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - UpdateFollowerStateRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2305,6 +2753,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(UpdateFollowerStateRequest other) { if (other == global::bnet.protocol.followers.UpdateFollowerStateRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -2312,26 +2761,37 @@ public override Builder MergeFrom(UpdateFollowerStateRequest other) { MergeTargetId(other.TargetId); } 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(_updateFollowerStateRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateFollowerStateRequestFieldTags[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)) { @@ -2343,12 +2803,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); @@ -2357,7 +2817,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); @@ -2365,18 +2825,21 @@ 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; } } } + + 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; } @@ -2384,19 +2847,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 { @@ -2406,13 +2872,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; } @@ -2420,19 +2887,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 { @@ -2442,13 +2912,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; } @@ -2458,29 +2929,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; } @@ -2490,14 +2967,20 @@ static UpdateFollowerStateRequest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class UpdateFollowerStateResponse : pb::GeneratedMessage { - private static readonly UpdateFollowerStateResponse defaultInstance = new Builder().BuildPartial(); + private UpdateFollowerStateResponse() { } + private static readonly UpdateFollowerStateResponse defaultInstance = new UpdateFollowerStateResponse().MakeReadOnly(); + private static readonly string[] _updateFollowerStateResponseFieldNames = new string[] { "attribute", "target_id" }; + private static readonly uint[] _updateFollowerStateResponseFieldTags = new uint[] { 26, 18 }; public static UpdateFollowerStateResponse DefaultInstance { get { return defaultInstance; } } public override UpdateFollowerStateResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override UpdateFollowerStateResponse ThisMessage { @@ -2514,12 +2997,12 @@ protected override UpdateFollowerStateResponse ThisMessage { 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; @@ -2545,13 +3028,14 @@ public override bool IsInitialized { } } - 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 = _updateFollowerStateResponseFieldNames; + if (hasTargetId) { + output.WriteMessage(2, field_names[1], TargetId); } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(3, element); + if (attribute_.Count > 0) { + output.WriteMessageArray(3, field_names[0], attribute_); } UnknownFields.WriteTo(output); } @@ -2563,7 +3047,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasTargetId) { + if (hasTargetId) { size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { @@ -2599,38 +3083,73 @@ public static UpdateFollowerStateResponse ParseDelimitedFrom(global::System.IO.S 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) { + public static UpdateFollowerStateResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UpdateFollowerStateResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static UpdateFollowerStateResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private UpdateFollowerStateResponse 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(UpdateFollowerStateResponse 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(UpdateFollowerStateResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UpdateFollowerStateResponse result; - UpdateFollowerStateResponse result = new UpdateFollowerStateResponse(); + private UpdateFollowerStateResponse PrepareBuilder() { + if (resultIsReadOnly) { + UpdateFollowerStateResponse original = result; + result = new UpdateFollowerStateResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override UpdateFollowerStateResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UpdateFollowerStateResponse(); + 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 { @@ -2642,13 +3161,11 @@ public override UpdateFollowerStateResponse DefaultInstanceForType { } public override UpdateFollowerStateResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - UpdateFollowerStateResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2662,30 +3179,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(UpdateFollowerStateResponse other) { if (other == global::bnet.protocol.followers.UpdateFollowerStateResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasTargetId) { MergeTargetId(other.TargetId); } 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(_updateFollowerStateResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateFollowerStateResponseFieldTags[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)) { @@ -2697,12 +3226,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: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasTargetId) { + if (result.hasTargetId) { subBuilder.MergeFrom(TargetId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2710,18 +3239,21 @@ 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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasTargetId { - get { return result.HasTargetId; } + get { return result.hasTargetId; } } public global::bnet.protocol.EntityId TargetId { get { return result.TargetId; } @@ -2729,19 +3261,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 { @@ -2751,13 +3286,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; } @@ -2767,29 +3303,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; } @@ -2799,14 +3341,20 @@ static UpdateFollowerStateResponse() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class FollowerNotification : pb::GeneratedMessage { - private static readonly FollowerNotification defaultInstance = new Builder().BuildPartial(); + private FollowerNotification() { } + private static readonly FollowerNotification defaultInstance = new FollowerNotification().MakeReadOnly(); + private static readonly string[] _followerNotificationFieldNames = new string[] { "followed_user" }; + private static readonly uint[] _followerNotificationFieldTags = new uint[] { 10 }; public static FollowerNotification DefaultInstance { get { return defaultInstance; } } public override FollowerNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override FollowerNotification ThisMessage { @@ -2823,12 +3371,12 @@ protected override FollowerNotification ThisMessage { public const int FollowedUserFieldNumber = 1; private bool hasFollowedUser; - private global::bnet.protocol.followers.FollowedUser followedUser_ = global::bnet.protocol.followers.FollowedUser.DefaultInstance; + private global::bnet.protocol.followers.FollowedUser followedUser_; public bool HasFollowedUser { get { return hasFollowedUser; } } public global::bnet.protocol.followers.FollowedUser FollowedUser { - get { return followedUser_; } + get { return followedUser_ ?? global::bnet.protocol.followers.FollowedUser.DefaultInstance; } } public override bool IsInitialized { @@ -2839,10 +3387,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasFollowedUser) { - output.WriteMessage(1, FollowedUser); + string[] field_names = _followerNotificationFieldNames; + if (hasFollowedUser) { + output.WriteMessage(1, field_names[0], FollowedUser); } UnknownFields.WriteTo(output); } @@ -2854,7 +3403,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasFollowedUser) { + if (hasFollowedUser) { size += pb::CodedOutputStream.ComputeMessageSize(1, FollowedUser); } size += UnknownFields.SerializedSize; @@ -2887,38 +3436,72 @@ public static FollowerNotification ParseDelimitedFrom(global::System.IO.Stream i 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) { + public static FollowerNotification ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FollowerNotification ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static FollowerNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private FollowerNotification MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(FollowerNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FollowerNotification result; + + private FollowerNotification PrepareBuilder() { + if (resultIsReadOnly) { + FollowerNotification original = result; + result = new FollowerNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - FollowerNotification result = new FollowerNotification(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override FollowerNotification MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new FollowerNotification(); + 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 { @@ -2930,12 +3513,11 @@ public override FollowerNotification DefaultInstanceForType { } public override FollowerNotification BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - FollowerNotification returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2949,6 +3531,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(FollowerNotification other) { if (other == global::bnet.protocol.followers.FollowerNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasFollowedUser) { MergeFollowedUser(other.FollowedUser); } @@ -2956,20 +3539,31 @@ public override Builder MergeFrom(FollowerNotification 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(_followerNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _followerNotificationFieldTags[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)) { @@ -2981,12 +3575,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.followers.FollowedUser.Builder subBuilder = global::bnet.protocol.followers.FollowedUser.CreateBuilder(); - if (HasFollowedUser) { + if (result.hasFollowedUser) { subBuilder.MergeFrom(FollowedUser); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2995,11 +3589,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasFollowedUser { - get { return result.HasFollowedUser; } + get { return result.hasFollowedUser; } } public global::bnet.protocol.followers.FollowedUser FollowedUser { get { return result.FollowedUser; } @@ -3007,19 +3606,22 @@ public bool HasFollowedUser { } public Builder SetFollowedUser(global::bnet.protocol.followers.FollowedUser value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasFollowedUser = true; result.followedUser_ = value; return this; } public Builder SetFollowedUser(global::bnet.protocol.followers.FollowedUser.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -3029,8 +3631,9 @@ public Builder MergeFollowedUser(global::bnet.protocol.followers.FollowedUser va return this; } public Builder ClearFollowedUser() { + PrepareBuilder(); result.hasFollowedUser = false; - result.followedUser_ = global::bnet.protocol.followers.FollowedUser.DefaultInstance; + result.followedUser_ = null; return this; } } @@ -3042,6 +3645,9 @@ static FollowerNotification() { #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 FollowersService : pb::IService { public abstract void SubscribeToFollowers( pb::IRpcController controller, @@ -3144,6 +3750,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.followers.FollowersService { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -3192,6 +3801,9 @@ public override void UpdateFollowerState( } } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public abstract class FollowersNotify : pb::IService { public abstract void NotifyFollowerRemoved( pb::IRpcController controller, @@ -3255,6 +3867,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.followers.FollowersNotify { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -3279,3 +3894,5 @@ public override void NotifyFollowerRemoved( #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/friends/Friends.cs b/src/LibMooNet/bnet/protocol/friends/Friends.cs similarity index 68% rename from source/D3Proto/bnet/protocol/friends/Friends.cs rename to src/LibMooNet/bnet/protocol/friends/Friends.cs index 1acac017..128e9849 100644 --- a/source/D3Proto/bnet/protocol/friends/Friends.cs +++ b/src/LibMooNet/bnet/protocol/friends/Friends.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.friends { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class Friends { #region Extension registration @@ -32,10 +37,10 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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_UpdateFriendStateNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_friends_UpdateFriendStateNotification__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; @@ -52,83 +57,88 @@ static Friends() { "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=="); + "bC9pbnZpdGF0aW9uLnByb3RvGhFsaWIvcnBjL3JwYy5wcm90bxouc2Vydmlj" + + "ZS9mcmllbmRzL2RlZmluaXRpb24vZnJpZW5kc190eXBlcy5wcm90byJZChlT" + + "dWJzY3JpYmVUb0ZyaWVuZHNSZXF1ZXN0EikKCGFnZW50X2lkGAEgASgLMhcu" + + "Ym5ldC5wcm90b2NvbC5FbnRpdHlJZBIRCglvYmplY3RfaWQYAiACKAQipQIK" + + "GlN1YnNjcmliZVRvRnJpZW5kc1Jlc3BvbnNlEhMKC21heF9mcmllbmRzGAEg" + + "ASgNEiAKGG1heF9yZWNlaXZlZF9pbnZpdGF0aW9ucxgCIAEoDRIcChRtYXhf" + + "c2VudF9pbnZpdGF0aW9ucxgDIAEoDRIuCgdmcmllbmRzGAQgAygLMh0uYm5l" + + "dC5wcm90b2NvbC5mcmllbmRzLkZyaWVuZBI+ChBzZW50X2ludml0YXRpb25z" + + "GAUgAygLMiQuYm5ldC5wcm90b2NvbC5pbnZpdGF0aW9uLkludml0YXRpb24S" + + "QgoUcmVjZWl2ZWRfaW52aXRhdGlvbnMYBiADKAsyJC5ibmV0LnByb3RvY29s" + + "Lmludml0YXRpb24uSW52aXRhdGlvbiJbChtVbnN1YnNjcmliZVRvRnJpZW5k" + + "c1JlcXVlc3QSKQoIYWdlbnRfaWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVu" + + "dGl0eUlkEhEKCW9iamVjdF9pZBgCIAEoBCJtChRHZW5lcmljRnJpZW5kUmVx" + + "dWVzdBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5" + + "SWQSKgoJdGFyZ2V0X2lkGAIgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJ" + + "ZCJNChVHZW5lcmljRnJpZW5kUmVzcG9uc2USNAoNdGFyZ2V0X2ZyaWVuZBgB" + + "IAEoCzIdLmJuZXQucHJvdG9jb2wuZnJpZW5kcy5GcmllbmQivAEKFVNlbmRJ" + + "bnZpdGF0aW9uUmVxdWVzdBIUCgx0YXJnZXRfZW1haWwYASABKAkSFgoOZGlz" + + "cGxheV9zdHJpbmcYAiABKAkydQoOZnJpZW5kX3JlcXVlc3QSLy5ibmV0LnBy" + + "b3RvY29sLmludml0YXRpb24uU2VuZEludml0YXRpb25SZXF1ZXN0GGcgASgL" + + "MiwuYm5ldC5wcm90b2NvbC5mcmllbmRzLlNlbmRJbnZpdGF0aW9uUmVxdWVz" + + "dCLXAQoSVmlld0ZyaWVuZHNSZXF1ZXN0EikKCGFnZW50X2lkGAEgASgLMhcu" + + "Ym5ldC5wcm90b2NvbC5FbnRpdHlJZBIqCgl0YXJnZXRfaWQYAiACKAsyFy5i" + + "bmV0LnByb3RvY29sLkVudGl0eUlkEjgKBmZpbHRlchgDIAIoCzIoLmJuZXQu" + + "cHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZUZpbHRlchIWCgtzdGFydF9p" + + "bmRleBgEIAEoDToBMBIYCgttYXhfcmVzdWx0cxgFIAEoDToDMTAwIlwKE1Zp" + + "ZXdGcmllbmRzUmVzcG9uc2USLgoHZnJpZW5kcxgBIAMoCzIdLmJuZXQucHJv" + + "dG9jb2wuZnJpZW5kcy5GcmllbmQSFQoNdG90YWxfcmVzdWx0cxgCIAEoDSKo" + + "AQoYVXBkYXRlRnJpZW5kU3RhdGVSZXF1ZXN0EikKCGFnZW50X2lkGAEgASgL" + + "MhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIqCgl0YXJnZXRfaWQYAiACKAsy" + + "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkEjUKCWF0dHJpYnV0ZRgDIAMoCzIi" + + "LmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZSJDChJGcmllbmRO" + + "b3RpZmljYXRpb24SLQoGdGFyZ2V0GAEgAigLMh0uYm5ldC5wcm90b2NvbC5m" + + "cmllbmRzLkZyaWVuZCJWCh1VcGRhdGVGcmllbmRTdGF0ZU5vdGlmaWNhdGlv" + + "bhI1Cg5jaGFuZ2VkX2ZyaWVuZBgBIAIoCzIdLmJuZXQucHJvdG9jb2wuZnJp" + + "ZW5kcy5GcmllbmQiVwobSW52aXRhdGlvbkFkZGVkTm90aWZpY2F0aW9uEjgK" + + "Cmludml0YXRpb24YASACKAsyJC5ibmV0LnByb3RvY29sLmludml0YXRpb24u" + + "SW52aXRhdGlvbiKeAQodSW52aXRhdGlvblJlbW92ZWROb3RpZmljYXRpb24S" + + "OAoKaW52aXRhdGlvbhgBIAIoCzIkLmJuZXQucHJvdG9jb2wuaW52aXRhdGlv" + + "bi5JbnZpdGF0aW9uEg4KBnJlYXNvbhgCIAEoDRIzCgxhZGRlZF9mcmllbmQY" + + "AyABKAsyHS5ibmV0LnByb3RvY29sLmZyaWVuZHMuRnJpZW5kMocICg5Gcmll" + + "bmRzU2VydmljZRJ/ChJTdWJzY3JpYmVUb0ZyaWVuZHMSMC5ibmV0LnByb3Rv" + + "Y29sLmZyaWVuZHMuU3Vic2NyaWJlVG9GcmllbmRzUmVxdWVzdBoxLmJuZXQu" + + "cHJvdG9jb2wuZnJpZW5kcy5TdWJzY3JpYmVUb0ZyaWVuZHNSZXNwb25zZSIE" + + "gLUYARJeCg5TZW5kSW52aXRhdGlvbhIvLmJuZXQucHJvdG9jb2wuaW52aXRh" + + "dGlvbi5TZW5kSW52aXRhdGlvblJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5v" + + "RGF0YSIEgLUYAhJZChBBY2NlcHRJbnZpdGF0aW9uEiguYm5ldC5wcm90b2Nv" + + "bC5pbnZpdGF0aW9uLkdlbmVyaWNSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5O" + + "b0RhdGEiBIC1GAMSWQoQUmV2b2tlSW52aXRhdGlvbhIoLmJuZXQucHJvdG9j" + + "b2wuaW52aXRhdGlvbi5HZW5lcmljUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wu" + + "Tm9EYXRhIgSAtRgEEloKEURlY2xpbmVJbnZpdGF0aW9uEiguYm5ldC5wcm90" + + "b2NvbC5pbnZpdGF0aW9uLkdlbmVyaWNSZXF1ZXN0GhUuYm5ldC5wcm90b2Nv" + + "bC5Ob0RhdGEiBIC1GAUSWQoQSWdub3JlSW52aXRhdGlvbhIoLmJuZXQucHJv" + + "dG9jb2wuaW52aXRhdGlvbi5HZW5lcmljUmVxdWVzdBoVLmJuZXQucHJvdG9j" + + "b2wuTm9EYXRhIgSAtRgGEm8KDFJlbW92ZUZyaWVuZBIrLmJuZXQucHJvdG9j" + + "b2wuZnJpZW5kcy5HZW5lcmljRnJpZW5kUmVxdWVzdBosLmJuZXQucHJvdG9j" + + "b2wuZnJpZW5kcy5HZW5lcmljRnJpZW5kUmVzcG9uc2UiBIC1GAcSagoLVmll" + + "d0ZyaWVuZHMSKS5ibmV0LnByb3RvY29sLmZyaWVuZHMuVmlld0ZyaWVuZHNS" + + "ZXF1ZXN0GiouYm5ldC5wcm90b2NvbC5mcmllbmRzLlZpZXdGcmllbmRzUmVz" + + "cG9uc2UiBIC1GAgSYQoRVXBkYXRlRnJpZW5kU3RhdGUSLy5ibmV0LnByb3Rv" + + "Y29sLmZyaWVuZHMuVXBkYXRlRnJpZW5kU3RhdGVSZXF1ZXN0GhUuYm5ldC5w" + + "cm90b2NvbC5Ob0RhdGEiBIC1GAkSZwoUVW5zdWJzY3JpYmVUb0ZyaWVuZHMS" + + "Mi5ibmV0LnByb3RvY29sLmZyaWVuZHMuVW5zdWJzY3JpYmVUb0ZyaWVuZHNS" + + "ZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAoypAYKDUZyaWVu" + + "ZHNOb3RpZnkSYAoRTm90aWZ5RnJpZW5kQWRkZWQSKS5ibmV0LnByb3RvY29s" + + "LmZyaWVuZHMuRnJpZW5kTm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5O" + + "T19SRVNQT05TRSIEgLUYARJiChNOb3RpZnlGcmllbmRSZW1vdmVkEikuYm5l" + + "dC5wcm90b2NvbC5mcmllbmRzLkZyaWVuZE5vdGlmaWNhdGlvbhoaLmJuZXQu" + + "cHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAISdQodTm90aWZ5UmVjZWl2ZWRJ" + + "bnZpdGF0aW9uQWRkZWQSMi5ibmV0LnByb3RvY29sLmZyaWVuZHMuSW52aXRh" + + "dGlvbkFkZGVkTm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQ" + + "T05TRSIEgLUYAxJ5Ch9Ob3RpZnlSZWNlaXZlZEludml0YXRpb25SZW1vdmVk" + + "EjQuYm5ldC5wcm90b2NvbC5mcmllbmRzLkludml0YXRpb25SZW1vdmVkTm90" + + "aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05TRSIEgLUYBBJx" + + "ChlOb3RpZnlTZW50SW52aXRhdGlvbkFkZGVkEjIuYm5ldC5wcm90b2NvbC5m" + + "cmllbmRzLkludml0YXRpb25BZGRlZE5vdGlmaWNhdGlvbhoaLmJuZXQucHJv" + + "dG9jb2wuTk9fUkVTUE9OU0UiBIC1GAUSdQobTm90aWZ5U2VudEludml0YXRp" + + "b25SZW1vdmVkEjQuYm5ldC5wcm90b2NvbC5mcmllbmRzLkludml0YXRpb25S" + + "ZW1vdmVkTm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05T" + + "RSIEgLUYBhJxChdOb3RpZnlVcGRhdGVGcmllbmRTdGF0ZRI0LmJuZXQucHJv" + + "dG9jb2wuZnJpZW5kcy5VcGRhdGVGcmllbmRTdGF0ZU5vdGlmaWNhdGlvbhoa" + + "LmJuZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAdCA4ABAA=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_friends_SubscribeToFriendsRequest__Descriptor = Descriptor.MessageTypes[0]; @@ -168,14 +178,14 @@ static Friends() { 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__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", }); + 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", }); 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, @@ -184,7 +194,14 @@ static Friends() { 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; + 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.invitation.Proto.Invitation.RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + global::bnet.protocol.friends.FriendsTypes.RegisterAllExtensions(registry); + return registry; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { @@ -199,14 +216,20 @@ static Friends() { } #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 { @@ -223,17 +246,17 @@ protected override SubscribeToFriendsRequest ThisMessage { 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 +274,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 +293,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 +329,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 +406,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 +424,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 +435,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 +471,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 +484,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 +506,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,24 +531,27 @@ 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; @@ -482,14 +562,20 @@ static SubscribeToFriendsRequest() { } } + [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", "sent_invitations" }; + private static readonly uint[] _subscribeToFriendsResponseFieldTags = new uint[] { 34, 8, 16, 24, 50, 42 }; public static SubscribeToFriendsResponse DefaultInstance { get { return defaultInstance; } } public override SubscribeToFriendsResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SubscribeToFriendsResponse ThisMessage { @@ -504,9 +590,9 @@ protected override SubscribeToFriendsResponse ThisMessage { get { return global::bnet.protocol.friends.Friends.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 +600,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 +610,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,7 +620,7 @@ public uint MaxSentInvitations { get { return maxSentInvitations_; } } - public const int FriendsFieldNumber = 5; + public const int FriendsFieldNumber = 4; private pbc::PopsicleList friends_ = new pbc::PopsicleList(); public scg::IList FriendsList { get { return friends_; } @@ -546,7 +632,7 @@ public int FriendsCount { return friends_[index]; } - public const int SentInvitationsFieldNumber = 6; + public const int SentInvitationsFieldNumber = 5; private pbc::PopsicleList sentInvitations_ = new pbc::PopsicleList(); public scg::IList SentInvitationsList { get { return sentInvitations_; } @@ -558,7 +644,7 @@ public int SentInvitationsCount { return sentInvitations_[index]; } - public const int ReceivedInvitationsFieldNumber = 7; + public const int ReceivedInvitationsFieldNumber = 6; private pbc::PopsicleList receivedInvitations_ = new pbc::PopsicleList(); public scg::IList ReceivedInvitationsList { get { return receivedInvitations_; } @@ -585,25 +671,26 @@ 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(3, MaxReceivedInvitations); + if (hasMaxReceivedInvitations) { + output.WriteUInt32(2, field_names[2], MaxReceivedInvitations); } - if (HasMaxSentInvitations) { - output.WriteUInt32(4, MaxSentInvitations); + if (hasMaxSentInvitations) { + output.WriteUInt32(3, field_names[3], MaxSentInvitations); } - foreach (global::bnet.protocol.friends.Friend element in FriendsList) { - output.WriteMessage(5, element); + if (friends_.Count > 0) { + output.WriteMessageArray(4, field_names[0], friends_); } - foreach (global::bnet.protocol.invitation.Invitation element in SentInvitationsList) { - output.WriteMessage(6, element); + if (sentInvitations_.Count > 0) { + output.WriteMessageArray(5, field_names[5], sentInvitations_); } - foreach (global::bnet.protocol.invitation.Invitation element in ReceivedInvitationsList) { - output.WriteMessage(7, element); + if (receivedInvitations_.Count > 0) { + output.WriteMessageArray(6, field_names[4], receivedInvitations_); } UnknownFields.WriteTo(output); } @@ -615,23 +702,23 @@ 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.friends.Friend element in FriendsList) { - size += pb::CodedOutputStream.ComputeMessageSize(5, element); + size += pb::CodedOutputStream.ComputeMessageSize(4, element); } foreach (global::bnet.protocol.invitation.Invitation element in SentInvitationsList) { - size += pb::CodedOutputStream.ComputeMessageSize(6, element); + size += pb::CodedOutputStream.ComputeMessageSize(5, element); } foreach (global::bnet.protocol.invitation.Invitation element in ReceivedInvitationsList) { - size += pb::CodedOutputStream.ComputeMessageSize(7, element); + size += pb::CodedOutputStream.ComputeMessageSize(6, element); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -663,38 +750,75 @@ 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() { + 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 +830,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 +848,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; } @@ -738,32 +859,43 @@ public override Builder MergeFrom(SubscribeToFriendsResponse other) { MaxSentInvitations = other.MaxSentInvitations; } 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 +907,105 @@ 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.friends_, global::bnet.protocol.friends.Friend.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.sentInvitations_, global::bnet.protocol.invitation.Invitation.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()); - 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 FriendsList { - get { return result.friends_; } + get { return PrepareBuilder().friends_; } } public int FriendsCount { get { return result.FriendsCount; } @@ -878,35 +1015,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 +1059,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,29 +1103,35 @@ 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; } @@ -986,14 +1141,20 @@ static SubscribeToFriendsResponse() { } } + [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 { @@ -1010,17 +1171,17 @@ protected override UnsubscribeToFriendsRequest ThisMessage { 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 +1198,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 +1217,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 +1253,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 +1330,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 +1348,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 +1359,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 +1395,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 +1408,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 +1430,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,24 +1455,27 @@ 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; @@ -1268,14 +1486,20 @@ static UnsubscribeToFriendsRequest() { } } + [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 { @@ -1292,22 +1516,22 @@ protected override GenericFriendRequest ThisMessage { 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 +1545,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 +1564,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 +1600,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 +1677,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 +1695,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 +1706,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 +1742,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 +1756,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 +1765,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 +1782,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 +1807,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 +1822,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,8 +1847,9 @@ 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; } } @@ -1575,14 +1858,20 @@ static GenericFriendRequest() { } } + [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 { @@ -1597,14 +1886,14 @@ protected override GenericFriendResponse ThisMessage { get { return global::bnet.protocol.friends.Friends.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 +1905,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 +1921,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 +1954,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; + } + + private bool resultIsReadOnly; + private GenericFriendResponse result; + + private GenericFriendResponse PrepareBuilder() { + if (resultIsReadOnly) { + GenericFriendResponse original = result; + result = new GenericFriendResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - GenericFriendResponse result = new GenericFriendResponse(); + 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 +2031,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 +2049,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 +2057,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 +2093,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 +2107,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 +2124,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,8 +2149,9 @@ 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; } } @@ -1816,14 +2160,20 @@ static GenericFriendResponse() { } } + [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 static readonly SendInvitationRequest defaultInstance = new Builder().BuildPartial(); + private SendInvitationRequest() { } + private static readonly SendInvitationRequest defaultInstance = new SendInvitationRequest().MakeReadOnly(); + private static readonly string[] _sendInvitationRequestFieldNames = new string[] { "display_string", "target_email" }; + private static readonly uint[] _sendInvitationRequestFieldTags = new uint[] { 18, 10 }; public static SendInvitationRequest DefaultInstance { get { return defaultInstance; } } public override SendInvitationRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SendInvitationRequest ThisMessage { @@ -1840,7 +2190,7 @@ protected override SendInvitationRequest ThisMessage { public const int FriendRequestFieldNumber = 103; public static pb::GeneratedExtensionBase FriendRequest; - public const int TargetEmailFieldNumber = 3; + public const int TargetEmailFieldNumber = 1; private bool hasTargetEmail; private string targetEmail_ = ""; public bool HasTargetEmail { @@ -1850,7 +2200,7 @@ public string TargetEmail { get { return targetEmail_; } } - public const int DisplayStringFieldNumber = 4; + public const int DisplayStringFieldNumber = 2; private bool hasDisplayString; private string displayString_ = ""; public bool HasDisplayString { @@ -1866,13 +2216,14 @@ public override bool IsInitialized { } } - 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 = _sendInvitationRequestFieldNames; + if (hasTargetEmail) { + output.WriteString(1, field_names[1], TargetEmail); } - if (HasDisplayString) { - output.WriteString(4, DisplayString); + if (hasDisplayString) { + output.WriteString(2, field_names[0], DisplayString); } UnknownFields.WriteTo(output); } @@ -1884,11 +2235,11 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasTargetEmail) { - size += pb::CodedOutputStream.ComputeStringSize(3, TargetEmail); + if (hasTargetEmail) { + size += pb::CodedOutputStream.ComputeStringSize(1, TargetEmail); } - if (HasDisplayString) { - size += pb::CodedOutputStream.ComputeStringSize(4, DisplayString); + if (hasDisplayString) { + size += pb::CodedOutputStream.ComputeStringSize(2, DisplayString); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -1920,38 +2271,72 @@ public static SendInvitationRequest ParseDelimitedFrom(global::System.IO.Stream 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) { + public static SendInvitationRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - SendInvitationRequest result = new SendInvitationRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SendInvitationRequest MessageBeingBuilt { - get { return result; } + 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 { @@ -1963,12 +2348,11 @@ public override SendInvitationRequest DefaultInstanceForType { } public override SendInvitationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SendInvitationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1982,6 +2366,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SendInvitationRequest other) { if (other == global::bnet.protocol.friends.SendInvitationRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasTargetEmail) { TargetEmail = other.TargetEmail; } @@ -1992,20 +2377,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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -2017,24 +2413,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 26: { - TargetEmail = input.ReadString(); + case 10: { + result.hasTargetEmail = input.ReadString(ref result.targetEmail_); break; } - case 34: { - DisplayString = input.ReadString(); + case 18: { + result.hasDisplayString = input.ReadString(ref result.displayString_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasTargetEmail { - get { return result.HasTargetEmail; } + get { return result.hasTargetEmail; } } public string TargetEmail { get { return result.TargetEmail; } @@ -2042,18 +2443,20 @@ public string TargetEmail { } 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 HasDisplayString { - get { return result.HasDisplayString; } + get { return result.hasDisplayString; } } public string DisplayString { get { return result.DisplayString; } @@ -2061,11 +2464,13 @@ public string DisplayString { } public Builder SetDisplayString(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasDisplayString = true; result.displayString_ = value; return this; } public Builder ClearDisplayString() { + PrepareBuilder(); result.hasDisplayString = false; result.displayString_ = ""; return this; @@ -2076,14 +2481,20 @@ static SendInvitationRequest() { } } + [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 { @@ -2100,37 +2511,37 @@ protected override ViewFriendsRequest ThisMessage { 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 +2572,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 +2600,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 +2645,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 +2722,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 +2740,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 +2760,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 +2796,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 +2810,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 +2819,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 +2827,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 +2853,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 +2878,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 +2893,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 +2918,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 +2933,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,42 +2958,47 @@ 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; @@ -2531,14 +3009,20 @@ static ViewFriendsRequest() { } } + [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 { @@ -2567,7 +3051,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 +3068,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 +3090,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 +3123,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 +3201,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 +3219,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 +3230,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 +3266,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,46 +3298,54 @@ 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; @@ -2815,14 +3356,20 @@ static ViewFriendsResponse() { } } + [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", "target_id" }; + private static readonly uint[] _updateFriendStateRequestFieldTags = new uint[] { 10, 26, 18 }; public static UpdateFriendStateRequest DefaultInstance { get { return defaultInstance; } } public override UpdateFriendStateRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override UpdateFriendStateRequest ThisMessage { @@ -2839,22 +3386,22 @@ protected override UpdateFriendStateRequest ThisMessage { 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; @@ -2883,16 +3430,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 = _updateFriendStateRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasTargetId) { - output.WriteMessage(2, TargetId); + if (hasTargetId) { + output.WriteMessage(2, field_names[2], 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_); } UnknownFields.WriteTo(output); } @@ -2904,10 +3452,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); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { @@ -2943,38 +3491,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 +3569,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 +3587,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 +3595,37 @@ 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_); } 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 +3637,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 +3651,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 +3659,21 @@ 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; } } } + + 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 +3681,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 +3706,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 +3721,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 +3746,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,29 +3763,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; } @@ -3191,68 +3801,57 @@ static UpdateFriendStateRequest() { } } - 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[] { "target" }; + private static readonly uint[] _friendNotificationFieldTags = new uint[] { 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; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_UpdateFriendStateResponse__FieldAccessorTable; } + get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_FriendNotification__Descriptor; } } - 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_; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.friends.Friends.internal__static_bnet_protocol_friends_FriendNotification__FieldAccessorTable; } } - 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 TargetFieldNumber = 1; + private bool hasTarget; + private global::bnet.protocol.friends.Friend target_; + public bool HasTarget { + get { return hasTarget; } } - public global::bnet.protocol.attribute.Attribute GetAttribute(int index) { - return attribute_[index]; + public global::bnet.protocol.friends.Friend Target { + get { return target_ ?? global::bnet.protocol.friends.Friend.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; - } - return true; + if (!hasTarget) return false; + if (!Target.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); - } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(3, element); + string[] field_names = _friendNotificationFieldNames; + if (hasTarget) { + output.WriteMessage(1, field_names[0], Target); } UnknownFields.WriteTo(output); } @@ -3264,11 +3863,8 @@ public override int SerializedSize { 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); + if (hasTarget) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Target); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -3276,117 +3872,158 @@ 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); - } - if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + public override Builder MergeFrom(FriendNotification other) { + if (other == global::bnet.protocol.friends.FriendNotification.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTarget) { + MergeTarget(other.Target); } 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 +4035,124 @@ 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(); - break; - } - case 26: { - global::bnet.protocol.attribute.Attribute.Builder subBuilder = global::bnet.protocol.attribute.Attribute.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddAttribute(subBuilder.BuildPartial()); + Target = 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; - 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_); + result.hasTarget = true; return this; } - public Builder ClearAttribute() { - result.attribute_.Clear(); + public Builder ClearTarget() { + PrepareBuilder(); + result.hasTarget = false; + result.target_ = null; return this; } } - static UpdateFriendStateResponse() { + static FriendNotification() { object.ReferenceEquals(global::bnet.protocol.friends.Friends.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" }; + private static readonly uint[] _updateFriendStateNotificationFieldTags = new uint[] { 10 }; + 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.Friends.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.Friends.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 override bool IsInitialized { get { - if (!hasTarget) return false; - if (!Target.IsInitialized) return false; + if (!hasChangedFriend) return false; + if (!ChangedFriend.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); } UnknownFields.WriteTo(output); } @@ -3555,8 +4164,8 @@ 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); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -3564,113 +4173,158 @@ 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); } 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,72 +4336,87 @@ 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; } } } + + 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() { + static UpdateFriendStateNotification() { object.ReferenceEquals(global::bnet.protocol.friends.Friends.Descriptor, 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 { @@ -3764,12 +4433,12 @@ protected override InvitationAddedNotification ThisMessage { 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 { @@ -3780,10 +4449,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); } @@ -3795,7 +4465,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; @@ -3828,38 +4498,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; - InvitationAddedNotification result = new InvitationAddedNotification(); + private InvitationAddedNotification PrepareBuilder() { + if (resultIsReadOnly) { + InvitationAddedNotification original = result; + result = new InvitationAddedNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 { @@ -3871,12 +4575,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) { @@ -3890,6 +4593,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(InvitationAddedNotification other) { if (other == global::bnet.protocol.friends.InvitationAddedNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasInvitation) { MergeInvitation(other.Invitation); } @@ -3897,20 +4601,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)) { @@ -3922,12 +4637,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); @@ -3936,11 +4651,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; } @@ -3948,19 +4668,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 { @@ -3970,8 +4693,9 @@ 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; } } @@ -3980,14 +4704,20 @@ static InvitationAddedNotification() { } } + [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[] { "added_friend", "invitation", "reason" }; + private static readonly uint[] _invitationRemovedNotificationFieldTags = new uint[] { 26, 10, 16 }; public static InvitationRemovedNotification DefaultInstance { get { return defaultInstance; } } public override InvitationRemovedNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override InvitationRemovedNotification ThisMessage { @@ -4004,17 +4734,17 @@ protected override InvitationRemovedNotification ThisMessage { 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; } } @@ -4024,12 +4754,12 @@ public uint Reason { public const int AddedFriendFieldNumber = 3; private bool hasAddedFriend; - private global::bnet.protocol.friends.Friend addedFriend_ = global::bnet.protocol.friends.Friend.DefaultInstance; + private global::bnet.protocol.friends.Friend addedFriend_; public bool HasAddedFriend { get { return hasAddedFriend; } } public global::bnet.protocol.friends.Friend AddedFriend { - get { return addedFriend_; } + get { return addedFriend_ ?? global::bnet.protocol.friends.Friend.DefaultInstance; } } public override bool IsInitialized { @@ -4043,16 +4773,17 @@ 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[1], Invitation); } - if (HasReason) { - output.WriteUInt32(2, Reason); + if (hasReason) { + output.WriteUInt32(2, field_names[2], Reason); } - if (HasAddedFriend) { - output.WriteMessage(3, AddedFriend); + if (hasAddedFriend) { + output.WriteMessage(3, field_names[0], AddedFriend); } UnknownFields.WriteTo(output); } @@ -4064,13 +4795,13 @@ 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); } - if (HasAddedFriend) { + if (hasAddedFriend) { size += pb::CodedOutputStream.ComputeMessageSize(3, AddedFriend); } size += UnknownFields.SerializedSize; @@ -4103,38 +4834,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 { @@ -4146,12 +4911,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) { @@ -4165,6 +4929,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(InvitationRemovedNotification other) { if (other == global::bnet.protocol.friends.InvitationRemovedNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasInvitation) { MergeInvitation(other.Invitation); } @@ -4178,20 +4943,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)) { @@ -4203,12 +4979,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); @@ -4216,12 +4992,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 16: { - Reason = input.ReadUInt32(); + result.hasReason = input.ReadUInt32(ref result.reason_); break; } case 26: { global::bnet.protocol.friends.Friend.Builder subBuilder = global::bnet.protocol.friends.Friend.CreateBuilder(); - if (HasAddedFriend) { + if (result.hasAddedFriend) { subBuilder.MergeFrom(AddedFriend); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4230,11 +5006,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; } @@ -4242,19 +5023,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,31 +5048,34 @@ 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; } public bool HasAddedFriend { - get { return result.HasAddedFriend; } + get { return result.hasAddedFriend; } } public global::bnet.protocol.friends.Friend AddedFriend { get { return result.AddedFriend; } @@ -4296,19 +5083,22 @@ public bool HasAddedFriend { } public Builder SetAddedFriend(global::bnet.protocol.friends.Friend value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasAddedFriend = true; result.addedFriend_ = value; return this; } public Builder SetAddedFriend(global::bnet.protocol.friends.Friend.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -4318,8 +5108,9 @@ public Builder MergeAddedFriend(global::bnet.protocol.friends.Friend value) { return this; } public Builder ClearAddedFriend() { + PrepareBuilder(); result.hasAddedFriend = false; - result.addedFriend_ = global::bnet.protocol.friends.Friend.DefaultInstance; + result.addedFriend_ = null; return this; } } @@ -4331,6 +5122,9 @@ static InvitationRemovedNotification() { #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 +5133,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, @@ -4367,7 +5161,7 @@ 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, @@ -4397,7 +5191,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: @@ -4432,7 +5226,7 @@ public void CallMethod( return; case 8: this.UpdateFriendState(controller, (global::bnet.protocol.friends.UpdateFriendStateRequest) request, - pb::RpcUtil.SpecializeCallback( + pb::RpcUtil.SpecializeCallback( done)); return; case 9: @@ -4485,7 +5279,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: @@ -4499,7 +5293,7 @@ public void CallMethod( case 7: return global::bnet.protocol.friends.ViewFriendsResponse.DefaultInstance; case 8: - return global::bnet.protocol.friends.UpdateFriendStateResponse.DefaultInstance; + return global::bnet.protocol.NoData.DefaultInstance; case 9: return global::bnet.protocol.NoData.DefaultInstance; default: @@ -4511,6 +5305,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 +5331,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( @@ -4597,10 +5394,10 @@ public override void ViewFriends( public override void UpdateFriendState( pb::IRpcController controller, global::bnet.protocol.friends.UpdateFriendStateRequest request, - global::System.Action done) { + 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)); + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } public override void UnsubscribeToFriends( @@ -4613,6 +5410,9 @@ public override void UnsubscribeToFriends( } } } + [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, @@ -4630,10 +5430,18 @@ public abstract void NotifyReceivedInvitationRemoved( pb::IRpcController controller, global::bnet.protocol.friends.InvitationRemovedNotification request, global::System.Action done); + public abstract void NotifySentInvitationAdded( + pb::IRpcController controller, + global::bnet.protocol.friends.InvitationAddedNotification request, + global::System.Action done); public abstract void NotifySentInvitationRemoved( pb::IRpcController controller, global::bnet.protocol.friends.InvitationRemovedNotification 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]; } @@ -4673,10 +5481,20 @@ public void CallMethod( done)); return; case 4: + this.NotifySentInvitationAdded(controller, (global::bnet.protocol.friends.InvitationAddedNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 5: this.NotifySentInvitationRemoved(controller, (global::bnet.protocol.friends.InvitationRemovedNotification) request, pb::RpcUtil.SpecializeCallback( done)); return; + case 6: + this.NotifyUpdateFriendState(controller, (global::bnet.protocol.friends.UpdateFriendStateNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -4697,7 +5515,11 @@ public void CallMethod( case 3: return global::bnet.protocol.friends.InvitationRemovedNotification.DefaultInstance; case 4: + return global::bnet.protocol.friends.InvitationAddedNotification.DefaultInstance; + case 5: return global::bnet.protocol.friends.InvitationRemovedNotification.DefaultInstance; + case 6: + return global::bnet.protocol.friends.UpdateFriendStateNotification.DefaultInstance; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -4719,6 +5541,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 +5554,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; @@ -4775,11 +5604,29 @@ public override void NotifyReceivedInvitationRemoved( pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NO_RESPONSE.DefaultInstance)); } + public override void NotifySentInvitationAdded( + pb::IRpcController controller, + global::bnet.protocol.friends.InvitationAddedNotification 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.InvitationRemovedNotification request, global::System.Action done) { - channel.CallMethod(Descriptor.Methods[4], + 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)); } @@ -4788,3 +5635,5 @@ public override void NotifySentInvitationRemoved( #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/friends/FriendsTypes.cs b/src/LibMooNet/bnet/protocol/friends/FriendsTypes.cs similarity index 67% rename from source/D3Proto/bnet/protocol/friends/FriendsTypes.cs rename to src/LibMooNet/bnet/protocol/friends/FriendsTypes.cs index 51bb81a1..e6accbf8 100644 --- a/source/D3Proto/bnet/protocol/friends/FriendsTypes.cs +++ b/src/LibMooNet/bnet/protocol/friends/FriendsTypes.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,11 +8,14 @@ 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.FriendInvitation_); + registry.Add(global::bnet.protocol.friends.FriendInvitation.FriendInvitationProp); } #endregion #region Static variables @@ -27,16 +32,16 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static FriendsTypes() { byte[] descriptorData = global::System.Convert.FromBase64String( - "CiNzZXJ2aWNlL2ZyaWVuZHMvZnJpZW5kc190eXBlcy5wcm90bxIVYm5ldC5w" + - "cm90b2NvbC5mcmllbmRzGhxsaWIvcHJvdG9jb2wvYXR0cmlidXRlLnByb3Rv" + - "GhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3RvGh1saWIvcHJvdG9jb2wvaW52" + - "aXRhdGlvbi5wcm90byJkCgZGcmllbmQSIwoCaWQYASACKAsyFy5ibmV0LnBy" + - "b3RvY29sLkVudGl0eUlkEjUKCWF0dHJpYnV0ZRgCIAMoCzIiLmJuZXQucHJv" + - "dG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZSKbAQoQRnJpZW5kSW52aXRhdGlv" + - "bhIdCg5maXJzdF9yZWNlaXZlZBgBIAEoCDoFZmFsc2UyaAoRZnJpZW5kX2lu" + - "dml0YXRpb24SJC5ibmV0LnByb3RvY29sLmludml0YXRpb24uSW52aXRhdGlv" + - "bhhnIAEoCzInLmJuZXQucHJvdG9jb2wuZnJpZW5kcy5GcmllbmRJbnZpdGF0" + - "aW9u"); + "Ci5zZXJ2aWNlL2ZyaWVuZHMvZGVmaW5pdGlvbi9mcmllbmRzX3R5cGVzLnBy" + + "b3RvEhVibmV0LnByb3RvY29sLmZyaWVuZHMaHGxpYi9wcm90b2NvbC9hdHRy" + + "aWJ1dGUucHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJvdG8aHWxpYi9w" + + "cm90b2NvbC9pbnZpdGF0aW9uLnByb3RvImQKBkZyaWVuZBIjCgJpZBgBIAIo" + + "CzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSNQoJYXR0cmlidXRlGAIgAygL" + + "MiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlIpsBChBGcmll" + + "bmRJbnZpdGF0aW9uEh0KDmZpcnN0X3JlY2VpdmVkGAEgASgIOgVmYWxzZTJo" + + "ChFmcmllbmRfaW52aXRhdGlvbhIkLmJuZXQucHJvdG9jb2wuaW52aXRhdGlv" + + "bi5JbnZpdGF0aW9uGGcgASgLMicuYm5ldC5wcm90b2NvbC5mcmllbmRzLkZy" + + "aWVuZEludml0YXRpb24="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_friends_Friend__Descriptor = Descriptor.MessageTypes[0]; @@ -47,7 +52,7 @@ static FriendsTypes() { 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]); + global::bnet.protocol.friends.FriendInvitation.FriendInvitationProp = pb::GeneratedSingleExtension.CreateInstance(global::bnet.protocol.friends.FriendInvitation.Descriptor.Extensions[0]); return null; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, @@ -61,14 +66,20 @@ static FriendsTypes() { } #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 static readonly Friend defaultInstance = new Builder().BuildPartial(); + private Friend() { } + private static readonly Friend defaultInstance = new Friend().MakeReadOnly(); + private static readonly string[] _friendFieldNames = new string[] { "attribute", "id" }; + private static readonly uint[] _friendFieldTags = new uint[] { 18, 10 }; public static Friend DefaultInstance { get { return defaultInstance; } } public override Friend DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Friend ThisMessage { @@ -85,12 +96,12 @@ protected override Friend ThisMessage { public const int IdFieldNumber = 1; private bool hasId; - private global::bnet.protocol.EntityId id_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId id_; public bool HasId { get { return hasId; } } public global::bnet.protocol.EntityId Id { - get { return id_; } + get { return id_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int AttributeFieldNumber = 2; @@ -116,13 +127,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 = _friendFieldNames; + if (hasId) { + output.WriteMessage(1, field_names[1], Id); } - 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); } @@ -134,7 +146,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasId) { + if (hasId) { size += pb::CodedOutputStream.ComputeMessageSize(1, Id); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { @@ -170,38 +182,73 @@ public static Friend ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Friend ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Friend ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Friend ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Friend 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(Friend 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(Friend cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - Friend result = new Friend(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Friend(); + 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 { @@ -213,13 +260,11 @@ public override Friend DefaultInstanceForType { } public override Friend BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - Friend returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -233,30 +278,42 @@ public override Builder MergeFrom(pb::IMessage other) { 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) { - 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -268,12 +325,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 (HasId) { + if (result.hasId) { subBuilder.MergeFrom(Id); } input.ReadMessage(subBuilder, extensionRegistry); @@ -281,18 +338,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis 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 HasId { - get { return result.HasId; } + get { return result.hasId; } } public global::bnet.protocol.EntityId Id { get { return result.Id; } @@ -300,19 +360,22 @@ public bool HasId { } 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"); - if (result.HasId && + PrepareBuilder(); + if (result.hasId && result.id_ != global::bnet.protocol.EntityId.DefaultInstance) { result.id_ = global::bnet.protocol.EntityId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); } else { @@ -322,13 +385,14 @@ public Builder MergeId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearId() { + PrepareBuilder(); result.hasId = false; - result.id_ = global::bnet.protocol.EntityId.DefaultInstance; + result.id_ = null; return this; } public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -338,29 +402,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; } @@ -370,14 +440,20 @@ static Friend() { } } + [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 static readonly FriendInvitation defaultInstance = new Builder().BuildPartial(); + private FriendInvitation() { } + private static readonly FriendInvitation defaultInstance = new FriendInvitation().MakeReadOnly(); + private static readonly string[] _friendInvitationFieldNames = new string[] { "first_received" }; + private static readonly uint[] _friendInvitationFieldTags = new uint[] { 8 }; public static FriendInvitation DefaultInstance { get { return defaultInstance; } } public override FriendInvitation DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override FriendInvitation ThisMessage { @@ -393,10 +469,10 @@ protected override FriendInvitation ThisMessage { } public const int FriendInvitationFieldNumber = 103; - public static pb::GeneratedExtensionBase FriendInvitation_; + public static pb::GeneratedExtensionBase FriendInvitationProp; public const int FirstReceivedFieldNumber = 1; private bool hasFirstReceived; - private bool firstReceived_ = false; + private bool firstReceived_; public bool HasFirstReceived { get { return hasFirstReceived; } } @@ -410,10 +486,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasFirstReceived) { - output.WriteBool(1, FirstReceived); + string[] field_names = _friendInvitationFieldNames; + if (hasFirstReceived) { + output.WriteBool(1, field_names[0], FirstReceived); } UnknownFields.WriteTo(output); } @@ -425,7 +502,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasFirstReceived) { + if (hasFirstReceived) { size += pb::CodedOutputStream.ComputeBoolSize(1, FirstReceived); } size += UnknownFields.SerializedSize; @@ -458,38 +535,72 @@ public static FriendInvitation ParseDelimitedFrom(global::System.IO.Stream input 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) { + public static FriendInvitation ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FriendInvitation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static FriendInvitation ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private FriendInvitation MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(FriendInvitation cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - FriendInvitation result = new FriendInvitation(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new FriendInvitation(); + 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 { @@ -501,12 +612,11 @@ public override FriendInvitation DefaultInstanceForType { } public override FriendInvitation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - FriendInvitation returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -520,6 +630,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(FriendInvitation other) { if (other == global::bnet.protocol.friends.FriendInvitation.DefaultInstance) return this; + PrepareBuilder(); if (other.HasFirstReceived) { FirstReceived = other.FirstReceived; } @@ -527,20 +638,31 @@ public override Builder MergeFrom(FriendInvitation 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -552,31 +674,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; } case 8: { - FirstReceived = input.ReadBool(); + result.hasFirstReceived = input.ReadBool(ref result.firstReceived_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasFirstReceived { - get { return result.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; @@ -590,3 +719,5 @@ static FriendInvitation() { #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..e2454277 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,20 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static GameFactory() { byte[] descriptorData = global::System.Convert.FromBase64String( - "CiZzZXJ2aWNlL2dhbWVfbWFzdGVyL2dhbWVfZmFjdG9yeS5wcm90bxIZYm5l" + - "dC5wcm90b2NvbC5nYW1lX21hc3RlchocbGliL3Byb3RvY29sL2F0dHJpYnV0" + - "ZS5wcm90bxoZbGliL3Byb3RvY29sL2VudGl0eS5wcm90byKJAQoOR2FtZVBy" + - "b3BlcnRpZXMSOAoGZmlsdGVyGAEgASgLMiguYm5ldC5wcm90b2NvbC5hdHRy" + - "aWJ1dGUuQXR0cmlidXRlRmlsdGVyEhUKBmNyZWF0ZRgCIAEoCDoFZmFsc2US" + - "EgoEb3BlbhgDIAEoCDoEdHJ1ZRISCgpwcm9ncmFtX2lkGAQgASgH"); + "CjFzZXJ2aWNlL2dhbWVfbWFzdGVyL2RlZmluaXRpb24vZ2FtZV9mYWN0b3J5" + + "LnByb3RvEhlibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyGhxsaWIvcHJvdG9j" + + "b2wvYXR0cmlidXRlLnByb3RvGhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3Rv" + + "IsoBCg5HYW1lUHJvcGVydGllcxI/ChNjcmVhdGlvbl9hdHRyaWJ1dGVzGAEg" + + "AygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlEjgKBmZp" + + "bHRlchgCIAEoCzIoLmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0" + + "ZUZpbHRlchIVCgZjcmVhdGUYAyABKAg6BWZhbHNlEhIKBG9wZW4YBCABKAg6" + + "BHRydWUSEgoKcHJvZ3JhbV9pZBgFIAEoBw=="); 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 +55,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 +83,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 +115,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 +125,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 +137,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 +147,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 +175,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 +220,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 +298,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 +316,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 +336,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 +372,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 +463,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 +488,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 +562,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/GameMaster.cs similarity index 70% rename from source/D3Proto/bnet/protocol/game_master/GameMaster.cs rename to src/LibMooNet/bnet/protocol/game_master/GameMaster.cs index 85d0844f..c3fd9caa 100644 --- a/source/D3Proto/bnet/protocol/game_master/GameMaster.cs +++ b/src/LibMooNet/bnet/protocol/game_master/GameMaster.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.game_master { 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 GameMaster { #region Extension registration @@ -70,117 +75,117 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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"); + "CjBzZXJ2aWNlL2dhbWVfbWFzdGVyL2RlZmluaXRpb24vZ2FtZV9tYXN0ZXIu" + + "cHJvdG8SGWJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIaMXNlcnZpY2UvZ2Ft" + + "ZV9tYXN0ZXIvZGVmaW5pdGlvbi9nYW1lX2ZhY3RvcnkucHJvdG8aMHNlcnZp" + + "Y2Uvc2VydmVyX3Bvb2wvZGVmaW5pdGlvbi9zZXJ2ZXJfcG9vbC5wcm90bxoc" + + "bGliL3Byb3RvY29sL2F0dHJpYnV0ZS5wcm90bxoZbGliL3Byb3RvY29sL2Vu" + + "dGl0eS5wcm90bxoRbGliL3JwYy9ycGMucHJvdG8aNnNlcnZpY2UvZ2FtZV9t" + + "YXN0ZXIvZGVmaW5pdGlvbi9nYW1lX21hc3Rlcl90eXBlcy5wcm90byKAAQoP" + + "Sm9pbkdhbWVSZXF1ZXN0EjoKC2dhbWVfaGFuZGxlGAEgAigLMiUuYm5ldC5w" + + "cm90b2NvbC5nYW1lX21hc3Rlci5HYW1lSGFuZGxlEjEKBnBsYXllchgCIAMo" + + "CzIhLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuUGxheWVyIlAKEEpvaW5H" + + "YW1lUmVzcG9uc2USPAoMY29ubmVjdF9pbmZvGAEgAygLMiYuYm5ldC5wcm90" + + "b2NvbC5nYW1lX21hc3Rlci5Db25uZWN0SW5mbyKCAQoUTGlzdEZhY3Rvcmll" + + "c1JlcXVlc3QSOAoGZmlsdGVyGAEgAigLMiguYm5ldC5wcm90b2NvbC5hdHRy" + + "aWJ1dGUuQXR0cmlidXRlRmlsdGVyEhYKC3N0YXJ0X2luZGV4GAIgASgNOgEw" + + "EhgKC21heF9yZXN1bHRzGAMgASgNOgMxMDAidgoVTGlzdEZhY3Rvcmllc1Jl" + + "c3BvbnNlEkYKC2Rlc2NyaXB0aW9uGAEgAygLMjEuYm5ldC5wcm90b2NvbC5n" + + "YW1lX21hc3Rlci5HYW1lRmFjdG9yeURlc2NyaXB0aW9uEhUKDXRvdGFsX3Jl" + + "c3VsdHMYAiABKA0iqgEKD0ZpbmRHYW1lUmVxdWVzdBIxCgZwbGF5ZXIYASAD" + + "KAsyIS5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLlBsYXllchISCgpmYWN0" + + "b3J5X2lkGAIgASgGEj0KCnByb3BlcnRpZXMYAyABKAsyKS5ibmV0LnByb3Rv" + + "Y29sLmdhbWVfbWFzdGVyLkdhbWVQcm9wZXJ0aWVzEhEKCW9iamVjdF9pZBgE" + + "IAIoBCI6ChBGaW5kR2FtZVJlc3BvbnNlEhIKCnJlcXVlc3RfaWQYASABKAQS" + + "EgoKZmFjdG9yeV9pZBgCIAEoBiI/ChVDYW5jZWxGaW5kR2FtZVJlcXVlc3QS" + + "EgoKZmFjdG9yeV9pZBgBIAIoBhISCgpyZXF1ZXN0X2lkGAIgAigEImYKFUdh" + + "bWVFbmRlZE5vdGlmaWNhdGlvbhI6CgtnYW1lX2hhbmRsZRgBIAIoCzIlLmJu" + + "ZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuR2FtZUhhbmRsZRIRCgZyZWFzb24Y" + + "AiABKA06ATAikQEKFlBsYXllckxlZnROb3RpZmljYXRpb24SOgoLZ2FtZV9o" + + "YW5kbGUYASACKAsyJS5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkdhbWVI" + + "YW5kbGUSKAoHdG9vbl9pZBgCIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5" + + "SWQSEQoGcmVhc29uGAMgASgNOgExIpkBChVSZWdpc3RlclNlcnZlclJlcXVl" + + "c3QSNQoJYXR0cmlidXRlGAEgAygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1" + + "dGUuQXR0cmlidXRlEjUKBXN0YXRlGAIgASgLMiYuYm5ldC5wcm90b2NvbC5z" + + "ZXJ2ZXJfcG9vbC5TZXJ2ZXJTdGF0ZRISCgpwcm9ncmFtX2lkGAMgAigHIhkK" + + "F1VucmVnaXN0ZXJTZXJ2ZXJSZXF1ZXN0IpwBChhSZWdpc3RlclV0aWxpdGll" + + "c1JlcXVlc3QSNQoJYXR0cmlidXRlGAEgAygLMiIuYm5ldC5wcm90b2NvbC5h" + + "dHRyaWJ1dGUuQXR0cmlidXRlEjUKBXN0YXRlGAIgASgLMiYuYm5ldC5wcm90" + + "b2NvbC5zZXJ2ZXJfcG9vbC5TZXJ2ZXJTdGF0ZRISCgpwcm9ncmFtX2lkGAMg" + + "AigHIhwKGlVucmVnaXN0ZXJVdGlsaXRpZXNSZXF1ZXN0IiUKEFN1YnNjcmli" + + "ZVJlcXVlc3QSEQoJb2JqZWN0X2lkGAEgAigEIiwKEVN1YnNjcmliZVJlc3Bv" + + "bnNlEhcKD3N1YnNjcmlwdGlvbl9pZBgBIAEoBCItChJVbnN1YnNjcmliZVJl" + + "cXVlc3QSFwoPc3Vic2NyaXB0aW9uX2lkGAEgAigEIqwBChFDaGFuZ2VHYW1l" + + "UmVxdWVzdBI6CgtnYW1lX2hhbmRsZRgBIAIoCzIlLmJuZXQucHJvdG9jb2wu" + + "Z2FtZV9tYXN0ZXIuR2FtZUhhbmRsZRIMCgRvcGVuGAIgASgIEjUKCWF0dHJp" + + "YnV0ZRgDIAMoCzIiLmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0" + + "ZRIWCgdyZXBsYWNlGAQgASgIOgVmYWxzZSIrChVHZXRGYWN0b3J5SW5mb1Jl" + + "cXVlc3QSEgoKZmFjdG9yeV9pZBgBIAIoBiKRAQoWR2V0RmFjdG9yeUluZm9S" + + "ZXNwb25zZRI1CglhdHRyaWJ1dGUYASADKAsyIi5ibmV0LnByb3RvY29sLmF0" + + "dHJpYnV0ZS5BdHRyaWJ1dGUSQAoMc3RhdHNfYnVja2V0GAIgAygLMiouYm5l" + + "dC5wcm90b2NvbC5nYW1lX21hc3Rlci5HYW1lU3RhdHNCdWNrZXQiYwoTR2V0" + + "R2FtZVN0YXRzUmVxdWVzdBISCgpmYWN0b3J5X2lkGAEgAigGEjgKBmZpbHRl" + + "chgCIAIoCzIoLmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0ZUZp" + + "bHRlciJYChRHZXRHYW1lU3RhdHNSZXNwb25zZRJACgxzdGF0c19idWNrZXQY" + + "ASADKAsyKi5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkdhbWVTdGF0c0J1" + + "Y2tldCLxAQoZRmFjdG9yeVVwZGF0ZU5vdGlmaWNhdGlvbhJKCgJvcBgBIAIo" + + "DjI+LmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuRmFjdG9yeVVwZGF0ZU5v" + + "dGlmaWNhdGlvbi5PcGVyYXRpb24SRgoLZGVzY3JpcHRpb24YAiACKAsyMS5i" + + "bmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkdhbWVGYWN0b3J5RGVzY3JpcHRp" + + "b24SEgoKcHJvZ3JhbV9pZBgDIAEoByIsCglPcGVyYXRpb24SBwoDQUREEAES" + + "CgoGUkVNT1ZFEAISCgoGQ0hBTkdFEAMivAEKFUdhbWVGb3VuZE5vdGlmaWNh" + + "dGlvbhISCgpyZXF1ZXN0X2lkGAEgAigEEhUKCmVycm9yX2NvZGUYAiABKA06" + + "ATASOgoLZ2FtZV9oYW5kbGUYAyABKAsyJS5ibmV0LnByb3RvY29sLmdhbWVf" + + "bWFzdGVyLkdhbWVIYW5kbGUSPAoMY29ubmVjdF9pbmZvGAQgAygLMiYuYm5l" + + "dC5wcm90b2NvbC5nYW1lX21hc3Rlci5Db25uZWN0SW5mbzK+DAoKR2FtZU1h" + + "c3RlchJpCghKb2luR2FtZRIqLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIu" + + "Sm9pbkdhbWVSZXF1ZXN0GisuYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5K" + + "b2luR2FtZVJlc3BvbnNlIgSAtRgBEngKDUxpc3RGYWN0b3JpZXMSLy5ibmV0" + + "LnByb3RvY29sLmdhbWVfbWFzdGVyLkxpc3RGYWN0b3JpZXNSZXF1ZXN0GjAu" + + "Ym5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5MaXN0RmFjdG9yaWVzUmVzcG9u" + + "c2UiBIC1GAISaQoIRmluZEdhbWUSKi5ibmV0LnByb3RvY29sLmdhbWVfbWFz" + + "dGVyLkZpbmRHYW1lUmVxdWVzdBorLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0" + + "ZXIuRmluZEdhbWVSZXNwb25zZSIEgLUYAxJfCg5DYW5jZWxGaW5kR2FtZRIw" + + "LmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIuQ2FuY2VsRmluZEdhbWVSZXF1" + + "ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAQSXwoJR2FtZUVuZGVk" + + "EjAuYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5HYW1lRW5kZWROb3RpZmlj" + + "YXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgFEmEKClBs" + + "YXllckxlZnQSMS5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLlBsYXllckxl" + + "ZnROb3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSA" + + "tRgGEl8KDlJlZ2lzdGVyU2VydmVyEjAuYm5ldC5wcm90b2NvbC5nYW1lX21h" + + "c3Rlci5SZWdpc3RlclNlcnZlclJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5v" + + "RGF0YSIEgLUYBxJoChBVbnJlZ2lzdGVyU2VydmVyEjIuYm5ldC5wcm90b2Nv" + + "bC5nYW1lX21hc3Rlci5VbnJlZ2lzdGVyU2VydmVyUmVxdWVzdBoaLmJuZXQu" + + "cHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GAgSZQoRUmVnaXN0ZXJVdGlsaXRp" + + "ZXMSMy5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLlJlZ2lzdGVyVXRpbGl0" + + "aWVzUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgJEm4KE1Vu" + + "cmVnaXN0ZXJVdGlsaXRpZXMSNS5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVy" + + "LlVucmVnaXN0ZXJVdGlsaXRpZXNSZXF1ZXN0GhouYm5ldC5wcm90b2NvbC5O" + + "T19SRVNQT05TRSIEgLUYChJsCglTdWJzY3JpYmUSKy5ibmV0LnByb3RvY29s" + + "LmdhbWVfbWFzdGVyLlN1YnNjcmliZVJlcXVlc3QaLC5ibmV0LnByb3RvY29s" + + "LmdhbWVfbWFzdGVyLlN1YnNjcmliZVJlc3BvbnNlIgSAtRgLEl4KC1Vuc3Vi" + + "c2NyaWJlEi0uYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5VbnN1YnNjcmli" + + "ZVJlcXVlc3QaGi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgMElcK" + + "CkNoYW5nZUdhbWUSLC5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkNoYW5n" + + "ZUdhbWVSZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GA0SewoO" + + "R2V0RmFjdG9yeUluZm8SMC5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkdl" + + "dEZhY3RvcnlJbmZvUmVxdWVzdBoxLmJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0" + + "ZXIuR2V0RmFjdG9yeUluZm9SZXNwb25zZSIEgLUYDhJ1CgxHZXRHYW1lU3Rh" + + "dHMSLi5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkdldEdhbWVTdGF0c1Jl" + + "cXVlc3QaLy5ibmV0LnByb3RvY29sLmdhbWVfbWFzdGVyLkdldEdhbWVTdGF0" + + "c1Jlc3BvbnNlIgSAtRgPMoUBChRHYW1lTWFzdGVyU3Vic2NyaWJlchJtChNO" + + "b3RpZnlGYWN0b3J5VXBkYXRlEjQuYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rl" + + "ci5GYWN0b3J5VXBkYXRlTm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5O" + + "T19SRVNQT05TRSIEgLUYATJ+ChVHYW1lRmFjdG9yeVN1YnNjcmliZXISZQoP" + + "Tm90aWZ5R2FtZUZvdW5kEjAuYm5ldC5wcm90b2NvbC5nYW1lX21hc3Rlci5H" + + "YW1lRm91bmROb3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5PX1JFU1BP" + + "TlNFIgSAtRgBQgOAAQA="); 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", }); + 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, @@ -196,7 +201,7 @@ static GameMaster() { 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", }); + new string[] { "Player", "FactoryId", "Properties", "ObjectId", }); 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, @@ -208,7 +213,7 @@ static GameMaster() { 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", }); + new string[] { "GameHandle", "Reason", }); 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, @@ -269,13 +274,20 @@ static GameMaster() { 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; + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.game_master.GameFactory.RegisterAllExtensions(registry); + global::bnet.protocol.server_pool.ServerPool.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.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, @@ -287,14 +299,20 @@ static GameMaster() { } } #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 { @@ -311,12 +329,12 @@ protected override JoinGameRequest ThisMessage { 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 +349,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 +356,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); - } - foreach (global::bnet.protocol.game_master.Player element in PlayerList) { - output.WriteMessage(2, element); + string[] field_names = _joinGameRequestFieldNames; + if (hasGameHandle) { + output.WriteMessage(1, field_names[0], GameHandle); } - if (HasChannelRequest) { - output.WriteMessage(3, ChannelRequest); + if (player_.Count > 0) { + output.WriteMessageArray(2, field_names[1], player_); } UnknownFields.WriteTo(output); } @@ -376,15 +379,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 +415,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 +493,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 +511,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 +558,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 +571,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 +593,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 +618,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 +635,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); } } + [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" }; + private static readonly uint[] _joinGameResponseFieldTags = new uint[] { 10 }; public static JoinGameResponse DefaultInstance { get { return defaultInstance; } } public override JoinGameResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override JoinGameResponse ThisMessage { @@ -706,10 +722,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.ConnectInfo element in ConnectInfoList) { - output.WriteMessage(1, element); + string[] field_names = _joinGameResponseFieldNames; + if (connectInfo_.Count > 0) { + output.WriteMessageArray(1, field_names[0], connectInfo_); } UnknownFields.WriteTo(output); } @@ -754,38 +771,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 +849,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 +867,39 @@ 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.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 +911,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.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 pbc::IPopsicleList ConnectInfoList { - get { return result.connectInfo_; } + get { return PrepareBuilder().connectInfo_; } } public int ConnectInfoCount { get { return result.ConnectInfoCount; } @@ -874,29 +939,35 @@ 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; } @@ -906,14 +977,20 @@ static JoinGameResponse() { } } + [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 { @@ -930,17 +1007,17 @@ protected override ListFactoriesRequest ThisMessage { 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 +1043,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 +1065,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 +1104,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 +1181,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 +1199,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 +1213,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 +1249,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 +1262,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 +1288,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,42 +1313,47 @@ 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; @@ -1228,14 +1364,20 @@ static ListFactoriesRequest() { } } + [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 { @@ -1264,7 +1406,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 +1423,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 +1445,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 +1478,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 +1556,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 +1574,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 +1585,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 +1621,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,46 +1653,54 @@ 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; @@ -1512,14 +1711,20 @@ static ListFactoriesResponse() { } } + [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", "object_id", "player", "properties" }; + private static readonly uint[] _findGameRequestFieldTags = new uint[] { 17, 32, 10, 26 }; public static FindGameRequest DefaultInstance { get { return defaultInstance; } } public override FindGameRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override FindGameRequest ThisMessage { @@ -1548,7 +1753,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,17 +1763,17 @@ 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; + private ulong objectId_; public bool HasObjectId { get { return hasObjectId; } } @@ -1576,16 +1781,6 @@ public ulong ObjectId { get { return objectId_; } } - 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 global::bnet.protocol.channel.CreateChannelRequest ChannelRequest { - get { return channelRequest_; } - } - public override bool IsInitialized { get { if (!hasObjectId) return false; @@ -1595,29 +1790,24 @@ public override bool IsInitialized { 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); - } - if (HasFactoryId) { - output.WriteFixed64(2, FactoryId); + string[] field_names = _findGameRequestFieldNames; + if (player_.Count > 0) { + output.WriteMessageArray(1, field_names[2], player_); } - if (HasProperties) { - output.WriteMessage(3, Properties); + if (hasFactoryId) { + output.WriteFixed64(2, field_names[0], FactoryId); } - if (HasObjectId) { - output.WriteUInt64(4, ObjectId); + if (hasProperties) { + output.WriteMessage(3, field_names[3], Properties); } - if (HasChannelRequest) { - output.WriteMessage(5, ChannelRequest); + if (hasObjectId) { + output.WriteUInt64(4, field_names[1], ObjectId); } UnknownFields.WriteTo(output); } @@ -1632,18 +1822,15 @@ 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) { + if (hasObjectId) { size += pb::CodedOutputStream.ComputeUInt64Size(4, ObjectId); } - if (HasChannelRequest) { - size += pb::CodedOutputStream.ComputeMessageSize(5, ChannelRequest); - } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -1674,38 +1861,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; + } - FindGameRequest result = new FindGameRequest(); + private bool resultIsReadOnly; + private FindGameRequest result; + + private FindGameRequest PrepareBuilder() { + if (resultIsReadOnly) { + FindGameRequest original = result; + result = new FindGameRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +1939,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 +1957,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; @@ -1749,27 +1970,35 @@ public override Builder MergeFrom(FindGameRequest other) { if (other.HasObjectId) { ObjectId = other.ObjectId; } - if (other.HasChannelRequest) { - MergeChannelRequest(other.ChannelRequest); - } 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 +2010,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 +2031,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 32: { - ObjectId = input.ReadUInt64(); - 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(); + result.hasObjectId = input.ReadUInt64(ref result.objectId_); 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 +2055,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 +2117,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 +2142,51 @@ 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; } + 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 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 Builder SetChannelRequest(global::bnet.protocol.channel.CreateChannelRequest.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasChannelRequest = true; - result.channelRequest_ = builderForValue.Build(); - return this; - } - 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; - return this; - } - public Builder ClearChannelRequest() { - result.hasChannelRequest = false; - result.channelRequest_ = global::bnet.protocol.channel.CreateChannelRequest.DefaultInstance; - return this; - } } static FindGameRequest() { object.ReferenceEquals(global::bnet.protocol.game_master.Proto.GameMaster.Descriptor, 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", "request_id" }; + private static readonly uint[] _findGameResponseFieldTags = new uint[] { 17, 8 }; public static FindGameResponse DefaultInstance { get { return defaultInstance; } } public override FindGameResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override FindGameResponse ThisMessage { @@ -1996,7 +2203,7 @@ protected override FindGameResponse ThisMessage { public const int RequestIdFieldNumber = 1; private bool hasRequestId; - private ulong requestId_ = 0UL; + private ulong requestId_; public bool HasRequestId { get { return hasRequestId; } } @@ -2006,7 +2213,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; } } @@ -2020,13 +2227,14 @@ 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 = _findGameResponseFieldNames; + if (hasRequestId) { + output.WriteUInt64(1, field_names[1], RequestId); } - if (HasFactoryId) { - output.WriteFixed64(2, FactoryId); + if (hasFactoryId) { + output.WriteFixed64(2, field_names[0], FactoryId); } UnknownFields.WriteTo(output); } @@ -2038,10 +2246,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasRequestId) { + if (hasRequestId) { size += pb::CodedOutputStream.ComputeUInt64Size(1, RequestId); } - if (HasFactoryId) { + if (hasFactoryId) { size += pb::CodedOutputStream.ComputeFixed64Size(2, FactoryId); } size += UnknownFields.SerializedSize; @@ -2074,38 +2282,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 +2359,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,6 +2377,7 @@ 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; } @@ -2146,20 +2388,31 @@ public override Builder MergeFrom(FindGameResponse 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(_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,53 +2424,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: { - RequestId = input.ReadUInt64(); + result.hasRequestId = input.ReadUInt64(ref result.requestId_); break; } case 17: { - FactoryId = input.ReadFixed64(); + result.hasFactoryId = input.ReadFixed64(ref result.factoryId_); 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; 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; @@ -2228,14 +2490,20 @@ static FindGameResponse() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class CancelFindGameRequest : pb::GeneratedMessage { - private static readonly CancelFindGameRequest defaultInstance = new Builder().BuildPartial(); + private CancelFindGameRequest() { } + private static readonly CancelFindGameRequest defaultInstance = new CancelFindGameRequest().MakeReadOnly(); + private static readonly string[] _cancelFindGameRequestFieldNames = new string[] { "factory_id", "request_id" }; + private static readonly uint[] _cancelFindGameRequestFieldTags = new uint[] { 9, 16 }; public static CancelFindGameRequest DefaultInstance { get { return defaultInstance; } } public override CancelFindGameRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override CancelFindGameRequest ThisMessage { @@ -2252,7 +2520,7 @@ protected override CancelFindGameRequest ThisMessage { public const int FactoryIdFieldNumber = 1; private bool hasFactoryId; - private ulong factoryId_ = 0; + private ulong factoryId_; public bool HasFactoryId { get { return hasFactoryId; } } @@ -2262,7 +2530,7 @@ public ulong FactoryId { public const int RequestIdFieldNumber = 2; private bool hasRequestId; - private ulong requestId_ = 0UL; + private ulong requestId_; public bool HasRequestId { get { return hasRequestId; } } @@ -2278,13 +2546,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 = _cancelFindGameRequestFieldNames; + if (hasFactoryId) { + output.WriteFixed64(1, field_names[0], FactoryId); } - if (HasRequestId) { - output.WriteUInt64(2, RequestId); + if (hasRequestId) { + output.WriteUInt64(2, field_names[1], RequestId); } UnknownFields.WriteTo(output); } @@ -2296,10 +2565,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasFactoryId) { + if (hasFactoryId) { size += pb::CodedOutputStream.ComputeFixed64Size(1, FactoryId); } - if (HasRequestId) { + if (hasRequestId) { size += pb::CodedOutputStream.ComputeUInt64Size(2, RequestId); } size += UnknownFields.SerializedSize; @@ -2332,38 +2601,72 @@ public static CancelFindGameRequest ParseDelimitedFrom(global::System.IO.Stream 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) { + public static CancelFindGameRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CancelFindGameRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static CancelFindGameRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private CancelFindGameRequest MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(CancelFindGameRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - CancelFindGameRequest result = new CancelFindGameRequest(); + private bool resultIsReadOnly; + private CancelFindGameRequest result; + + private CancelFindGameRequest PrepareBuilder() { + if (resultIsReadOnly) { + CancelFindGameRequest original = result; + result = new CancelFindGameRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override CancelFindGameRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new CancelFindGameRequest(); + 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 { @@ -2375,12 +2678,11 @@ public override CancelFindGameRequest DefaultInstanceForType { } public override CancelFindGameRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - CancelFindGameRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2394,6 +2696,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(CancelFindGameRequest other) { if (other == global::bnet.protocol.game_master.CancelFindGameRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasFactoryId) { FactoryId = other.FactoryId; } @@ -2404,20 +2707,31 @@ public override Builder MergeFrom(CancelFindGameRequest 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(_cancelFindGameRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _cancelFindGameRequestFieldTags[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)) { @@ -2429,53 +2743,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; } case 16: { - RequestId = input.ReadUInt64(); + result.hasRequestId = input.ReadUInt64(ref result.requestId_); 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; } 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; return this; @@ -2486,14 +2809,20 @@ static CancelFindGameRequest() { } } + [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 { @@ -2510,12 +2839,22 @@ protected override GameEndedNotification ThisMessage { 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 +2865,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 +2884,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 +2920,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 +2997,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 +3015,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 +3062,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 +3097,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,8 +3122,29 @@ 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; } } @@ -2726,14 +3153,20 @@ static GameEndedNotification() { } } + [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", "reason", "toon_id" }; + private static readonly uint[] _playerLeftNotificationFieldTags = new uint[] { 10, 24, 18 }; public static PlayerLeftNotification DefaultInstance { get { return defaultInstance; } } public override PlayerLeftNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override PlayerLeftNotification ThisMessage { @@ -2750,27 +3183,27 @@ protected override PlayerLeftNotification ThisMessage { 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; + private global::bnet.protocol.EntityId toonId_; public bool HasToonId { get { return hasToonId; } } public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } + get { return toonId_ ?? 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; } } @@ -2788,16 +3221,17 @@ 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 = _playerLeftNotificationFieldNames; + if (hasGameHandle) { + output.WriteMessage(1, field_names[0], GameHandle); } - if (HasToonId) { - output.WriteMessage(2, ToonId); + if (hasToonId) { + output.WriteMessage(2, field_names[2], ToonId); } - if (HasReason) { - output.WriteUInt32(3, Reason); + if (hasReason) { + output.WriteUInt32(3, field_names[1], Reason); } UnknownFields.WriteTo(output); } @@ -2809,13 +3243,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasGameHandle) { + if (hasGameHandle) { size += pb::CodedOutputStream.ComputeMessageSize(1, GameHandle); } - if (HasToonId) { + if (hasToonId) { size += pb::CodedOutputStream.ComputeMessageSize(2, ToonId); } - if (HasReason) { + if (hasReason) { size += pb::CodedOutputStream.ComputeUInt32Size(3, Reason); } size += UnknownFields.SerializedSize; @@ -2848,38 +3282,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; + } + + private bool resultIsReadOnly; + private PlayerLeftNotification result; + + private PlayerLeftNotification PrepareBuilder() { + if (resultIsReadOnly) { + PlayerLeftNotification original = result; + result = new PlayerLeftNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - PlayerLeftNotification result = new PlayerLeftNotification(); + 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 +3359,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,6 +3377,7 @@ 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); } @@ -2923,20 +3391,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 +3427,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,7 +3441,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { + if (result.hasToonId) { subBuilder.MergeFrom(ToonId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2970,16 +3449,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 HasGameHandle { - get { return result.HasGameHandle; } + get { return result.hasGameHandle; } } public global::bnet.protocol.game_master.GameHandle GameHandle { get { return result.GameHandle; } @@ -2987,19 +3471,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,13 +3496,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 bool HasToonId { - get { return result.HasToonId; } + get { return result.hasToonId; } } public global::bnet.protocol.EntityId ToonId { get { return result.ToonId; } @@ -3023,19 +3511,22 @@ public bool HasToonId { } public Builder SetToonId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToonId = true; result.toonId_ = value; return this; } public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToonId && result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); } else { @@ -3045,26 +3536,29 @@ public Builder MergeToonId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToonId() { + PrepareBuilder(); result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toonId_ = 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; } } @@ -3073,14 +3567,20 @@ static PlayerLeftNotification() { } } + [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 { @@ -3109,17 +3609,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 +3637,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 +3662,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 +3698,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 +3776,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 +3794,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 +3808,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 +3844,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 +3861,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 +3885,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 +3927,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,24 +3952,27 @@ 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; @@ -3422,14 +3983,20 @@ static RegisterServerRequest() { } } + [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 { @@ -3450,8 +4017,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 +4060,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 +4137,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 +4155,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,11 +4196,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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } @@ -3596,14 +4214,20 @@ static UnregisterServerRequest() { } } + [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 { @@ -3632,17 +4256,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 +4284,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 +4309,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 +4345,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 +4423,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 +4441,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 +4455,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 +4491,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 +4508,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 +4532,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 +4574,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,24 +4599,27 @@ 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; @@ -3945,14 +4630,20 @@ static RegisterUtilitiesRequest() { } } + [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 { @@ -3973,8 +4664,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 +4707,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 +4784,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 +4802,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,11 +4843,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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } @@ -4119,14 +4861,20 @@ static UnregisterUtilitiesRequest() { } } + [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 { @@ -4143,7 +4891,7 @@ protected override SubscribeRequest ThisMessage { public const int ObjectIdFieldNumber = 1; private bool hasObjectId; - private ulong objectId_ = 0UL; + private ulong objectId_; public bool HasObjectId { get { return hasObjectId; } } @@ -4158,10 +4906,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 +4922,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 +4955,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 { @@ -4249,12 +5032,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 +5050,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 +5058,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,31 +5094,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; } 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; @@ -4335,14 +5136,20 @@ static SubscribeRequest() { } } + [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 { @@ -4359,7 +5166,7 @@ protected override SubscribeResponse ThisMessage { public const int SubscriptionIdFieldNumber = 1; private bool hasSubscriptionId; - private ulong subscriptionId_ = 0UL; + private ulong subscriptionId_; public bool HasSubscriptionId { get { return hasSubscriptionId; } } @@ -4373,10 +5180,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 +5196,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 +5229,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 +5306,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 +5324,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 +5332,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,31 +5368,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; } 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; @@ -4550,14 +5410,20 @@ static SubscribeResponse() { } } + [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 { @@ -4574,7 +5440,7 @@ protected override UnsubscribeRequest ThisMessage { public const int SubscriptionIdFieldNumber = 1; private bool hasSubscriptionId; - private ulong subscriptionId_ = 0UL; + private ulong subscriptionId_; public bool HasSubscriptionId { get { return hasSubscriptionId; } } @@ -4589,10 +5455,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 +5471,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 +5504,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 +5581,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 +5599,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 +5607,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,31 +5643,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; } 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; @@ -4766,14 +5685,20 @@ static UnsubscribeRequest() { } } + [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 { @@ -4790,17 +5715,17 @@ protected override ChangeGameRequest ThisMessage { 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 +5747,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 +5766,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 +5791,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 +5833,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; + } + + private bool resultIsReadOnly; + private ChangeGameRequest result; + + private ChangeGameRequest PrepareBuilder() { + if (resultIsReadOnly) { + ChangeGameRequest original = result; + result = new ChangeGameRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - ChangeGameRequest result = new ChangeGameRequest(); + 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 +5911,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 +5929,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 +5937,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 +5946,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 +5982,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 +5995,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 +6025,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 +6050,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,46 +6087,54 @@ 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; @@ -5157,14 +6145,20 @@ static ChangeGameRequest() { } } + [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 { @@ -5181,7 +6175,7 @@ protected override GetFactoryInfoRequest ThisMessage { public const int FactoryIdFieldNumber = 1; private bool hasFactoryId; - private ulong factoryId_ = 0; + private ulong factoryId_; public bool HasFactoryId { get { return hasFactoryId; } } @@ -5196,10 +6190,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 +6206,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 +6239,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; + } - GetFactoryInfoRequest result = new GetFactoryInfoRequest(); + private bool resultIsReadOnly; + private GetFactoryInfoRequest result; + + private GetFactoryInfoRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetFactoryInfoRequest original = result; + result = new GetFactoryInfoRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +6316,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 +6334,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 +6342,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,31 +6378,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; } 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; @@ -5373,14 +6420,20 @@ static GetFactoryInfoRequest() { } } + [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 { @@ -5428,13 +6481,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 +6536,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 +6615,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 +6633,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 +6680,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 +6712,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,29 +6756,35 @@ 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; } @@ -5682,14 +6794,20 @@ static GetFactoryInfoResponse() { } } + [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 { @@ -5706,7 +6824,7 @@ protected override GetGameStatsRequest ThisMessage { public const int FactoryIdFieldNumber = 1; private bool hasFactoryId; - private ulong factoryId_ = 0; + private ulong factoryId_; public bool HasFactoryId { get { return hasFactoryId; } } @@ -5716,12 +6834,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 +6851,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 +6870,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 +6906,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 +6983,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 +7001,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 +7012,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 +7048,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 +7066,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 +7103,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,8 +7128,9 @@ 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; } } @@ -5964,14 +7139,20 @@ static GetGameStatsRequest() { } } + [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 { @@ -6004,10 +7185,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 +7234,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 +7312,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 +7330,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 +7374,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,29 +7402,35 @@ 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; } @@ -6204,14 +7440,20 @@ static GetGameStatsResponse() { } } + [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 { @@ -6227,7 +7469,12 @@ protected override FactoryUpdateNotification 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 { ADD = 1, REMOVE = 2, @@ -6249,17 +7496,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 +7523,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 +7545,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 +7584,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; + } - FactoryUpdateNotification result = new FactoryUpdateNotification(); + private bool resultIsReadOnly; + private FactoryUpdateNotification result; + + private FactoryUpdateNotification PrepareBuilder() { + if (resultIsReadOnly) { + FactoryUpdateNotification original = result; + result = new FactoryUpdateNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +7661,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 +7679,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 +7693,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 +7729,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 +7754,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 +7796,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,24 +7821,27 @@ 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; @@ -6546,14 +7852,20 @@ static FactoryUpdateNotification() { } } + [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, 8 }; public static GameFoundNotification DefaultInstance { get { return defaultInstance; } } public override GameFoundNotification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GameFoundNotification ThisMessage { @@ -6570,7 +7882,7 @@ protected override GameFoundNotification ThisMessage { public const int RequestIdFieldNumber = 1; private bool hasRequestId; - private ulong requestId_ = 0UL; + private ulong requestId_; public bool HasRequestId { get { return hasRequestId; } } @@ -6580,7 +7892,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 +7902,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 +7935,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.WriteUInt64(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 +7960,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasRequestId) { + if (hasRequestId) { size += pb::CodedOutputStream.ComputeUInt64Size(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 +8002,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 +8080,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 +8098,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 +8109,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 +8151,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(); + result.hasRequestId = input.ReadUInt64(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 +8172,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; 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 +8234,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 +8259,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,29 +8276,35 @@ 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; } @@ -6942,6 +8317,9 @@ static GameFoundNotification() { #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, @@ -7187,6 +8565,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; @@ -7334,6 +8715,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, @@ -7397,6 +8781,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 +8805,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, @@ -7481,6 +8871,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 +8898,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 69% rename from source/D3Proto/bnet/protocol/game_master/GameMasterTypes.cs rename to src/LibMooNet/bnet/protocol/game_master/GameMasterTypes.cs index 7aedb1e8..7b134c4a 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 @@ -32,30 +37,31 @@ 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"); + "CjZzZXJ2aWNlL2dhbWVfbWFzdGVyL2RlZmluaXRpb24vZ2FtZV9tYXN0ZXJf" + + "dHlwZXMucHJvdG8SGWJuZXQucHJvdG9jb2wuZ2FtZV9tYXN0ZXIaHGxpYi9w" + + "cm90b2NvbC9hdHRyaWJ1dGUucHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHku" + + "cHJvdG8iqQIKBlBsYXllchI6CgR0eXBlGAEgASgOMiYuYm5ldC5wcm90b2Nv" + + "bC5nYW1lX21hc3Rlci5QbGF5ZXIuVHlwZToEVE9PThIoCgd0b29uX2lkGAIg" + + "ASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIwCg9nYW1lX2FjY291bnRf" + + "aWQYAyABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEjAKD2JuZXRfYWNj" + + "b3VudF9pZBgEIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSNQoJYXR0" + + "cmlidXRlGAUgAygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmli" + + "dXRlIh4KBFR5cGUSCAoEVE9PThAAEgwKCENPTVBVVEVSEAEimQEKC0Nvbm5l" + + "Y3RJbmZvEigKB3Rvb25faWQYASACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0" + + "eUlkEgwKBGhvc3QYAiACKAkSDAoEcG9ydBgDIAIoBRINCgV0b2tlbhgEIAEo" + + "DBI1CglhdHRyaWJ1dGUYBSADKAsyIi5ibmV0LnByb3RvY29sLmF0dHJpYnV0" + + "ZS5BdHRyaWJ1dGUi7wEKD0dhbWVTdGF0c0J1Y2tldBIVCgpidWNrZXRfbWlu" + + "GAEgASgCOgEwEiIKCmJ1Y2tldF9tYXgYAiABKAI6DjQuMjk0OTY3M2UrMDA5" + + "EhwKEXdhaXRfbWlsbGlzZWNvbmRzGAMgASgNOgEwEhkKDmdhbWVzX3Blcl9o" + + "b3VyGAQgASgNOgEwEhcKDGFjdGl2ZV9nYW1lcxgFIAEoDToBMBIZCg5hY3Rp" + + "dmVfcGxheWVycxgGIAEoDToBMBIYCg1mb3JtaW5nX2dhbWVzGAcgASgNOgEw" + + "EhoKD3dhaXRpbmdfcGxheWVycxgIIAEoDToBMCKrAQoWR2FtZUZhY3RvcnlE" + + "ZXNjcmlwdGlvbhIKCgJpZBgBIAIoBhIMCgRuYW1lGAIgASgJEjUKCWF0dHJp" + + "YnV0ZRgDIAMoCzIiLmJuZXQucHJvdG9jb2wuYXR0cmlidXRlLkF0dHJpYnV0" + + "ZRJACgxzdGF0c19idWNrZXQYBCADKAsyKi5ibmV0LnByb3RvY29sLmdhbWVf" + + "bWFzdGVyLkdhbWVTdGF0c0J1Y2tldCJKCgpHYW1lSGFuZGxlEhIKCmZhY3Rv" + + "cnlfaWQYASACKAYSKAoHZ2FtZV9pZBgCIAIoCzIXLmJuZXQucHJvdG9jb2wu" + + "RW50aXR5SWQ="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_game_master_Player__Descriptor = Descriptor.MessageTypes[0]; @@ -90,14 +96,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", "bnet_account_id", "game_account_id", "toon_id", "type" }; + private static readonly uint[] _playerFieldTags = new uint[] { 42, 34, 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,7 +125,12 @@ 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, COMPUTER = 1, @@ -134,32 +151,32 @@ public bool HasType { public const int ToonIdFieldNumber = 2; private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId toonId_; public bool HasToonId { get { return hasToonId; } } public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } + get { return toonId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int GameAccountIdFieldNumber = 3; private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId gameAccountId_; public bool HasGameAccountId { get { return hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int BnetAccountIdFieldNumber = 4; private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId bnetAccountId_; public bool HasBnetAccountId { get { return hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } + get { return bnetAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int AttributeFieldNumber = 5; @@ -192,22 +209,23 @@ 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); + string[] field_names = _playerFieldNames; + if (hasType) { + output.WriteEnum(1, field_names[4], (int) Type, Type); } - if (HasToonId) { - output.WriteMessage(2, ToonId); + if (hasToonId) { + output.WriteMessage(2, field_names[3], ToonId); } - if (HasGameAccountId) { - output.WriteMessage(3, GameAccountId); + if (hasGameAccountId) { + output.WriteMessage(3, field_names[2], GameAccountId); } - if (HasBnetAccountId) { - output.WriteMessage(4, BnetAccountId); + if (hasBnetAccountId) { + output.WriteMessage(4, field_names[1], BnetAccountId); } - 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); } @@ -219,16 +237,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasType) { + if (hasType) { size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Type); } - if (HasToonId) { + if (hasToonId) { size += pb::CodedOutputStream.ComputeMessageSize(2, ToonId); } - if (HasGameAccountId) { + if (hasGameAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(3, GameAccountId); } - if (HasBnetAccountId) { + if (hasBnetAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(4, BnetAccountId); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { @@ -264,38 +282,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; + } - Player result = new Player(); + private bool resultIsReadOnly; + private Player result; + + private Player PrepareBuilder() { + if (resultIsReadOnly) { + Player original = result; + result = new Player(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +360,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,6 +378,7 @@ 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; } @@ -340,26 +392,37 @@ public override Builder MergeFrom(Player other) { MergeBnetAccountId(other.BnetAccountId); } 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,24 +434,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.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) { + if (result.hasToonId) { subBuilder.MergeFrom(ToonId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -397,7 +460,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { + if (result.hasGameAccountId) { subBuilder.MergeFrom(GameAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -406,7 +469,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 34: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccountId) { + if (result.hasBnetAccountId) { subBuilder.MergeFrom(BnetAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -414,36 +477,41 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis 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; } + get { return result.hasToonId; } } public global::bnet.protocol.EntityId ToonId { get { return result.ToonId; } @@ -451,19 +519,22 @@ public bool HasToonId { } public Builder SetToonId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToonId = true; result.toonId_ = value; return this; } public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToonId && result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); } else { @@ -473,13 +544,14 @@ public Builder MergeToonId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToonId() { + PrepareBuilder(); result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toonId_ = null; return this; } public bool HasGameAccountId { - get { return result.HasGameAccountId; } + get { return result.hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { get { return result.GameAccountId; } @@ -487,19 +559,22 @@ public bool HasGameAccountId { } 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"); - if (result.HasGameAccountId && + PrepareBuilder(); + if (result.hasGameAccountId && result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -509,13 +584,14 @@ public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearGameAccountId() { + PrepareBuilder(); result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.gameAccountId_ = null; return this; } public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } + get { return result.hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { get { return result.BnetAccountId; } @@ -523,19 +599,22 @@ public bool HasBnetAccountId { } 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"); - if (result.HasBnetAccountId && + PrepareBuilder(); + if (result.hasBnetAccountId && result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -545,13 +624,14 @@ public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearBnetAccountId() { + PrepareBuilder(); result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.bnetAccountId_ = null; return this; } public pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -561,29 +641,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 +679,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", "port", "token", "toon_id" }; + private static readonly uint[] _connectInfoFieldTags = new uint[] { 42, 18, 24, 34, 10 }; public static ConnectInfo DefaultInstance { get { return defaultInstance; } } public override ConnectInfo DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ConnectInfo ThisMessage { @@ -617,12 +709,12 @@ protected override ConnectInfo ThisMessage { public const int ToonIdFieldNumber = 1; private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId toonId_; public bool HasToonId { get { return hasToonId; } } public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } + get { return toonId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int HostFieldNumber = 2; @@ -637,7 +729,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; } } @@ -680,22 +772,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 (hasToonId) { + output.WriteMessage(1, field_names[4], ToonId); } - 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[2], Port); } - if (HasToken) { - output.WriteBytes(4, Token); + if (hasToken) { + output.WriteBytes(4, field_names[3], 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 +800,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasToonId) { + if (hasToonId) { size += pb::CodedOutputStream.ComputeMessageSize(1, ToonId); } - 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 +845,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 +923,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,6 +941,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ConnectInfo other) { if (other == global::bnet.protocol.game_master.ConnectInfo.DefaultInstance) return this; + PrepareBuilder(); if (other.HasToonId) { MergeToonId(other.ToonId); } @@ -828,26 +955,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,12 +997,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 (HasToonId) { + if (result.hasToonId) { subBuilder.MergeFrom(ToonId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -872,30 +1010,33 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis 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; } + get { return result.hasToonId; } } public global::bnet.protocol.EntityId ToonId { get { return result.ToonId; } @@ -903,19 +1044,22 @@ public bool HasToonId { } public Builder SetToonId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToonId = true; result.toonId_ = value; return this; } public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToonId && result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); } else { @@ -925,13 +1069,14 @@ public Builder MergeToonId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToonId() { + PrepareBuilder(); result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toonId_ = null; return this; } public bool HasHost { - get { return result.HasHost; } + get { return result.hasHost; } } public string Host { get { return result.Host; } @@ -939,36 +1084,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 +1125,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 +1148,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 +1186,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 +1216,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 +1236,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 +1246,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 +1256,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 +1266,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 +1276,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 +1286,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 +1300,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 +1337,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 +1391,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 +1468,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 +1486,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 +1515,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 +1551,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 +1761,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" }; + private static readonly uint[] _gameFactoryDescriptionFieldTags = new uint[] { 26, 9, 18, 34 }; public static GameFactoryDescription DefaultInstance { get { return defaultInstance; } } public override GameFactoryDescription DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GameFactoryDescription ThisMessage { @@ -1555,7 +1791,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; } } @@ -1607,19 +1843,20 @@ 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, Name); + if (hasName) { + output.WriteString(2, field_names[2], Name); } - foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { - output.WriteMessage(3, element); + if (attribute_.Count > 0) { + output.WriteMessageArray(3, field_names[0], attribute_); } - foreach (global::bnet.protocol.game_master.GameStatsBucket element in StatsBucketList) { - output.WriteMessage(4, element); + if (statsBucket_.Count > 0) { + output.WriteMessageArray(4, field_names[3], statsBucket_); } UnknownFields.WriteTo(output); } @@ -1631,10 +1868,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) { @@ -1673,38 +1910,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; + } - GameFactoryDescription result = new GameFactoryDescription(); + private bool resultIsReadOnly; + private GameFactoryDescription result; + + 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 +1989,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 +2007,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 +2015,40 @@ 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_); } 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 +2060,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 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; } } } + + 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 +2118,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 +2141,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,29 +2185,35 @@ 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; } @@ -1924,14 +2223,20 @@ static GameFactoryDescription() { } } + [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 +2253,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 +2263,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 +2280,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 +2299,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 +2335,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; + } + + private bool resultIsReadOnly; + private GameHandle result; + + private GameHandle PrepareBuilder() { + if (resultIsReadOnly) { + GameHandle original = result; + result = new GameHandle(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - GameHandle result = new GameHandle(); + 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 +2412,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 +2430,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 +2441,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 +2477,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 +2495,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 +2532,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 +2557,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; } } @@ -2209,3 +2571,5 @@ static GameHandle() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/game_utilities/GameUtilities.cs b/src/LibMooNet/bnet/protocol/game_utilities/GameUtilities.cs similarity index 63% rename from source/D3Proto/bnet/protocol/game_utilities/GameUtilities.cs rename to src/LibMooNet/bnet/protocol/game_utilities/GameUtilities.cs index 4e373a7e..a82837eb 100644 --- a/source/D3Proto/bnet/protocol/game_utilities/GameUtilities.cs +++ b/src/LibMooNet/bnet/protocol/game_utilities/GameUtilities.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.game_utilities { 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 GameUtilities { #region Extension registration @@ -19,10 +24,12 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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_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; @@ -48,79 +55,93 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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" + + "CjZzZXJ2aWNlL2dhbWVfdXRpbGl0aWVzL2RlZmluaXRpb24vZ2FtZV91dGls" + + "aXRpZXMucHJvdG8SHGJuZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMaMHNl" + + "cnZpY2UvZ2FtZV9tYXN0ZXIvZGVmaW5pdGlvbi9nYW1lX21hc3Rlci5wcm90" + + "bxowc2VydmljZS9zZXJ2ZXJfcG9vbC9kZWZpbml0aW9uL3NlcnZlcl9wb29s" + + "LnByb3RvGiJzZXJ2aWNlL3Rvb24vZGVmaW5pdGlvbi90b29uLnByb3RvGhxs" + + "aWIvcHJvdG9jb2wvYXR0cmlidXRlLnByb3RvGhlsaWIvcHJvdG9jb2wvZW50" + + "aXR5LnByb3RvGhFsaWIvcnBjL3JwYy5wcm90byL8AQoNQ2xpZW50UmVxdWVz" + + "dBI1CglhdHRyaWJ1dGUYASADKAsyIi5ibmV0LnByb3RvY29sLmF0dHJpYnV0" + + "ZS5BdHRyaWJ1dGUSJgoEaG9zdBgCIAEoCzIYLmJuZXQucHJvdG9jb2wuUHJv" + + "Y2Vzc0lkEjAKD2JuZXRfYWNjb3VudF9pZBgDIAEoCzIXLmJuZXQucHJvdG9j" + + "b2wuRW50aXR5SWQSMAoPZ2FtZV9hY2NvdW50X2lkGAQgASgLMhcuYm5ldC5w" + + "cm90b2NvbC5FbnRpdHlJZBIoCgd0b29uX2lkGAUgASgLMhcuYm5ldC5wcm90" + + "b2NvbC5FbnRpdHlJZCJHCg5DbGllbnRSZXNwb25zZRI1CglhdHRyaWJ1dGUY" + + "ASADKAsyIi5ibmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUifwoN" + + "U2VydmVyUmVxdWVzdBI1CglhdHRyaWJ1dGUYASADKAsyIi5ibmV0LnByb3Rv" + + "Y29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUSDwoHcHJvZ3JhbRgCIAIoBxImCgRo" + + "b3N0GAMgASgLMhguYm5ldC5wcm90b2NvbC5Qcm9jZXNzSWQiRwoOU2VydmVy" + + "UmVzcG9uc2USNQoJYXR0cmlidXRlGAEgAygLMiIuYm5ldC5wcm90b2NvbC5h" + + "dHRyaWJ1dGUuQXR0cmlidXRlIp0CChFDcmVhdGVUb29uUmVxdWVzdBIwCg9i" + + "bmV0X2FjY291bnRfaWQYASACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlk" + + "EjAKD2dhbWVfYWNjb3VudF9pZBgCIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50" + + "aXR5SWQSDAoEbmFtZRgEIAIoCRI1CglhdHRyaWJ1dGUYBSADKAsyIi5ibmV0" + + "LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUSJgoEaG9zdBgGIAEoCzIY" + + "LmJuZXQucHJvdG9jb2wuUHJvY2Vzc0lkEg0KBXRva2VuGAcgAigNEigKBnNl" + + "bmRlchgIIAIoCzIYLmJuZXQucHJvdG9jb2wuUHJvY2Vzc0lkIskBChFEZWxl" + + "dGVUb29uUmVxdWVzdBIwCg9ibmV0X2FjY291bnRfaWQYASABKAsyFy5ibmV0" + + "LnByb3RvY29sLkVudGl0eUlkEjAKD2dhbWVfYWNjb3VudF9pZBgCIAEoCzIX" + + "LmJuZXQucHJvdG9jb2wuRW50aXR5SWQSKAoHdG9vbl9pZBgDIAIoCzIXLmJu" + + "ZXQucHJvdG9jb2wuRW50aXR5SWQSJgoEaG9zdBgEIAEoCzIYLmJuZXQucHJv" + + "dG9jb2wuUHJvY2Vzc0lkIuwCChNUcmFuc2ZlclRvb25SZXF1ZXN0EigKB3Rv" + + "b25faWQYASACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEkkKBnNvdXJj" + + "ZRgCIAEoCzI5LmJuZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMuVHJhbnNm" + + "ZXJUb29uUmVxdWVzdC5BY2NvdW50EkkKBnRhcmdldBgDIAEoCzI5LmJuZXQu" + + "cHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMuVHJhbnNmZXJUb29uUmVxdWVzdC5B" + + "Y2NvdW50EiYKBGhvc3QYBCABKAsyGC5ibmV0LnByb3RvY29sLlByb2Nlc3NJ" + + "ZBptCgdBY2NvdW50EjAKD2JuZXRfYWNjb3VudF9pZBgBIAIoCzIXLmJuZXQu" + + "cHJvdG9jb2wuRW50aXR5SWQSMAoPZ2FtZV9hY2NvdW50X2lkGAIgAigLMhcu" + + "Ym5ldC5wcm90b2NvbC5FbnRpdHlJZCLJAQoRU2VsZWN0VG9vblJlcXVlc3QS" + + "MAoPYm5ldF9hY2NvdW50X2lkGAEgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRp" + + "dHlJZBIwCg9nYW1lX2FjY291bnRfaWQYAiACKAsyFy5ibmV0LnByb3RvY29s" + + "LkVudGl0eUlkEigKB3Rvb25faWQYAyACKAsyFy5ibmV0LnByb3RvY29sLkVu" + + "dGl0eUlkEiYKBGhvc3QYBCABKAsyGC5ibmV0LnByb3RvY29sLlByb2Nlc3NJ" + + "ZCL6AQodUHJlc2VuY2VDaGFubmVsQ3JlYXRlZFJlcXVlc3QSIwoCaWQYASAC" + + "KAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEigKB3Rvb25faWQYAiABKAsy" + + "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkEjAKD2dhbWVfYWNjb3VudF9pZBgD" + + "IAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSMAoPYm5ldF9hY2NvdW50" + + "X2lkGAQgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBImCgRob3N0GAUg" + + "ASgLMhguYm5ldC5wcm90b2NvbC5Qcm9jZXNzSWQi4AEKFlBsYXllclZhcmlh" + + "Ymxlc1JlcXVlc3QSMAoPYm5ldF9hY2NvdW50X2lkGAEgAigLMhcuYm5ldC5w" + + "cm90b2NvbC5FbnRpdHlJZBIwCg9nYW1lX2FjY291bnRfaWQYAiACKAsyFy5i" + + "bmV0LnByb3RvY29sLkVudGl0eUlkEigKB3Rvb25faWQYAyACKAsyFy5ibmV0" + + "LnByb3RvY29sLkVudGl0eUlkEhAKCHZhcmlhYmxlGAQgAygJEiYKBGhvc3QY" + + "BSABKAsyGC5ibmV0LnByb3RvY29sLlByb2Nlc3NJZCKHAQoUR2FtZVZhcmlh" + + "Ymxlc1JlcXVlc3QSNQoJYXR0cmlidXRlGAEgAygLMiIuYm5ldC5wcm90b2Nv" + + "bC5hdHRyaWJ1dGUuQXR0cmlidXRlEhAKCHZhcmlhYmxlGAIgAygJEiYKBGhv" + + "c3QYAyABKAsyGC5ibmV0LnByb3RvY29sLlByb2Nlc3NJZCImChFWYXJpYWJs" + + "ZXNSZXNwb25zZRIRCgV2YWx1ZRgBIAMoAkICEAEyqwoKDUdhbWVVdGlsaXRp" + + "ZXMSdwoUUHJvY2Vzc0NsaWVudFJlcXVlc3QSKy5ibmV0LnByb3RvY29sLmdh" + + "bWVfdXRpbGl0aWVzLkNsaWVudFJlcXVlc3QaLC5ibmV0LnByb3RvY29sLmdh" + + "bWVfdXRpbGl0aWVzLkNsaWVudFJlc3BvbnNlIgSAtRgBEloKCkNyZWF0ZVRv" + + "b24SLy5ibmV0LnByb3RvY29sLmdhbWVfdXRpbGl0aWVzLkNyZWF0ZVRvb25S" + + "ZXF1ZXN0GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAISWgoKRGVsZXRl" + + "VG9vbhIvLmJuZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMuRGVsZXRlVG9v" + + "blJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYAxJeCgxUcmFu" + + "c2ZlclRvb24SMS5ibmV0LnByb3RvY29sLmdhbWVfdXRpbGl0aWVzLlRyYW5z" + + "ZmVyVG9vblJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYBBJa" + + "CgpTZWxlY3RUb29uEi8uYm5ldC5wcm90b2NvbC5nYW1lX3V0aWxpdGllcy5T" + + "ZWxlY3RUb29uUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgF" + + "EnIKFlByZXNlbmNlQ2hhbm5lbENyZWF0ZWQSOy5ibmV0LnByb3RvY29sLmdh" + + "bWVfdXRpbGl0aWVzLlByZXNlbmNlQ2hhbm5lbENyZWF0ZWRSZXF1ZXN0GhUu" + + "Ym5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAYSgQEKEkdldFBsYXllclZhcmlh" + + "YmxlcxI0LmJuZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMuUGxheWVyVmFy" + + "aWFibGVzUmVxdWVzdBovLmJuZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMu" + + "VmFyaWFibGVzUmVzcG9uc2UiBIC1GAcSfQoQR2V0R2FtZVZhcmlhYmxlcxIy" + "LmJuZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMuR2FtZVZhcmlhYmxlc1Jl" + "cXVlc3QaLy5ibmV0LnByb3RvY29sLmdhbWVfdXRpbGl0aWVzLlZhcmlhYmxl" + - "c1Jlc3BvbnNlElwKB0dldExvYWQSKS5ibmV0LnByb3RvY29sLnNlcnZlcl9w" + - "b29sLkdldExvYWRSZXF1ZXN0GiYuYm5ldC5wcm90b2NvbC5zZXJ2ZXJfcG9v" + - "bC5TZXJ2ZXJTdGF0ZUIRQgxDR2FtZVV0aWxpZXOAAQE="); + "c1Jlc3BvbnNlIgSAtRgIEmIKB0dldExvYWQSKS5ibmV0LnByb3RvY29sLnNl" + + "cnZlcl9wb29sLkdldExvYWRSZXF1ZXN0GiYuYm5ldC5wcm90b2NvbC5zZXJ2" + + "ZXJfcG9vbC5TZXJ2ZXJTdGF0ZSIEgLUYCRJzChBDcmVhdGVUb29uRW50aXR5" + + "EisuYm5ldC5wcm90b2NvbC50b29uLkNyZWF0ZVRvb25FbnRpdHlSZXF1ZXN0" + + "GiwuYm5ldC5wcm90b2NvbC50b29uLkNyZWF0ZVRvb25FbnRpdHlSZXNwb25z" + + "ZSIEgLUYChJkChRGaW5hbGl6ZVRvb25DcmVhdGlvbhIvLmJuZXQucHJvdG9j" + + "b2wudG9vbi5GaW5hbGl6ZVRvb25DcmVhdGlvblJlcXVlc3QaFS5ibmV0LnBy" + + "b3RvY29sLk5vRGF0YSIEgLUYCxJ3ChRQcm9jZXNzU2VydmVyUmVxdWVzdBIr" + + "LmJuZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMuU2VydmVyUmVxdWVzdBos" + + "LmJuZXQucHJvdG9jb2wuZ2FtZV91dGlsaXRpZXMuU2VydmVyUmVzcG9uc2Ui" + + "BIC1GAxCA4ABAA=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_game_utilities_ClientRequest__Descriptor = Descriptor.MessageTypes[0]; @@ -131,19 +152,23 @@ static GameUtilities() { 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_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_CreateToonRequest__Descriptor = Descriptor.MessageTypes[4]; 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]; + new string[] { "BnetAccountId", "GameAccountId", "Name", "Attribute", "Host", "Token", "Sender", }); + internal__static_bnet_protocol_game_utilities_DeleteToonRequest__Descriptor = Descriptor.MessageTypes[5]; 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__Descriptor = Descriptor.MessageTypes[6]; 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", }); @@ -151,32 +176,41 @@ static GameUtilities() { 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__Descriptor = Descriptor.MessageTypes[7]; 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__Descriptor = Descriptor.MessageTypes[8]; 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__Descriptor = Descriptor.MessageTypes[9]; 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__Descriptor = Descriptor.MessageTypes[10]; 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__Descriptor = Descriptor.MessageTypes[11]; 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; + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.game_master.Proto.GameMaster.RegisterAllExtensions(registry); + global::bnet.protocol.server_pool.ServerPool.RegisterAllExtensions(registry); + global::bnet.protocol.toon.Toon.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.Proto.GameMaster.Descriptor, global::bnet.protocol.server_pool.ServerPool.Descriptor, + global::bnet.protocol.toon.Toon.Descriptor, global::bnet.protocol.attribute.Proto.Attribute.Descriptor, global::bnet.protocol.Entity.Descriptor, global::bnet.protocol.Rpc.Descriptor, @@ -187,14 +221,20 @@ static GameUtilities() { } } #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 static readonly ClientRequest defaultInstance = new Builder().BuildPartial(); + 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", "toon_id" }; + private static readonly uint[] _clientRequestFieldTags = new uint[] { 10, 26, 34, 18, 42 }; public static ClientRequest DefaultInstance { get { return defaultInstance; } } public override ClientRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ClientRequest ThisMessage { @@ -223,42 +263,42 @@ public int AttributeCount { public const int HostFieldNumber = 2; 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 BnetAccountIdFieldNumber = 3; private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId bnetAccountId_; public bool HasBnetAccountId { get { return hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } + get { return bnetAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int GameAccountIdFieldNumber = 4; private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId gameAccountId_; public bool HasGameAccountId { get { return hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ToonIdFieldNumber = 5; private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId toonId_; public bool HasToonId { get { return hasToonId; } } public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } + get { return toonId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -282,22 +322,23 @@ 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 = _clientRequestFieldNames; + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); } - if (HasHost) { - output.WriteMessage(2, Host); + if (hasHost) { + output.WriteMessage(2, field_names[3], Host); } - if (HasBnetAccountId) { - output.WriteMessage(3, BnetAccountId); + if (hasBnetAccountId) { + output.WriteMessage(3, field_names[1], BnetAccountId); } - if (HasGameAccountId) { - output.WriteMessage(4, GameAccountId); + if (hasGameAccountId) { + output.WriteMessage(4, field_names[2], GameAccountId); } - if (HasToonId) { - output.WriteMessage(5, ToonId); + if (hasToonId) { + output.WriteMessage(5, field_names[4], ToonId); } UnknownFields.WriteTo(output); } @@ -312,16 +353,16 @@ public override int SerializedSize { foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasHost) { + if (hasHost) { size += pb::CodedOutputStream.ComputeMessageSize(2, Host); } - if (HasBnetAccountId) { + if (hasBnetAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(3, BnetAccountId); } - if (HasGameAccountId) { + if (hasGameAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(4, GameAccountId); } - if (HasToonId) { + if (hasToonId) { size += pb::CodedOutputStream.ComputeMessageSize(5, ToonId); } size += UnknownFields.SerializedSize; @@ -354,38 +395,73 @@ public static ClientRequest ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static ClientRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ClientRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - ClientRequest result = new ClientRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ClientRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ClientRequest(); + 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 { @@ -397,13 +473,11 @@ public override ClientRequest DefaultInstanceForType { } public override ClientRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - ClientRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -417,8 +491,9 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ClientRequest other) { if (other == global::bnet.protocol.game_utilities.ClientRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + result.attribute_.Add(other.attribute_); } if (other.HasHost) { MergeHost(other.Host); @@ -436,20 +511,31 @@ public override Builder MergeFrom(ClientRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -461,18 +547,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.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { + if (result.hasHost) { subBuilder.MergeFrom(Host); } input.ReadMessage(subBuilder, extensionRegistry); @@ -481,7 +565,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccountId) { + if (result.hasBnetAccountId) { subBuilder.MergeFrom(BnetAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -490,7 +574,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 34: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { + if (result.hasGameAccountId) { subBuilder.MergeFrom(GameAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -499,7 +583,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 42: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { + if (result.hasToonId) { subBuilder.MergeFrom(ToonId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -508,11 +592,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + 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; } @@ -522,35 +611,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 HasHost { - get { return result.HasHost; } + get { return result.hasHost; } } public global::bnet.protocol.ProcessId Host { get { return result.Host; } @@ -558,19 +653,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 { @@ -580,13 +678,14 @@ 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 HasBnetAccountId { - get { return result.HasBnetAccountId; } + get { return result.hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { get { return result.BnetAccountId; } @@ -594,19 +693,22 @@ public bool HasBnetAccountId { } 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"); - if (result.HasBnetAccountId && + PrepareBuilder(); + if (result.hasBnetAccountId && result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -616,13 +718,14 @@ public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearBnetAccountId() { + PrepareBuilder(); result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.bnetAccountId_ = null; return this; } public bool HasGameAccountId { - get { return result.HasGameAccountId; } + get { return result.hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { get { return result.GameAccountId; } @@ -630,19 +733,22 @@ public bool HasGameAccountId { } 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"); - if (result.HasGameAccountId && + PrepareBuilder(); + if (result.hasGameAccountId && result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -652,13 +758,14 @@ public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearGameAccountId() { + PrepareBuilder(); result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.gameAccountId_ = null; return this; } public bool HasToonId { - get { return result.HasToonId; } + get { return result.hasToonId; } } public global::bnet.protocol.EntityId ToonId { get { return result.ToonId; } @@ -666,19 +773,22 @@ public bool HasToonId { } public Builder SetToonId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToonId = true; result.toonId_ = value; return this; } public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToonId && result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); } else { @@ -688,8 +798,9 @@ public Builder MergeToonId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToonId() { + PrepareBuilder(); result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toonId_ = null; return this; } } @@ -698,14 +809,20 @@ static ClientRequest() { } } + [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 static readonly ClientResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override ClientResponse ThisMessage { @@ -741,10 +858,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.attribute.Attribute element in AttributeList) { - output.WriteMessage(1, element); + string[] field_names = _clientResponseFieldNames; + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); } UnknownFields.WriteTo(output); } @@ -789,38 +907,73 @@ public static ClientResponse ParseDelimitedFrom(global::System.IO.Stream input) 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) { + public static ClientResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ClientResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - ClientResponse result = new ClientResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ClientResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ClientResponse(); + 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 { @@ -832,13 +985,11 @@ public override ClientResponse DefaultInstanceForType { } public override ClientResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - ClientResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -852,27 +1003,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ClientResponse other) { if (other == global::bnet.protocol.game_utilities.ClientResponse.DefaultInstance) return this; + PrepareBuilder(); 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -884,22 +1047,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.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 pbc::IPopsicleList AttributeList { - get { return result.attribute_; } + get { return PrepareBuilder().attribute_; } } public int AttributeCount { get { return result.AttributeCount; } @@ -909,29 +1075,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; } @@ -941,69 +1113,35 @@ static ClientResponse() { } } - public sealed partial class CreateToonRequest : pb::GeneratedMessage { - private static readonly CreateToonRequest defaultInstance = new Builder().BuildPartial(); - public static CreateToonRequest DefaultInstance { + [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 CreateToonRequest DefaultInstanceForType { - get { return defaultInstance; } + public override ServerRequest DefaultInstanceForType { + get { return DefaultInstance; } } - protected override CreateToonRequest ThisMessage { + protected override ServerRequest 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_; } + get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_ServerRequest__Descriptor; } } - public const int NameFieldNumber = 4; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } - } - public string Name { - get { return name_; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_ServerRequest__FieldAccessorTable; } } - public const int AttributeFieldNumber = 5; + public const int AttributeFieldNumber = 1; private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); public scg::IList AttributeList { get { return attribute_; } @@ -1015,25 +1153,29 @@ public int AttributeCount { return attribute_[index]; } - public const int HostFieldNumber = 6; + 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_ = 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 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; + if (!hasProgram) return false; foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { if (!element.IsInitialized) return false; } @@ -1044,25 +1186,17 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasBnetAccountId) { - output.WriteMessage(1, BnetAccountId); - } - if (HasGameAccountId) { - output.WriteMessage(2, GameAccountId); + string[] field_names = _serverRequestFieldNames; + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); } - if (HasToonId) { - output.WriteMessage(3, ToonId); + if (hasProgram) { + output.WriteFixed32(2, field_names[2], Program); } - 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); + if (hasHost) { + output.WriteMessage(3, field_names[1], Host); } UnknownFields.WriteTo(output); } @@ -1074,23 +1208,14 @@ public override int SerializedSize { 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); + size += pb::CodedOutputStream.ComputeMessageSize(1, element); } - if (HasHost) { - size += pb::CodedOutputStream.ComputeMessageSize(6, Host); + if (hasProgram) { + size += pb::CodedOutputStream.ComputeFixed32Size(2, Program); + } + if (hasHost) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Host); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -1098,107 +1223,132 @@ public override int SerializedSize { } } - public static CreateToonRequest ParseFrom(pb::ByteString data) { + public static ServerRequest ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static CreateToonRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static ServerRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static CreateToonRequest ParseFrom(byte[] data) { + public static ServerRequest ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static CreateToonRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static ServerRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static CreateToonRequest ParseFrom(global::System.IO.Stream input) { + public static ServerRequest ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CreateToonRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static ServerRequest 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) { + public static ServerRequest ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static CreateToonRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static ServerRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static CreateToonRequest ParseFrom(pb::CodedInputStream input) { + public static ServerRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CreateToonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(CreateToonRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(ServerRequest 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(ServerRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - CreateToonRequest result = new CreateToonRequest(); + private bool resultIsReadOnly; + private ServerRequest result; - protected override CreateToonRequest MessageBeingBuilt { - get { return 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 = new CreateToonRequest(); + 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.game_utilities.CreateToonRequest.Descriptor; } + get { return global::bnet.protocol.game_utilities.ServerRequest.Descriptor; } } - public override CreateToonRequest DefaultInstanceForType { - get { return global::bnet.protocol.game_utilities.CreateToonRequest.DefaultInstance; } + public override ServerRequest DefaultInstanceForType { + get { return global::bnet.protocol.game_utilities.ServerRequest.DefaultInstance; } } - public override CreateToonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override ServerRequest BuildPartial() { + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - CreateToonRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is CreateToonRequest) { - return MergeFrom((CreateToonRequest) other); + if (other is ServerRequest) { + return MergeFrom((ServerRequest) 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; - } + public override Builder MergeFrom(ServerRequest other) { + if (other == global::bnet.protocol.game_utilities.ServerRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + result.attribute_.Add(other.attribute_); + } + if (other.HasProgram) { + Program = other.Program; } if (other.HasHost) { MergeHost(other.Host); @@ -1207,20 +1357,31 @@ public override Builder MergeFrom(CreateToonRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1232,49 +1393,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.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccountId) { - subBuilder.MergeFrom(BnetAccountId); - } - input.ReadMessage(subBuilder, extensionRegistry); - BnetAccountId = subBuilder.BuildPartial(); + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); 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(); + case 21: { + result.hasProgram = input.ReadFixed32(ref result.program_); 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) { + if (result.hasHost) { subBuilder.MergeFrom(Host); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1283,176 +1415,80 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } - public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } + public pbc::IPopsicleList AttributeList { + get { return PrepareBuilder().attribute_; } } - public global::bnet.protocol.EntityId BnetAccountId { - get { return result.BnetAccountId; } - set { SetBnetAccountId(value); } + public int AttributeCount { + get { return result.AttributeCount; } } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId value) { + 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.hasBnetAccountId = true; - result.bnetAccountId_ = value; + PrepareBuilder(); + result.attribute_[index] = value; return this; } - public Builder SetBnetAccountId(global::bnet.protocol.EntityId.Builder builderForValue) { + public Builder SetAttribute(int index, global::bnet.protocol.attribute.Attribute.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBnetAccountId = true; - result.bnetAccountId_ = builderForValue.Build(); + PrepareBuilder(); + result.attribute_[index] = builderForValue.Build(); return this; } - public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { + public Builder AddAttribute(global::bnet.protocol.attribute.Attribute 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; + PrepareBuilder(); + result.attribute_.Add(value); return this; } - public Builder ClearBnetAccountId() { - result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + 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 HasGameAccountId { - get { return result.HasGameAccountId; } + public bool HasProgram { + get { return result.hasProgram; } } - public global::bnet.protocol.EntityId GameAccountId { - get { return result.GameAccountId; } - set { SetGameAccountId(value); } + public uint Program { + get { return result.Program; } + set { SetProgram(value); } } - public Builder SetGameAccountId(global::bnet.protocol.EntityId value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasGameAccountId = true; - result.gameAccountId_ = value; + public Builder SetProgram(uint value) { + PrepareBuilder(); + result.hasProgram = true; + result.program_ = 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(); + public Builder ClearProgram() { + PrepareBuilder(); + result.hasProgram = false; + result.program_ = 0; return this; } public bool HasHost { - get { return result.HasHost; } + get { return result.hasHost; } } public global::bnet.protocol.ProcessId Host { get { return result.Host; } @@ -1460,19 +1496,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 { @@ -1482,58 +1521,71 @@ 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; } } - static CreateToonRequest() { + static ServerRequest() { 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 { + [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 CreateToonResponse DefaultInstanceForType { - get { return defaultInstance; } + public override ServerResponse DefaultInstanceForType { + get { return DefaultInstance; } } - protected override CreateToonResponse ThisMessage { + protected override ServerResponse 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; } + get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_ServerResponse__Descriptor; } } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_CreateToonResponse__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.game_utilities.Proto.GameUtilities.internal__static_bnet_protocol_game_utilities_ServerResponse__FieldAccessorTable; } } - public const int NameFieldNumber = 1; - private bool hasName; - private string name_ = ""; - public bool HasName { - get { return hasName; } + public const int AttributeFieldNumber = 1; + private pbc::PopsicleList attribute_ = new pbc::PopsicleList(); + public scg::IList AttributeList { + get { return attribute_; } } - public string Name { - get { return name_; } + 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) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasName) { - output.WriteString(1, Name); + string[] field_names = _serverResponseFieldNames; + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); } UnknownFields.WriteTo(output); } @@ -1545,8 +1597,8 @@ public override int SerializedSize { 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(1, element); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -1554,113 +1606,159 @@ public override int SerializedSize { } } - public static CreateToonResponse ParseFrom(pb::ByteString data) { + public static ServerResponse ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static CreateToonResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static ServerResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static CreateToonResponse ParseFrom(byte[] data) { + public static ServerResponse ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static CreateToonResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static ServerResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static CreateToonResponse ParseFrom(global::System.IO.Stream input) { + public static ServerResponse ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CreateToonResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static ServerResponse 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) { + public static ServerResponse ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static CreateToonResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static ServerResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static CreateToonResponse ParseFrom(pb::CodedInputStream input) { + public static ServerResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CreateToonResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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(CreateToonResponse prototype) { - return (Builder) new Builder().MergeFrom(prototype); + public static Builder CreateBuilder(ServerResponse 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(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; + } - CreateToonResponse result = new CreateToonResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } - protected override CreateToonResponse MessageBeingBuilt { - get { return result; } + protected override ServerResponse MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new CreateToonResponse(); + 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.game_utilities.CreateToonResponse.Descriptor; } + get { return global::bnet.protocol.game_utilities.ServerResponse.Descriptor; } } - public override CreateToonResponse DefaultInstanceForType { - get { return global::bnet.protocol.game_utilities.CreateToonResponse.DefaultInstance; } + public override ServerResponse DefaultInstanceForType { + get { return global::bnet.protocol.game_utilities.ServerResponse.DefaultInstance; } } - public override CreateToonResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override ServerResponse BuildPartial() { + if (resultIsReadOnly) { + return result; } - CreateToonResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is CreateToonResponse) { - return MergeFrom((CreateToonResponse) other); + if (other is ServerResponse) { + return MergeFrom((ServerResponse) 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; + 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::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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1672,50 +1770,760 @@ 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.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.Proto.GameUtilities.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CreateToonRequest : pb::GeneratedMessage { + private CreateToonRequest() { } + private static readonly CreateToonRequest defaultInstance = new CreateToonRequest().MakeReadOnly(); + private static readonly string[] _createToonRequestFieldNames = new string[] { "attribute", "bnet_account_id", "game_account_id", "host", "name", "sender", "token" }; + private static readonly uint[] _createToonRequestFieldTags = new uint[] { 42, 10, 18, 50, 34, 66, 56 }; + 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_; + 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 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_; + public bool HasHost { + get { return hasHost; } + } + public global::bnet.protocol.ProcessId Host { + get { return host_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public const int TokenFieldNumber = 7; + private bool hasToken; + private uint token_; + public bool HasToken { + get { return hasToken; } + } + public uint Token { + get { return token_; } + } + + public const int SenderFieldNumber = 8; + private bool hasSender; + private global::bnet.protocol.ProcessId sender_; + public bool HasSender { + get { return hasSender; } + } + public global::bnet.protocol.ProcessId Sender { + get { return sender_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasBnetAccountId) return false; + if (!hasGameAccountId) return false; + if (!hasName) return false; + if (!hasToken) return false; + if (!hasSender) return false; + if (!BnetAccountId.IsInitialized) return false; + if (!GameAccountId.IsInitialized) return false; + foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { + if (!element.IsInitialized) return false; + } + if (HasHost) { + if (!Host.IsInitialized) return false; + } + if (!Sender.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _createToonRequestFieldNames; + if (hasBnetAccountId) { + output.WriteMessage(1, field_names[1], BnetAccountId); + } + if (hasGameAccountId) { + output.WriteMessage(2, field_names[2], GameAccountId); + } + if (hasName) { + output.WriteString(4, field_names[4], Name); + } + if (attribute_.Count > 0) { + output.WriteMessageArray(5, field_names[0], attribute_); + } + if (hasHost) { + output.WriteMessage(6, field_names[3], Host); + } + if (hasToken) { + output.WriteUInt32(7, field_names[6], Token); + } + if (hasSender) { + output.WriteMessage(8, field_names[5], Sender); + } + 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 (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); + } + if (hasToken) { + size += pb::CodedOutputStream.ComputeUInt32Size(7, Token); + } + if (hasSender) { + size += pb::CodedOutputStream.ComputeMessageSize(8, Sender); + } + 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::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateToonRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateToonRequest 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(CreateToonRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateToonRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateToonRequest result; + + private CreateToonRequest PrepareBuilder() { + if (resultIsReadOnly) { + CreateToonRequest original = result; + result = new CreateToonRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateToonRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.CreateToonRequest.Descriptor; } + } + + public override CreateToonRequest DefaultInstanceForType { + get { return global::bnet.protocol.game_utilities.CreateToonRequest.DefaultInstance; } + } + + public override CreateToonRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + 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; + PrepareBuilder(); + if (other.HasBnetAccountId) { + MergeBnetAccountId(other.BnetAccountId); + } + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); + } + if (other.HasName) { + Name = other.Name; + } + if (other.attribute_.Count != 0) { + result.attribute_.Add(other.attribute_); + } + if (other.HasHost) { + MergeHost(other.Host); + } + if (other.HasToken) { + Token = other.Token; + } + if (other.HasSender) { + MergeSender(other.Sender); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createToonRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createToonRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 42: { + input.ReadMessageArray(tag, field_name, result.attribute_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + case 50: { + 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 56: { + result.hasToken = input.ReadUInt32(ref result.token_); + break; + } + case 66: { + global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); + if (result.hasSender) { + subBuilder.MergeFrom(Sender); + } + input.ReadMessage(subBuilder, extensionRegistry); + Sender = 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 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 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 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 HasName { - get { return result.HasName; } + public bool HasSender { + get { return result.hasSender; } } - public string Name { - get { return result.Name; } - set { SetName(value); } + public global::bnet.protocol.ProcessId Sender { + get { return result.Sender; } + set { SetSender(value); } } - public Builder SetName(string value) { + public Builder SetSender(global::bnet.protocol.ProcessId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasName = true; - result.name_ = value; + PrepareBuilder(); + result.hasSender = true; + result.sender_ = value; return this; } - public Builder ClearName() { - result.hasName = false; - result.name_ = ""; + public Builder SetSender(global::bnet.protocol.ProcessId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSender = true; + result.sender_ = builderForValue.Build(); + return this; + } + public Builder MergeSender(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSender && + result.sender_ != global::bnet.protocol.ProcessId.DefaultInstance) { + result.sender_ = global::bnet.protocol.ProcessId.CreateBuilder(result.sender_).MergeFrom(value).BuildPartial(); + } else { + result.sender_ = value; + } + result.hasSender = true; + return this; + } + public Builder ClearSender() { + PrepareBuilder(); + result.hasSender = false; + result.sender_ = null; return this; } } - static CreateToonResponse() { + static CreateToonRequest() { object.ReferenceEquals(global::bnet.protocol.game_utilities.Proto.GameUtilities.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class DeleteToonRequest : pb::GeneratedMessage { - private static readonly DeleteToonRequest defaultInstance = new Builder().BuildPartial(); + private DeleteToonRequest() { } + private static readonly DeleteToonRequest defaultInstance = new DeleteToonRequest().MakeReadOnly(); + private static readonly string[] _deleteToonRequestFieldNames = new string[] { "bnet_account_id", "game_account_id", "host", "toon_id" }; + private static readonly uint[] _deleteToonRequestFieldTags = new uint[] { 10, 18, 34, 26 }; public static DeleteToonRequest DefaultInstance { get { return defaultInstance; } } public override DeleteToonRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override DeleteToonRequest ThisMessage { @@ -1732,42 +2540,42 @@ protected override DeleteToonRequest ThisMessage { public const int BnetAccountIdFieldNumber = 1; private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId bnetAccountId_; public bool HasBnetAccountId { get { return hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } + get { return bnetAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int GameAccountIdFieldNumber = 2; private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId gameAccountId_; public bool HasGameAccountId { get { return hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ToonIdFieldNumber = 3; private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId toonId_; public bool HasToonId { get { return hasToonId; } } public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } + get { return toonId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int HostFieldNumber = 4; 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 override bool IsInitialized { @@ -1787,19 +2595,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasBnetAccountId) { - output.WriteMessage(1, BnetAccountId); + string[] field_names = _deleteToonRequestFieldNames; + if (hasBnetAccountId) { + output.WriteMessage(1, field_names[0], BnetAccountId); } - if (HasGameAccountId) { - output.WriteMessage(2, GameAccountId); + if (hasGameAccountId) { + output.WriteMessage(2, field_names[1], GameAccountId); } - if (HasToonId) { - output.WriteMessage(3, ToonId); + if (hasToonId) { + output.WriteMessage(3, field_names[3], ToonId); } - if (HasHost) { - output.WriteMessage(4, Host); + if (hasHost) { + output.WriteMessage(4, field_names[2], Host); } UnknownFields.WriteTo(output); } @@ -1811,16 +2620,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasBnetAccountId) { + if (hasBnetAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(1, BnetAccountId); } - if (HasGameAccountId) { + if (hasGameAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); } - if (HasToonId) { + if (hasToonId) { size += pb::CodedOutputStream.ComputeMessageSize(3, ToonId); } - if (HasHost) { + if (hasHost) { size += pb::CodedOutputStream.ComputeMessageSize(4, Host); } size += UnknownFields.SerializedSize; @@ -1853,38 +2662,72 @@ public static DeleteToonRequest ParseDelimitedFrom(global::System.IO.Stream inpu 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) { + public static DeleteToonRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static DeleteToonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static DeleteToonRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private DeleteToonRequest MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(DeleteToonRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - DeleteToonRequest result = new DeleteToonRequest(); + private bool resultIsReadOnly; + private DeleteToonRequest result; + + private DeleteToonRequest PrepareBuilder() { + if (resultIsReadOnly) { + DeleteToonRequest original = result; + result = new DeleteToonRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override DeleteToonRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new DeleteToonRequest(); + 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 { @@ -1896,12 +2739,11 @@ public override DeleteToonRequest DefaultInstanceForType { } public override DeleteToonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - DeleteToonRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1915,6 +2757,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(DeleteToonRequest other) { if (other == global::bnet.protocol.game_utilities.DeleteToonRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasBnetAccountId) { MergeBnetAccountId(other.BnetAccountId); } @@ -1931,20 +2774,31 @@ public override Builder MergeFrom(DeleteToonRequest 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(_deleteToonRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _deleteToonRequestFieldTags[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)) { @@ -1956,12 +2810,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 (HasBnetAccountId) { + if (result.hasBnetAccountId) { subBuilder.MergeFrom(BnetAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1970,7 +2824,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { + if (result.hasGameAccountId) { subBuilder.MergeFrom(GameAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1979,7 +2833,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { + if (result.hasToonId) { subBuilder.MergeFrom(ToonId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1988,7 +2842,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 34: { global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { + if (result.hasHost) { subBuilder.MergeFrom(Host); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1997,11 +2851,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } + get { return result.hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { get { return result.BnetAccountId; } @@ -2009,19 +2868,22 @@ public bool HasBnetAccountId { } 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"); - if (result.HasBnetAccountId && + PrepareBuilder(); + if (result.hasBnetAccountId && result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -2031,13 +2893,14 @@ public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearBnetAccountId() { + PrepareBuilder(); result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.bnetAccountId_ = null; return this; } public bool HasGameAccountId { - get { return result.HasGameAccountId; } + get { return result.hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { get { return result.GameAccountId; } @@ -2045,19 +2908,22 @@ public bool HasGameAccountId { } 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"); - if (result.HasGameAccountId && + PrepareBuilder(); + if (result.hasGameAccountId && result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -2067,13 +2933,14 @@ public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearGameAccountId() { + PrepareBuilder(); result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.gameAccountId_ = null; return this; } public bool HasToonId { - get { return result.HasToonId; } + get { return result.hasToonId; } } public global::bnet.protocol.EntityId ToonId { get { return result.ToonId; } @@ -2081,19 +2948,22 @@ public bool HasToonId { } public Builder SetToonId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToonId = true; result.toonId_ = value; return this; } public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToonId && result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); } else { @@ -2103,13 +2973,14 @@ public Builder MergeToonId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToonId() { + PrepareBuilder(); result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toonId_ = null; return this; } public bool HasHost { - get { return result.HasHost; } + get { return result.hasHost; } } public global::bnet.protocol.ProcessId Host { get { return result.Host; } @@ -2117,19 +2988,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 { @@ -2139,8 +3013,9 @@ 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; } } @@ -2149,14 +3024,20 @@ static DeleteToonRequest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class TransferToonRequest : pb::GeneratedMessage { - private static readonly TransferToonRequest defaultInstance = new Builder().BuildPartial(); + private TransferToonRequest() { } + private static readonly TransferToonRequest defaultInstance = new TransferToonRequest().MakeReadOnly(); + private static readonly string[] _transferToonRequestFieldNames = new string[] { "host", "source", "target", "toon_id" }; + private static readonly uint[] _transferToonRequestFieldTags = new uint[] { 34, 18, 26, 10 }; public static TransferToonRequest DefaultInstance { get { return defaultInstance; } } public override TransferToonRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override TransferToonRequest ThisMessage { @@ -2172,15 +3053,24 @@ protected override TransferToonRequest 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.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Account : pb::GeneratedMessage { - private static readonly Account defaultInstance = new Builder().BuildPartial(); + private Account() { } + private static readonly Account defaultInstance = new Account().MakeReadOnly(); + private static readonly string[] _accountFieldNames = new string[] { "bnet_account_id", "game_account_id" }; + private static readonly uint[] _accountFieldTags = new uint[] { 10, 18 }; public static Account DefaultInstance { get { return defaultInstance; } } public override Account DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Account ThisMessage { @@ -2197,22 +3087,22 @@ protected override Account ThisMessage { public const int BnetAccountIdFieldNumber = 1; private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId bnetAccountId_; public bool HasBnetAccountId { get { return hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } + get { return bnetAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int GameAccountIdFieldNumber = 2; private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId gameAccountId_; public bool HasGameAccountId { get { return hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -2225,13 +3115,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasBnetAccountId) { - output.WriteMessage(1, BnetAccountId); + string[] field_names = _accountFieldNames; + if (hasBnetAccountId) { + output.WriteMessage(1, field_names[0], BnetAccountId); } - if (HasGameAccountId) { - output.WriteMessage(2, GameAccountId); + if (hasGameAccountId) { + output.WriteMessage(2, field_names[1], GameAccountId); } UnknownFields.WriteTo(output); } @@ -2243,10 +3134,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasBnetAccountId) { + if (hasBnetAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(1, BnetAccountId); } - if (HasGameAccountId) { + if (hasGameAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); } size += UnknownFields.SerializedSize; @@ -2279,38 +3170,72 @@ public static Account ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Account ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Account ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Account ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Account MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(Account cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - Account result = new Account(); + private bool resultIsReadOnly; + private Account result; + + private Account PrepareBuilder() { + if (resultIsReadOnly) { + Account original = result; + result = new Account(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Account MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Account(); + 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 { @@ -2322,12 +3247,11 @@ public override Account DefaultInstanceForType { } public override Account BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Account returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2341,6 +3265,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Account other) { if (other == global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.DefaultInstance) return this; + PrepareBuilder(); if (other.HasBnetAccountId) { MergeBnetAccountId(other.BnetAccountId); } @@ -2351,20 +3276,31 @@ public override Builder MergeFrom(Account 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(_accountFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _accountFieldTags[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)) { @@ -2376,12 +3312,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 (HasBnetAccountId) { + if (result.hasBnetAccountId) { subBuilder.MergeFrom(BnetAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2390,7 +3326,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { + if (result.hasGameAccountId) { subBuilder.MergeFrom(GameAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2399,11 +3335,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } + get { return result.hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { get { return result.BnetAccountId; } @@ -2411,19 +3352,22 @@ public bool HasBnetAccountId { } 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"); - if (result.HasBnetAccountId && + PrepareBuilder(); + if (result.hasBnetAccountId && result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -2433,13 +3377,14 @@ public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearBnetAccountId() { + PrepareBuilder(); result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.bnetAccountId_ = null; return this; } public bool HasGameAccountId { - get { return result.HasGameAccountId; } + get { return result.hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { get { return result.GameAccountId; } @@ -2447,19 +3392,22 @@ public bool HasGameAccountId { } 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"); - if (result.HasGameAccountId && + PrepareBuilder(); + if (result.hasGameAccountId && result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -2469,8 +3417,9 @@ public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearGameAccountId() { + PrepareBuilder(); result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.gameAccountId_ = null; return this; } } @@ -2484,42 +3433,42 @@ static Account() { public const int ToonIdFieldNumber = 1; private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId toonId_; public bool HasToonId { get { return hasToonId; } } public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } + get { return toonId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } 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; + private global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account source_; public bool HasSource { get { return hasSource; } } public global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account Source { - get { return source_; } + get { return source_ ?? global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.DefaultInstance; } } 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; + private global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account target_; public bool HasTarget { get { return hasTarget; } } public global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account Target { - get { return target_; } + get { return target_ ?? global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.DefaultInstance; } } public const int HostFieldNumber = 4; 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 override bool IsInitialized { @@ -2539,19 +3488,20 @@ 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 = _transferToonRequestFieldNames; + if (hasToonId) { + output.WriteMessage(1, field_names[3], ToonId); } - if (HasSource) { - output.WriteMessage(2, Source); + if (hasSource) { + output.WriteMessage(2, field_names[1], Source); } - if (HasTarget) { - output.WriteMessage(3, Target); + if (hasTarget) { + output.WriteMessage(3, field_names[2], Target); } - if (HasHost) { - output.WriteMessage(4, Host); + if (hasHost) { + output.WriteMessage(4, field_names[0], Host); } UnknownFields.WriteTo(output); } @@ -2563,16 +3513,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasToonId) { + if (hasToonId) { size += pb::CodedOutputStream.ComputeMessageSize(1, ToonId); } - if (HasSource) { + if (hasSource) { size += pb::CodedOutputStream.ComputeMessageSize(2, Source); } - if (HasTarget) { + if (hasTarget) { size += pb::CodedOutputStream.ComputeMessageSize(3, Target); } - if (HasHost) { + if (hasHost) { size += pb::CodedOutputStream.ComputeMessageSize(4, Host); } size += UnknownFields.SerializedSize; @@ -2605,38 +3555,72 @@ public static TransferToonRequest ParseDelimitedFrom(global::System.IO.Stream in 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) { + public static TransferToonRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static TransferToonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static TransferToonRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private TransferToonRequest MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(TransferToonRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - TransferToonRequest result = new TransferToonRequest(); + private bool resultIsReadOnly; + private TransferToonRequest result; + + private TransferToonRequest PrepareBuilder() { + if (resultIsReadOnly) { + TransferToonRequest original = result; + result = new TransferToonRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override TransferToonRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new TransferToonRequest(); + 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 { @@ -2648,12 +3632,11 @@ public override TransferToonRequest DefaultInstanceForType { } public override TransferToonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - TransferToonRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2667,6 +3650,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(TransferToonRequest other) { if (other == global::bnet.protocol.game_utilities.TransferToonRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasToonId) { MergeToonId(other.ToonId); } @@ -2683,20 +3667,31 @@ public override Builder MergeFrom(TransferToonRequest 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(_transferToonRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _transferToonRequestFieldTags[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)) { @@ -2708,12 +3703,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 (HasToonId) { + if (result.hasToonId) { subBuilder.MergeFrom(ToonId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2722,7 +3717,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.Builder subBuilder = global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.CreateBuilder(); - if (HasSource) { + if (result.hasSource) { subBuilder.MergeFrom(Source); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2731,7 +3726,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.Builder subBuilder = global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.CreateBuilder(); - if (HasTarget) { + if (result.hasTarget) { subBuilder.MergeFrom(Target); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2740,7 +3735,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 34: { global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { + if (result.hasHost) { subBuilder.MergeFrom(Host); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2749,11 +3744,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasToonId { - get { return result.HasToonId; } + get { return result.hasToonId; } } public global::bnet.protocol.EntityId ToonId { get { return result.ToonId; } @@ -2761,19 +3761,22 @@ public bool HasToonId { } public Builder SetToonId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToonId = true; result.toonId_ = value; return this; } public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToonId && result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); } else { @@ -2783,13 +3786,14 @@ public Builder MergeToonId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToonId() { + PrepareBuilder(); result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toonId_ = null; return this; } public bool HasSource { - get { return result.HasSource; } + get { return result.hasSource; } } public global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account Source { get { return result.Source; } @@ -2797,19 +3801,22 @@ public bool HasSource { } public Builder SetSource(global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); 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"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -2819,13 +3826,14 @@ public Builder MergeSource(global::bnet.protocol.game_utilities.TransferToonRequ return this; } public Builder ClearSource() { + PrepareBuilder(); result.hasSource = false; - result.source_ = global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.DefaultInstance; + result.source_ = null; return this; } public bool HasTarget { - get { return result.HasTarget; } + get { return result.hasTarget; } } public global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account Target { get { return result.Target; } @@ -2833,19 +3841,22 @@ public bool HasTarget { } public Builder SetTarget(global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); 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"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -2855,13 +3866,14 @@ public Builder MergeTarget(global::bnet.protocol.game_utilities.TransferToonRequ return this; } public Builder ClearTarget() { + PrepareBuilder(); result.hasTarget = false; - result.target_ = global::bnet.protocol.game_utilities.TransferToonRequest.Types.Account.DefaultInstance; + result.target_ = null; return this; } public bool HasHost { - get { return result.HasHost; } + get { return result.hasHost; } } public global::bnet.protocol.ProcessId Host { get { return result.Host; } @@ -2869,19 +3881,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 { @@ -2891,8 +3906,9 @@ 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; } } @@ -2901,14 +3917,20 @@ static TransferToonRequest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SelectToonRequest : pb::GeneratedMessage { - private static readonly SelectToonRequest defaultInstance = new Builder().BuildPartial(); + private SelectToonRequest() { } + private static readonly SelectToonRequest defaultInstance = new SelectToonRequest().MakeReadOnly(); + private static readonly string[] _selectToonRequestFieldNames = new string[] { "bnet_account_id", "game_account_id", "host", "toon_id" }; + private static readonly uint[] _selectToonRequestFieldTags = new uint[] { 10, 18, 34, 26 }; public static SelectToonRequest DefaultInstance { get { return defaultInstance; } } public override SelectToonRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SelectToonRequest ThisMessage { @@ -2925,42 +3947,42 @@ protected override SelectToonRequest ThisMessage { public const int BnetAccountIdFieldNumber = 1; private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId bnetAccountId_; public bool HasBnetAccountId { get { return hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } + get { return bnetAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int GameAccountIdFieldNumber = 2; private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId gameAccountId_; public bool HasGameAccountId { get { return hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ToonIdFieldNumber = 3; private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId toonId_; public bool HasToonId { get { return hasToonId; } } public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } + get { return toonId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int HostFieldNumber = 4; 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 override bool IsInitialized { @@ -2978,19 +4000,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasBnetAccountId) { - output.WriteMessage(1, BnetAccountId); + string[] field_names = _selectToonRequestFieldNames; + if (hasBnetAccountId) { + output.WriteMessage(1, field_names[0], BnetAccountId); } - if (HasGameAccountId) { - output.WriteMessage(2, GameAccountId); + if (hasGameAccountId) { + output.WriteMessage(2, field_names[1], GameAccountId); } - if (HasToonId) { - output.WriteMessage(3, ToonId); + if (hasToonId) { + output.WriteMessage(3, field_names[3], ToonId); } - if (HasHost) { - output.WriteMessage(4, Host); + if (hasHost) { + output.WriteMessage(4, field_names[2], Host); } UnknownFields.WriteTo(output); } @@ -3002,16 +4025,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasBnetAccountId) { + if (hasBnetAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(1, BnetAccountId); } - if (HasGameAccountId) { + if (hasGameAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); } - if (HasToonId) { + if (hasToonId) { size += pb::CodedOutputStream.ComputeMessageSize(3, ToonId); } - if (HasHost) { + if (hasHost) { size += pb::CodedOutputStream.ComputeMessageSize(4, Host); } size += UnknownFields.SerializedSize; @@ -3044,38 +4067,72 @@ public static SelectToonRequest ParseDelimitedFrom(global::System.IO.Stream inpu 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) { + public static SelectToonRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SelectToonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SelectToonRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SelectToonRequest MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(SelectToonRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SelectToonRequest result; + + private SelectToonRequest PrepareBuilder() { + if (resultIsReadOnly) { + SelectToonRequest original = result; + result = new SelectToonRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - SelectToonRequest result = new SelectToonRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SelectToonRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SelectToonRequest(); + 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 { @@ -3087,12 +4144,11 @@ public override SelectToonRequest DefaultInstanceForType { } public override SelectToonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SelectToonRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3106,6 +4162,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SelectToonRequest other) { if (other == global::bnet.protocol.game_utilities.SelectToonRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasBnetAccountId) { MergeBnetAccountId(other.BnetAccountId); } @@ -3122,20 +4179,31 @@ public override Builder MergeFrom(SelectToonRequest 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(_selectToonRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _selectToonRequestFieldTags[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 +4215,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 (HasBnetAccountId) { + if (result.hasBnetAccountId) { subBuilder.MergeFrom(BnetAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3161,7 +4229,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { + if (result.hasGameAccountId) { subBuilder.MergeFrom(GameAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3170,7 +4238,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { + if (result.hasToonId) { subBuilder.MergeFrom(ToonId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3179,7 +4247,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 34: { global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { + if (result.hasHost) { subBuilder.MergeFrom(Host); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3188,11 +4256,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } + get { return result.hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { get { return result.BnetAccountId; } @@ -3200,19 +4273,22 @@ public bool HasBnetAccountId { } 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"); - if (result.HasBnetAccountId && + PrepareBuilder(); + if (result.hasBnetAccountId && result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -3222,13 +4298,14 @@ public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearBnetAccountId() { + PrepareBuilder(); result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.bnetAccountId_ = null; return this; } public bool HasGameAccountId { - get { return result.HasGameAccountId; } + get { return result.hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { get { return result.GameAccountId; } @@ -3236,19 +4313,22 @@ public bool HasGameAccountId { } 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"); - if (result.HasGameAccountId && + PrepareBuilder(); + if (result.hasGameAccountId && result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -3258,13 +4338,14 @@ public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearGameAccountId() { + PrepareBuilder(); result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.gameAccountId_ = null; return this; } public bool HasToonId { - get { return result.HasToonId; } + get { return result.hasToonId; } } public global::bnet.protocol.EntityId ToonId { get { return result.ToonId; } @@ -3272,19 +4353,22 @@ public bool HasToonId { } public Builder SetToonId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToonId = true; result.toonId_ = value; return this; } public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToonId && result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); } else { @@ -3294,13 +4378,14 @@ public Builder MergeToonId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToonId() { + PrepareBuilder(); result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toonId_ = null; return this; } public bool HasHost { - get { return result.HasHost; } + get { return result.hasHost; } } public global::bnet.protocol.ProcessId Host { get { return result.Host; } @@ -3308,19 +4393,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 { @@ -3330,8 +4418,9 @@ 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; } } @@ -3340,14 +4429,20 @@ static SelectToonRequest() { } } + [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 static readonly PresenceChannelCreatedRequest defaultInstance = new Builder().BuildPartial(); + 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", "toon_id" }; + private static readonly uint[] _presenceChannelCreatedRequestFieldTags = new uint[] { 34, 26, 42, 10, 18 }; public static PresenceChannelCreatedRequest DefaultInstance { get { return defaultInstance; } } public override PresenceChannelCreatedRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override PresenceChannelCreatedRequest ThisMessage { @@ -3364,52 +4459,52 @@ protected override PresenceChannelCreatedRequest ThisMessage { public const int IdFieldNumber = 1; private bool hasId; - private global::bnet.protocol.EntityId id_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId id_; public bool HasId { get { return hasId; } } public global::bnet.protocol.EntityId Id { - get { return id_; } + get { return id_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ToonIdFieldNumber = 2; private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId toonId_; public bool HasToonId { get { return hasToonId; } } public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } + get { return toonId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int GameAccountIdFieldNumber = 3; private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId gameAccountId_; public bool HasGameAccountId { get { return hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int BnetAccountIdFieldNumber = 4; private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId bnetAccountId_; public bool HasBnetAccountId { get { return hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } + get { return bnetAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int HostFieldNumber = 5; 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 override bool IsInitialized { @@ -3432,22 +4527,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.WriteMessage(1, Id); + string[] field_names = _presenceChannelCreatedRequestFieldNames; + if (hasId) { + output.WriteMessage(1, field_names[3], Id); } - if (HasToonId) { - output.WriteMessage(2, ToonId); + if (hasToonId) { + output.WriteMessage(2, field_names[4], ToonId); } - if (HasGameAccountId) { - output.WriteMessage(3, GameAccountId); + if (hasGameAccountId) { + output.WriteMessage(3, field_names[1], GameAccountId); } - if (HasBnetAccountId) { - output.WriteMessage(4, BnetAccountId); + if (hasBnetAccountId) { + output.WriteMessage(4, field_names[0], BnetAccountId); } - if (HasHost) { - output.WriteMessage(5, Host); + if (hasHost) { + output.WriteMessage(5, field_names[2], Host); } UnknownFields.WriteTo(output); } @@ -3459,19 +4555,19 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasId) { + if (hasId) { size += pb::CodedOutputStream.ComputeMessageSize(1, Id); } - if (HasToonId) { + if (hasToonId) { size += pb::CodedOutputStream.ComputeMessageSize(2, ToonId); } - if (HasGameAccountId) { + if (hasGameAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(3, GameAccountId); } - if (HasBnetAccountId) { + if (hasBnetAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(4, BnetAccountId); } - if (HasHost) { + if (hasHost) { size += pb::CodedOutputStream.ComputeMessageSize(5, Host); } size += UnknownFields.SerializedSize; @@ -3504,38 +4600,72 @@ public static PresenceChannelCreatedRequest ParseDelimitedFrom(global::System.IO 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) { + public static PresenceChannelCreatedRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PresenceChannelCreatedRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - PresenceChannelCreatedRequest result = new PresenceChannelCreatedRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override PresenceChannelCreatedRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PresenceChannelCreatedRequest(); + 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 { @@ -3547,12 +4677,11 @@ public override PresenceChannelCreatedRequest DefaultInstanceForType { } public override PresenceChannelCreatedRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - PresenceChannelCreatedRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3566,6 +4695,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PresenceChannelCreatedRequest other) { if (other == global::bnet.protocol.game_utilities.PresenceChannelCreatedRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasId) { MergeId(other.Id); } @@ -3585,20 +4715,31 @@ public override Builder MergeFrom(PresenceChannelCreatedRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -3610,12 +4751,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 (HasId) { + if (result.hasId) { subBuilder.MergeFrom(Id); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3624,7 +4765,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { + if (result.hasToonId) { subBuilder.MergeFrom(ToonId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3633,7 +4774,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { + if (result.hasGameAccountId) { subBuilder.MergeFrom(GameAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3642,7 +4783,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 34: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasBnetAccountId) { + if (result.hasBnetAccountId) { subBuilder.MergeFrom(BnetAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3651,7 +4792,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 42: { global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { + if (result.hasHost) { subBuilder.MergeFrom(Host); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3660,11 +4801,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::bnet.protocol.EntityId Id { get { return result.Id; } @@ -3672,19 +4818,22 @@ public bool HasId { } 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"); - if (result.HasId && + PrepareBuilder(); + if (result.hasId && result.id_ != global::bnet.protocol.EntityId.DefaultInstance) { result.id_ = global::bnet.protocol.EntityId.CreateBuilder(result.id_).MergeFrom(value).BuildPartial(); } else { @@ -3694,13 +4843,14 @@ public Builder MergeId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearId() { + PrepareBuilder(); result.hasId = false; - result.id_ = global::bnet.protocol.EntityId.DefaultInstance; + result.id_ = null; return this; } public bool HasToonId { - get { return result.HasToonId; } + get { return result.hasToonId; } } public global::bnet.protocol.EntityId ToonId { get { return result.ToonId; } @@ -3708,19 +4858,22 @@ public bool HasToonId { } public Builder SetToonId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToonId = true; result.toonId_ = value; return this; } public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToonId && result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); } else { @@ -3730,13 +4883,14 @@ public Builder MergeToonId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToonId() { + PrepareBuilder(); result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toonId_ = null; return this; } public bool HasGameAccountId { - get { return result.HasGameAccountId; } + get { return result.hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { get { return result.GameAccountId; } @@ -3744,19 +4898,22 @@ public bool HasGameAccountId { } 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"); - if (result.HasGameAccountId && + PrepareBuilder(); + if (result.hasGameAccountId && result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -3766,13 +4923,14 @@ public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearGameAccountId() { + PrepareBuilder(); result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.gameAccountId_ = null; return this; } public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } + get { return result.hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { get { return result.BnetAccountId; } @@ -3780,19 +4938,22 @@ public bool HasBnetAccountId { } 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"); - if (result.HasBnetAccountId && + PrepareBuilder(); + if (result.hasBnetAccountId && result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -3802,13 +4963,14 @@ public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearBnetAccountId() { + PrepareBuilder(); result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.bnetAccountId_ = null; return this; } public bool HasHost { - get { return result.HasHost; } + get { return result.hasHost; } } public global::bnet.protocol.ProcessId Host { get { return result.Host; } @@ -3816,19 +4978,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 { @@ -3838,8 +5003,9 @@ 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; } } @@ -3848,14 +5014,20 @@ static PresenceChannelCreatedRequest() { } } + [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 static readonly PlayerVariablesRequest defaultInstance = new Builder().BuildPartial(); + private PlayerVariablesRequest() { } + private static readonly PlayerVariablesRequest defaultInstance = new PlayerVariablesRequest().MakeReadOnly(); + private static readonly string[] _playerVariablesRequestFieldNames = new string[] { "bnet_account_id", "game_account_id", "host", "toon_id", "variable" }; + private static readonly uint[] _playerVariablesRequestFieldTags = new uint[] { 10, 18, 42, 26, 34 }; public static PlayerVariablesRequest DefaultInstance { get { return defaultInstance; } } public override PlayerVariablesRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override PlayerVariablesRequest ThisMessage { @@ -3872,32 +5044,32 @@ protected override PlayerVariablesRequest ThisMessage { public const int BnetAccountIdFieldNumber = 1; private bool hasBnetAccountId; - private global::bnet.protocol.EntityId bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId bnetAccountId_; public bool HasBnetAccountId { get { return hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { - get { return bnetAccountId_; } + get { return bnetAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int GameAccountIdFieldNumber = 2; private bool hasGameAccountId; - private global::bnet.protocol.EntityId gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId gameAccountId_; public bool HasGameAccountId { get { return hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { - get { return gameAccountId_; } + get { return gameAccountId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int ToonIdFieldNumber = 3; private bool hasToonId; - private global::bnet.protocol.EntityId toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId toonId_; public bool HasToonId { get { return hasToonId; } } public global::bnet.protocol.EntityId ToonId { - get { return toonId_; } + get { return toonId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int VariableFieldNumber = 4; @@ -3914,12 +5086,12 @@ public string GetVariable(int index) { public const int HostFieldNumber = 5; 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 override bool IsInitialized { @@ -3937,24 +5109,23 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasBnetAccountId) { - output.WriteMessage(1, BnetAccountId); + string[] field_names = _playerVariablesRequestFieldNames; + if (hasBnetAccountId) { + output.WriteMessage(1, field_names[0], BnetAccountId); } - if (HasGameAccountId) { - output.WriteMessage(2, GameAccountId); + if (hasGameAccountId) { + output.WriteMessage(2, field_names[1], GameAccountId); } - if (HasToonId) { - output.WriteMessage(3, ToonId); + if (hasToonId) { + output.WriteMessage(3, field_names[3], ToonId); } if (variable_.Count > 0) { - foreach (string element in variable_) { - output.WriteString(4, element); - } + output.WriteStringArray(4, field_names[4], variable_); } - if (HasHost) { - output.WriteMessage(5, Host); + if (hasHost) { + output.WriteMessage(5, field_names[2], Host); } UnknownFields.WriteTo(output); } @@ -3966,13 +5137,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasBnetAccountId) { + if (hasBnetAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(1, BnetAccountId); } - if (HasGameAccountId) { + if (hasGameAccountId) { size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); } - if (HasToonId) { + if (hasToonId) { size += pb::CodedOutputStream.ComputeMessageSize(3, ToonId); } { @@ -3983,7 +5154,7 @@ public override int SerializedSize { size += dataSize; size += 1 * variable_.Count; } - if (HasHost) { + if (hasHost) { size += pb::CodedOutputStream.ComputeMessageSize(5, Host); } size += UnknownFields.SerializedSize; @@ -4016,38 +5187,73 @@ public static PlayerVariablesRequest ParseDelimitedFrom(global::System.IO.Stream 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) { + public static PlayerVariablesRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static PlayerVariablesRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - PlayerVariablesRequest result = new PlayerVariablesRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override PlayerVariablesRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new PlayerVariablesRequest(); + 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 { @@ -4059,13 +5265,11 @@ public override PlayerVariablesRequest DefaultInstanceForType { } public override PlayerVariablesRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.variable_.MakeReadOnly(); - PlayerVariablesRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4079,6 +5283,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(PlayerVariablesRequest other) { if (other == global::bnet.protocol.game_utilities.PlayerVariablesRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasBnetAccountId) { MergeBnetAccountId(other.BnetAccountId); } @@ -4089,7 +5294,7 @@ public override Builder MergeFrom(PlayerVariablesRequest other) { MergeToonId(other.ToonId); } if (other.variable_.Count != 0) { - base.AddRange(other.variable_, result.variable_); + result.variable_.Add(other.variable_); } if (other.HasHost) { MergeHost(other.Host); @@ -4098,20 +5303,31 @@ public override Builder MergeFrom(PlayerVariablesRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4123,12 +5339,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 (HasBnetAccountId) { + if (result.hasBnetAccountId) { subBuilder.MergeFrom(BnetAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4137,7 +5353,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasGameAccountId) { + if (result.hasGameAccountId) { subBuilder.MergeFrom(GameAccountId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4146,7 +5362,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToonId) { + if (result.hasToonId) { subBuilder.MergeFrom(ToonId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4154,12 +5370,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 34: { - AddVariable(input.ReadString()); + input.ReadStringArray(tag, field_name, result.variable_); break; } case 42: { global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { + if (result.hasHost) { subBuilder.MergeFrom(Host); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4168,11 +5384,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasBnetAccountId { - get { return result.HasBnetAccountId; } + get { return result.hasBnetAccountId; } } public global::bnet.protocol.EntityId BnetAccountId { get { return result.BnetAccountId; } @@ -4180,19 +5401,22 @@ public bool HasBnetAccountId { } 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"); - if (result.HasBnetAccountId && + PrepareBuilder(); + if (result.hasBnetAccountId && result.bnetAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.bnetAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.bnetAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -4202,13 +5426,14 @@ public Builder MergeBnetAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearBnetAccountId() { + PrepareBuilder(); result.hasBnetAccountId = false; - result.bnetAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.bnetAccountId_ = null; return this; } public bool HasGameAccountId { - get { return result.HasGameAccountId; } + get { return result.hasGameAccountId; } } public global::bnet.protocol.EntityId GameAccountId { get { return result.GameAccountId; } @@ -4216,19 +5441,22 @@ public bool HasGameAccountId { } 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"); - if (result.HasGameAccountId && + PrepareBuilder(); + if (result.hasGameAccountId && result.gameAccountId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.gameAccountId_ = global::bnet.protocol.EntityId.CreateBuilder(result.gameAccountId_).MergeFrom(value).BuildPartial(); } else { @@ -4238,13 +5466,14 @@ public Builder MergeGameAccountId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearGameAccountId() { + PrepareBuilder(); result.hasGameAccountId = false; - result.gameAccountId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.gameAccountId_ = null; return this; } public bool HasToonId { - get { return result.HasToonId; } + get { return result.hasToonId; } } public global::bnet.protocol.EntityId ToonId { get { return result.ToonId; } @@ -4252,19 +5481,22 @@ public bool HasToonId { } public Builder SetToonId(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToonId = true; result.toonId_ = value; return this; } public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToonId && result.toonId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toonId_ = global::bnet.protocol.EntityId.CreateBuilder(result.toonId_).MergeFrom(value).BuildPartial(); } else { @@ -4274,13 +5506,14 @@ public Builder MergeToonId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToonId() { + PrepareBuilder(); result.hasToonId = false; - result.toonId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toonId_ = null; return this; } public pbc::IPopsicleList VariableList { - get { return result.variable_; } + get { return PrepareBuilder().variable_; } } public int VariableCount { get { return result.VariableCount; } @@ -4290,25 +5523,29 @@ public string GetVariable(int 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) { - base.AddRange(values, result.variable_); + PrepareBuilder(); + result.variable_.Add(values); return this; } public Builder ClearVariable() { + PrepareBuilder(); result.variable_.Clear(); return this; } public bool HasHost { - get { return result.HasHost; } + get { return result.hasHost; } } public global::bnet.protocol.ProcessId Host { get { return result.Host; } @@ -4316,19 +5553,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 { @@ -4338,8 +5578,9 @@ 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; } } @@ -4348,14 +5589,20 @@ static PlayerVariablesRequest() { } } + [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 static readonly GameVariablesRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override GameVariablesRequest ThisMessage { @@ -4396,12 +5643,12 @@ public string GetVariable(int index) { public const int HostFieldNumber = 3; 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 override bool IsInitialized { @@ -4416,18 +5663,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 = _gameVariablesRequestFieldNames; + if (attribute_.Count > 0) { + output.WriteMessageArray(1, field_names[0], attribute_); } if (variable_.Count > 0) { - foreach (string element in variable_) { - output.WriteString(2, element); - } + output.WriteStringArray(2, field_names[2], variable_); } - if (HasHost) { - output.WriteMessage(3, Host); + if (hasHost) { + output.WriteMessage(3, field_names[1], Host); } UnknownFields.WriteTo(output); } @@ -4450,7 +5696,7 @@ public override int SerializedSize { size += dataSize; size += 1 * variable_.Count; } - if (HasHost) { + if (hasHost) { size += pb::CodedOutputStream.ComputeMessageSize(3, Host); } size += UnknownFields.SerializedSize; @@ -4483,38 +5729,74 @@ public static GameVariablesRequest ParseDelimitedFrom(global::System.IO.Stream i 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) { + public static GameVariablesRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GameVariablesRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - GameVariablesRequest result = new GameVariablesRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GameVariablesRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GameVariablesRequest(); + 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 { @@ -4526,14 +5808,11 @@ public override GameVariablesRequest DefaultInstanceForType { } public override GameVariablesRequest 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.variable_.MakeReadOnly(); - GameVariablesRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4547,11 +5826,12 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GameVariablesRequest other) { if (other == global::bnet.protocol.game_utilities.GameVariablesRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.attribute_.Count != 0) { - base.AddRange(other.attribute_, result.attribute_); + result.attribute_.Add(other.attribute_); } if (other.variable_.Count != 0) { - base.AddRange(other.variable_, result.variable_); + result.variable_.Add(other.variable_); } if (other.HasHost) { MergeHost(other.Host); @@ -4560,20 +5840,31 @@ public override Builder MergeFrom(GameVariablesRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4585,22 +5876,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.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: { - AddVariable(input.ReadString()); + input.ReadStringArray(tag, field_name, result.variable_); break; } case 26: { global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); - if (HasHost) { + if (result.hasHost) { subBuilder.MergeFrom(Host); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4609,11 +5898,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + 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; } @@ -4623,35 +5917,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 VariableList { - get { return result.variable_; } + get { return PrepareBuilder().variable_; } } public int VariableCount { get { return result.VariableCount; } @@ -4661,25 +5961,29 @@ public string GetVariable(int 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) { - base.AddRange(values, result.variable_); + PrepareBuilder(); + result.variable_.Add(values); return this; } public Builder ClearVariable() { + PrepareBuilder(); result.variable_.Clear(); return this; } public bool HasHost { - get { return result.HasHost; } + get { return result.hasHost; } } public global::bnet.protocol.ProcessId Host { get { return result.Host; } @@ -4687,19 +5991,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 { @@ -4709,8 +6016,9 @@ 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; } } @@ -4719,14 +6027,20 @@ static GameVariablesRequest() { } } + [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 static readonly VariablesResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override VariablesResponse ThisMessage { @@ -4742,6 +6056,7 @@ protected override VariablesResponse ThisMessage { } 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_); } @@ -4759,12 +6074,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 = _variablesResponseFieldNames; if (value_.Count > 0) { - foreach (float element in value_) { - output.WriteFloat(1, element); - } + output.WritePackedFloatArray(1, field_names[0], valueMemoizedSerializedSize, value_); } UnknownFields.WriteTo(output); } @@ -4780,7 +6094,10 @@ public override int SerializedSize { int dataSize = 0; dataSize = 4 * value_.Count; size += dataSize; - size += 1 * value_.Count; + if (value_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + valueMemoizedSerializedSize = dataSize; } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -4812,38 +6129,73 @@ public static VariablesResponse ParseDelimitedFrom(global::System.IO.Stream inpu 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) { + public static VariablesResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static VariablesResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(VariablesResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - VariablesResponse result = new VariablesResponse(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new VariablesResponse(); + 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 { @@ -4855,13 +6207,11 @@ public override VariablesResponse DefaultInstanceForType { } public override VariablesResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.value_.MakeReadOnly(); - VariablesResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4875,27 +6225,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(VariablesResponse other) { if (other == global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.value_.Count != 0) { - base.AddRange(other.value_, result.value_); + result.value_.Add(other.value_); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -4907,20 +6269,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: { - AddValue(input.ReadFloat()); + input.ReadFloatArray(tag, field_name, result.value_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList ValueList { - get { return result.value_; } + get { return PrepareBuilder().value_; } } public int ValueCount { get { return result.ValueCount; } @@ -4929,18 +6297,22 @@ 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) { - base.AddRange(values, result.value_); + PrepareBuilder(); + result.value_.Add(values); return this; } public Builder ClearValue() { + PrepareBuilder(); result.value_.Clear(); return this; } @@ -4953,6 +6325,9 @@ static VariablesResponse() { #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, @@ -4961,7 +6336,7 @@ public abstract void ProcessClientRequest( public abstract void CreateToon( pb::IRpcController controller, global::bnet.protocol.game_utilities.CreateToonRequest request, - global::System.Action done); + global::System.Action done); public abstract void DeleteToon( pb::IRpcController controller, global::bnet.protocol.game_utilities.DeleteToonRequest request, @@ -4990,6 +6365,18 @@ public abstract void GetLoad( pb::IRpcController controller, global::bnet.protocol.server_pool.GetLoadRequest request, global::System.Action done); + public abstract void CreateToonEntity( + pb::IRpcController controller, + global::bnet.protocol.toon.CreateToonEntityRequest request, + global::System.Action done); + public abstract void FinalizeToonCreation( + pb::IRpcController controller, + global::bnet.protocol.toon.FinalizeToonCreationRequest request, + global::System.Action done); + public abstract void ProcessServerRequest( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.ServerRequest request, + global::System.Action done); public static pbd::ServiceDescriptor Descriptor { get { return Proto.GameUtilities.Descriptor.Services[0]; } @@ -5015,7 +6402,7 @@ public void CallMethod( return; case 1: this.CreateToon(controller, (global::bnet.protocol.game_utilities.CreateToonRequest) request, - pb::RpcUtil.SpecializeCallback( + pb::RpcUtil.SpecializeCallback( done)); return; case 2: @@ -5053,6 +6440,21 @@ public void CallMethod( pb::RpcUtil.SpecializeCallback( done)); return; + case 9: + this.CreateToonEntity(controller, (global::bnet.protocol.toon.CreateToonEntityRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 10: + this.FinalizeToonCreation(controller, (global::bnet.protocol.toon.FinalizeToonCreationRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 11: + this.ProcessServerRequest(controller, (global::bnet.protocol.game_utilities.ServerRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -5082,6 +6484,12 @@ public void CallMethod( return global::bnet.protocol.game_utilities.GameVariablesRequest.DefaultInstance; case 8: return global::bnet.protocol.server_pool.GetLoadRequest.DefaultInstance; + case 9: + return global::bnet.protocol.toon.CreateToonEntityRequest.DefaultInstance; + case 10: + return global::bnet.protocol.toon.FinalizeToonCreationRequest.DefaultInstance; + case 11: + return global::bnet.protocol.game_utilities.ServerRequest.DefaultInstance; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -5096,7 +6504,7 @@ public void CallMethod( case 0: return global::bnet.protocol.game_utilities.ClientResponse.DefaultInstance; case 1: - return global::bnet.protocol.game_utilities.CreateToonResponse.DefaultInstance; + return global::bnet.protocol.NoData.DefaultInstance; case 2: return global::bnet.protocol.NoData.DefaultInstance; case 3: @@ -5111,6 +6519,12 @@ public void CallMethod( return global::bnet.protocol.game_utilities.VariablesResponse.DefaultInstance; case 8: return global::bnet.protocol.server_pool.ServerState.DefaultInstance; + case 9: + return global::bnet.protocol.toon.CreateToonEntityResponse.DefaultInstance; + case 10: + return global::bnet.protocol.NoData.DefaultInstance; + case 11: + return global::bnet.protocol.game_utilities.ServerResponse.DefaultInstance; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -5120,6 +6534,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_utilities.GameUtilities { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -5143,10 +6560,10 @@ public override void ProcessClientRequest( public override void CreateToon( pb::IRpcController controller, global::bnet.protocol.game_utilities.CreateToonRequest request, - global::System.Action done) { + 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)); + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); } public override void DeleteToon( @@ -5211,8 +6628,37 @@ public override void GetLoad( controller, request, global::bnet.protocol.server_pool.ServerState.DefaultInstance, pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.server_pool.ServerState.DefaultInstance)); } + + public override void CreateToonEntity( + pb::IRpcController controller, + global::bnet.protocol.toon.CreateToonEntityRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[9], + controller, request, global::bnet.protocol.toon.CreateToonEntityResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.toon.CreateToonEntityResponse.DefaultInstance)); + } + + public override void FinalizeToonCreation( + pb::IRpcController controller, + global::bnet.protocol.toon.FinalizeToonCreationRequest 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 ProcessServerRequest( + pb::IRpcController controller, + global::bnet.protocol.game_utilities.ServerRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[11], + controller, request, global::bnet.protocol.game_utilities.ServerResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.game_utilities.ServerResponse.DefaultInstance)); + } } } #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/invitation/Invitation.cs b/src/LibMooNet/bnet/protocol/invitation/Invitation.cs similarity index 72% rename from source/D3Proto/bnet/protocol/invitation/Invitation.cs rename to src/LibMooNet/bnet/protocol/invitation/Invitation.cs index a4728d90..56951134 100644 --- a/source/D3Proto/bnet/protocol/invitation/Invitation.cs +++ b/src/LibMooNet/bnet/protocol/invitation/Invitation.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.invitation { 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 Invitation { #region Extension registration @@ -42,7 +47,7 @@ static Invitation() { "LnByb3RvY29sLklkZW50aXR5EhQKDGludml0ZXJfbmFtZRgEIAEoCRIUCgxp" + "bnZpdGVlX25hbWUYBSABKAkSGgoSaW52aXRhdGlvbl9tZXNzYWdlGAYgASgJ" + "EhUKDWNyZWF0aW9uX3RpbWUYByABKAQSFwoPZXhwaXJhdGlvbl90aW1lGAgg" + - "ASgEKgUIZBCQTiLHAQoKU3VnZ2VzdGlvbhIrCgpjaGFubmVsX2lkGAEgASgL" + + "ASgEKgUIZBCRTiLHAQoKU3VnZ2VzdGlvbhIrCgpjaGFubmVsX2lkGAEgASgL" + "MhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBItCgxzdWdnZXN0ZXJfaWQYAiAC" + "KAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEi0KDHN1Z2dlc3RlZV9pZBgD" + "IAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSFgoOc3VnZ2VzdGVyX25h" + @@ -50,12 +55,12 @@ static Invitation() { "dGF0aW9uUmVxdWVzdBIvCg5hZ2VudF9pZGVudGl0eRgBIAEoCzIXLmJuZXQu" + "cHJvdG9jb2wuSWRlbnRpdHkSKgoJdGFyZ2V0X2lkGAIgAigLMhcuYm5ldC5w" + "cm90b2NvbC5FbnRpdHlJZBIaChJpbnZpdGF0aW9uX21lc3NhZ2UYAyABKAkS" + - "GgoPZXhwaXJhdGlvbl90aW1lGAQgASgEOgEwKgUIZBCQTiJSChZTZW5kSW52" + + "GgoPZXhwaXJhdGlvbl90aW1lGAQgASgEOgEwKgUIZBCRTiJSChZTZW5kSW52" + "aXRhdGlvblJlc3BvbnNlEjgKCmludml0YXRpb24YAiABKAsyJC5ibmV0LnBy" + "b3RvY29sLmludml0YXRpb24uSW52aXRhdGlvbiJ+Cg5HZW5lcmljUmVxdWVz" + "dBIpCghhZ2VudF9pZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQS" + "KgoJdGFyZ2V0X2lkGAIgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIV" + - "Cg1pbnZpdGF0aW9uX2lkGAMgAigGQg1CC0NJbnZpdGF0aW9u"); + "Cg1pbnZpdGF0aW9uX2lkGAMgAigG"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_invitation_Invitation__Descriptor = Descriptor.MessageTypes[0]; @@ -91,14 +96,20 @@ static Invitation() { } } #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 static readonly Invitation defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override Invitation ThisMessage { @@ -115,7 +126,7 @@ protected override Invitation ThisMessage { public const int IdFieldNumber = 1; private bool hasId; - private ulong id_ = 0; + private ulong id_; public bool HasId { get { return hasId; } } @@ -125,22 +136,22 @@ public ulong Id { public const int InviterIdentityFieldNumber = 2; private bool hasInviterIdentity; - private global::bnet.protocol.Identity inviterIdentity_ = global::bnet.protocol.Identity.DefaultInstance; + private global::bnet.protocol.Identity inviterIdentity_; public bool HasInviterIdentity { get { return hasInviterIdentity; } } public global::bnet.protocol.Identity InviterIdentity { - get { return inviterIdentity_; } + get { return inviterIdentity_ ?? global::bnet.protocol.Identity.DefaultInstance; } } public const int InviteeIdentityFieldNumber = 3; private bool hasInviteeIdentity; - private global::bnet.protocol.Identity inviteeIdentity_ = global::bnet.protocol.Identity.DefaultInstance; + private global::bnet.protocol.Identity inviteeIdentity_; public bool HasInviteeIdentity { get { return hasInviteeIdentity; } } public global::bnet.protocol.Identity InviteeIdentity { - get { return inviteeIdentity_; } + get { return inviteeIdentity_ ?? global::bnet.protocol.Identity.DefaultInstance; } } public const int InviterNameFieldNumber = 4; @@ -175,7 +186,7 @@ public string InvitationMessage { public const int CreationTimeFieldNumber = 7; private bool hasCreationTime; - private ulong creationTime_ = 0UL; + private ulong creationTime_; public bool HasCreationTime { get { return hasCreationTime; } } @@ -185,7 +196,7 @@ public ulong CreationTime { public const int ExpirationTimeFieldNumber = 8; private bool hasExpirationTime; - private ulong expirationTime_ = 0UL; + private ulong expirationTime_; public bool HasExpirationTime { get { return hasExpirationTime; } } @@ -205,34 +216,35 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + 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, Id); + if (hasId) { + output.WriteFixed64(1, field_names[2], Id); } - if (HasInviterIdentity) { - output.WriteMessage(2, InviterIdentity); + if (hasInviterIdentity) { + output.WriteMessage(2, field_names[6], InviterIdentity); } - if (HasInviteeIdentity) { - output.WriteMessage(3, InviteeIdentity); + if (hasInviteeIdentity) { + output.WriteMessage(3, field_names[4], InviteeIdentity); } - if (HasInviterName) { - output.WriteString(4, InviterName); + if (hasInviterName) { + output.WriteString(4, field_names[7], InviterName); } - if (HasInviteeName) { - output.WriteString(5, InviteeName); + if (hasInviteeName) { + output.WriteString(5, field_names[5], InviteeName); } - if (HasInvitationMessage) { - output.WriteString(6, InvitationMessage); + if (hasInvitationMessage) { + output.WriteString(6, field_names[3], InvitationMessage); } - if (HasCreationTime) { - output.WriteUInt64(7, CreationTime); + if (hasCreationTime) { + output.WriteUInt64(7, field_names[0], CreationTime); } - if (HasExpirationTime) { - output.WriteUInt64(8, ExpirationTime); + if (hasExpirationTime) { + output.WriteUInt64(8, field_names[1], ExpirationTime); } - extensionWriter.WriteUntil(10000, output); + extensionWriter.WriteUntil(10001, output); UnknownFields.WriteTo(output); } @@ -243,28 +255,28 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasId) { + if (hasId) { size += pb::CodedOutputStream.ComputeFixed64Size(1, Id); } - if (HasInviterIdentity) { + if (hasInviterIdentity) { size += pb::CodedOutputStream.ComputeMessageSize(2, InviterIdentity); } - if (HasInviteeIdentity) { + if (hasInviteeIdentity) { size += pb::CodedOutputStream.ComputeMessageSize(3, InviteeIdentity); } - if (HasInviterName) { + if (hasInviterName) { size += pb::CodedOutputStream.ComputeStringSize(4, InviterName); } - if (HasInviteeName) { + if (hasInviteeName) { size += pb::CodedOutputStream.ComputeStringSize(5, InviteeName); } - if (HasInvitationMessage) { + if (hasInvitationMessage) { size += pb::CodedOutputStream.ComputeStringSize(6, InvitationMessage); } - if (HasCreationTime) { + if (hasCreationTime) { size += pb::CodedOutputStream.ComputeUInt64Size(7, CreationTime); } - if (HasExpirationTime) { + if (hasExpirationTime) { size += pb::CodedOutputStream.ComputeUInt64Size(8, ExpirationTime); } size += ExtensionsSerializedSize; @@ -298,38 +310,72 @@ public static Invitation ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Invitation ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Invitation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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::ExtendableBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + 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; + } - Invitation result = new Invitation(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Invitation MessageBeingBuilt { - get { return result; } + 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 { @@ -341,12 +387,11 @@ public override Invitation DefaultInstanceForType { } public override Invitation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Invitation returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -360,6 +405,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Invitation other) { if (other == global::bnet.protocol.invitation.Invitation.DefaultInstance) return this; + PrepareBuilder(); if (other.HasId) { Id = other.Id; } @@ -389,20 +435,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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -414,16 +471,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: { - Id = input.ReadFixed64(); + result.hasId = input.ReadFixed64(ref result.id_); break; } case 18: { global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); - if (HasInviterIdentity) { + if (result.hasInviterIdentity) { subBuilder.MergeFrom(InviterIdentity); } input.ReadMessage(subBuilder, extensionRegistry); @@ -432,7 +489,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); - if (HasInviteeIdentity) { + if (result.hasInviteeIdentity) { subBuilder.MergeFrom(InviteeIdentity); } input.ReadMessage(subBuilder, extensionRegistry); @@ -440,50 +497,57 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 34: { - InviterName = input.ReadString(); + result.hasInviterName = input.ReadString(ref result.inviterName_); break; } case 42: { - InviteeName = input.ReadString(); + result.hasInviteeName = input.ReadString(ref result.inviteeName_); break; } case 50: { - InvitationMessage = input.ReadString(); + result.hasInvitationMessage = input.ReadString(ref result.invitationMessage_); break; } case 56: { - CreationTime = input.ReadUInt64(); + result.hasCreationTime = input.ReadUInt64(ref result.creationTime_); break; } case 64: { - ExpirationTime = input.ReadUInt64(); + result.hasExpirationTime = input.ReadUInt64(ref result.expirationTime_); 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 HasInviterIdentity { - get { return result.HasInviterIdentity; } + get { return result.hasInviterIdentity; } } public global::bnet.protocol.Identity InviterIdentity { get { return result.InviterIdentity; } @@ -491,19 +555,22 @@ public bool HasInviterIdentity { } 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"); - if (result.HasInviterIdentity && + PrepareBuilder(); + if (result.hasInviterIdentity && result.inviterIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { result.inviterIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.inviterIdentity_).MergeFrom(value).BuildPartial(); } else { @@ -513,13 +580,14 @@ public Builder MergeInviterIdentity(global::bnet.protocol.Identity value) { return this; } public Builder ClearInviterIdentity() { + PrepareBuilder(); result.hasInviterIdentity = false; - result.inviterIdentity_ = global::bnet.protocol.Identity.DefaultInstance; + result.inviterIdentity_ = null; return this; } public bool HasInviteeIdentity { - get { return result.HasInviteeIdentity; } + get { return result.hasInviteeIdentity; } } public global::bnet.protocol.Identity InviteeIdentity { get { return result.InviteeIdentity; } @@ -527,19 +595,22 @@ public bool HasInviteeIdentity { } 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"); - if (result.HasInviteeIdentity && + PrepareBuilder(); + if (result.hasInviteeIdentity && result.inviteeIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { result.inviteeIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.inviteeIdentity_).MergeFrom(value).BuildPartial(); } else { @@ -549,13 +620,14 @@ public Builder MergeInviteeIdentity(global::bnet.protocol.Identity value) { return this; } public Builder ClearInviteeIdentity() { + PrepareBuilder(); result.hasInviteeIdentity = false; - result.inviteeIdentity_ = global::bnet.protocol.Identity.DefaultInstance; + result.inviteeIdentity_ = null; return this; } public bool HasInviterName { - get { return result.HasInviterName; } + get { return result.hasInviterName; } } public string InviterName { get { return result.InviterName; } @@ -563,18 +635,20 @@ public string InviterName { } 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; } + get { return result.hasInviteeName; } } public string InviteeName { get { return result.InviteeName; } @@ -582,18 +656,20 @@ public string InviteeName { } 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; } + get { return result.hasInvitationMessage; } } public string InvitationMessage { get { return result.InvitationMessage; } @@ -601,47 +677,53 @@ public string InvitationMessage { } 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; } + 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; } + 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; @@ -652,14 +734,20 @@ static Invitation() { } } + [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 static readonly Suggestion defaultInstance = new Builder().BuildPartial(); + private Suggestion() { } + private static readonly Suggestion defaultInstance = new Suggestion().MakeReadOnly(); + private static readonly string[] _suggestionFieldNames = new string[] { "channel_id", "suggestee_id", "suggestee_name", "suggester_id", "suggester_name" }; + private static readonly uint[] _suggestionFieldTags = new uint[] { 10, 26, 42, 18, 34 }; public static Suggestion DefaultInstance { get { return defaultInstance; } } public override Suggestion DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Suggestion ThisMessage { @@ -676,32 +764,32 @@ protected override Suggestion ThisMessage { 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 SuggesterIdFieldNumber = 2; private bool hasSuggesterId; - private global::bnet.protocol.EntityId suggesterId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId suggesterId_; public bool HasSuggesterId { get { return hasSuggesterId; } } public global::bnet.protocol.EntityId SuggesterId { - get { return suggesterId_; } + get { return suggesterId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int SuggesteeIdFieldNumber = 3; private bool hasSuggesteeId; - private global::bnet.protocol.EntityId suggesteeId_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId suggesteeId_; public bool HasSuggesteeId { get { return hasSuggesteeId; } } public global::bnet.protocol.EntityId SuggesteeId { - get { return suggesteeId_; } + get { return suggesteeId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int SuggesterNameFieldNumber = 4; @@ -737,22 +825,23 @@ public override bool IsInitialized { } } - 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 = _suggestionFieldNames; + if (hasChannelId) { + output.WriteMessage(1, field_names[0], ChannelId); } - if (HasSuggesterId) { - output.WriteMessage(2, SuggesterId); + if (hasSuggesterId) { + output.WriteMessage(2, field_names[3], SuggesterId); } - if (HasSuggesteeId) { - output.WriteMessage(3, SuggesteeId); + if (hasSuggesteeId) { + output.WriteMessage(3, field_names[1], SuggesteeId); } - if (HasSuggesterName) { - output.WriteString(4, SuggesterName); + if (hasSuggesterName) { + output.WriteString(4, field_names[4], SuggesterName); } - if (HasSuggesteeName) { - output.WriteString(5, SuggesteeName); + if (hasSuggesteeName) { + output.WriteString(5, field_names[2], SuggesteeName); } UnknownFields.WriteTo(output); } @@ -764,19 +853,19 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasChannelId) { + if (hasChannelId) { size += pb::CodedOutputStream.ComputeMessageSize(1, ChannelId); } - if (HasSuggesterId) { + if (hasSuggesterId) { size += pb::CodedOutputStream.ComputeMessageSize(2, SuggesterId); } - if (HasSuggesteeId) { + if (hasSuggesteeId) { size += pb::CodedOutputStream.ComputeMessageSize(3, SuggesteeId); } - if (HasSuggesterName) { + if (hasSuggesterName) { size += pb::CodedOutputStream.ComputeStringSize(4, SuggesterName); } - if (HasSuggesteeName) { + if (hasSuggesteeName) { size += pb::CodedOutputStream.ComputeStringSize(5, SuggesteeName); } size += UnknownFields.SerializedSize; @@ -809,38 +898,72 @@ public static Suggestion ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Suggestion ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Suggestion ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - Suggestion result = new Suggestion(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Suggestion MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Suggestion(); + 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 { @@ -852,12 +975,11 @@ public override Suggestion DefaultInstanceForType { } public override Suggestion BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Suggestion returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -871,6 +993,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Suggestion other) { if (other == global::bnet.protocol.invitation.Suggestion.DefaultInstance) return this; + PrepareBuilder(); if (other.HasChannelId) { MergeChannelId(other.ChannelId); } @@ -890,20 +1013,31 @@ public override Builder MergeFrom(Suggestion 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -915,12 +1049,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); @@ -929,7 +1063,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasSuggesterId) { + if (result.hasSuggesterId) { subBuilder.MergeFrom(SuggesterId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -938,7 +1072,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasSuggesteeId) { + if (result.hasSuggesteeId) { subBuilder.MergeFrom(SuggesteeId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -946,20 +1080,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 34: { - SuggesterName = input.ReadString(); + result.hasSuggesterName = input.ReadString(ref result.suggesterName_); break; } case 42: { - SuggesteeName = input.ReadString(); + result.hasSuggesteeName = input.ReadString(ref result.suggesteeName_); 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; } @@ -967,19 +1106,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 { @@ -989,13 +1131,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 HasSuggesterId { - get { return result.HasSuggesterId; } + get { return result.hasSuggesterId; } } public global::bnet.protocol.EntityId SuggesterId { get { return result.SuggesterId; } @@ -1003,19 +1146,22 @@ public bool HasSuggesterId { } 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"); - if (result.HasSuggesterId && + PrepareBuilder(); + if (result.hasSuggesterId && result.suggesterId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.suggesterId_ = global::bnet.protocol.EntityId.CreateBuilder(result.suggesterId_).MergeFrom(value).BuildPartial(); } else { @@ -1025,13 +1171,14 @@ public Builder MergeSuggesterId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearSuggesterId() { + PrepareBuilder(); result.hasSuggesterId = false; - result.suggesterId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.suggesterId_ = null; return this; } public bool HasSuggesteeId { - get { return result.HasSuggesteeId; } + get { return result.hasSuggesteeId; } } public global::bnet.protocol.EntityId SuggesteeId { get { return result.SuggesteeId; } @@ -1039,19 +1186,22 @@ public bool HasSuggesteeId { } 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"); - if (result.HasSuggesteeId && + PrepareBuilder(); + if (result.hasSuggesteeId && result.suggesteeId_ != global::bnet.protocol.EntityId.DefaultInstance) { result.suggesteeId_ = global::bnet.protocol.EntityId.CreateBuilder(result.suggesteeId_).MergeFrom(value).BuildPartial(); } else { @@ -1061,13 +1211,14 @@ public Builder MergeSuggesteeId(global::bnet.protocol.EntityId value) { return this; } public Builder ClearSuggesteeId() { + PrepareBuilder(); result.hasSuggesteeId = false; - result.suggesteeId_ = global::bnet.protocol.EntityId.DefaultInstance; + result.suggesteeId_ = null; return this; } public bool HasSuggesterName { - get { return result.HasSuggesterName; } + get { return result.hasSuggesterName; } } public string SuggesterName { get { return result.SuggesterName; } @@ -1075,18 +1226,20 @@ public string SuggesterName { } 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; } + get { return result.hasSuggesteeName; } } public string SuggesteeName { get { return result.SuggesteeName; } @@ -1094,11 +1247,13 @@ public string SuggesteeName { } 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; @@ -1109,14 +1264,20 @@ static Suggestion() { } } + [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::ExtendableMessage { - private static readonly SendInvitationRequest defaultInstance = new Builder().BuildPartial(); + private SendInvitationRequest() { } + private static readonly SendInvitationRequest defaultInstance = new SendInvitationRequest().MakeReadOnly(); + private static readonly string[] _sendInvitationRequestFieldNames = new string[] { "agent_identity", "expiration_time", "invitation_message", "target_id" }; + private static readonly uint[] _sendInvitationRequestFieldTags = new uint[] { 10, 32, 26, 18 }; public static SendInvitationRequest DefaultInstance { get { return defaultInstance; } } public override SendInvitationRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SendInvitationRequest ThisMessage { @@ -1133,22 +1294,22 @@ protected override SendInvitationRequest ThisMessage { public const int AgentIdentityFieldNumber = 1; private bool hasAgentIdentity; - private global::bnet.protocol.Identity agentIdentity_ = global::bnet.protocol.Identity.DefaultInstance; + private global::bnet.protocol.Identity agentIdentity_; public bool HasAgentIdentity { get { return hasAgentIdentity; } } public global::bnet.protocol.Identity AgentIdentity { - get { return agentIdentity_; } + get { return agentIdentity_ ?? global::bnet.protocol.Identity.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 InvitationMessageFieldNumber = 3; @@ -1163,7 +1324,7 @@ public string InvitationMessage { public const int ExpirationTimeFieldNumber = 4; private bool hasExpirationTime; - private ulong expirationTime_ = 0UL; + private ulong expirationTime_; public bool HasExpirationTime { get { return hasExpirationTime; } } @@ -1183,22 +1344,23 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; + string[] field_names = _sendInvitationRequestFieldNames; pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (HasAgentIdentity) { - output.WriteMessage(1, AgentIdentity); + if (hasAgentIdentity) { + output.WriteMessage(1, field_names[0], AgentIdentity); } - if (HasTargetId) { - output.WriteMessage(2, TargetId); + if (hasTargetId) { + output.WriteMessage(2, field_names[3], TargetId); } - if (HasInvitationMessage) { - output.WriteString(3, InvitationMessage); + if (hasInvitationMessage) { + output.WriteString(3, field_names[2], InvitationMessage); } - if (HasExpirationTime) { - output.WriteUInt64(4, ExpirationTime); + if (hasExpirationTime) { + output.WriteUInt64(4, field_names[1], ExpirationTime); } - extensionWriter.WriteUntil(10000, output); + extensionWriter.WriteUntil(10001, output); UnknownFields.WriteTo(output); } @@ -1209,16 +1371,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentIdentity) { + if (hasAgentIdentity) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentIdentity); } - if (HasTargetId) { + if (hasTargetId) { size += pb::CodedOutputStream.ComputeMessageSize(2, TargetId); } - if (HasInvitationMessage) { + if (hasInvitationMessage) { size += pb::CodedOutputStream.ComputeStringSize(3, InvitationMessage); } - if (HasExpirationTime) { + if (hasExpirationTime) { size += pb::CodedOutputStream.ComputeUInt64Size(4, ExpirationTime); } size += ExtensionsSerializedSize; @@ -1252,38 +1414,72 @@ public static SendInvitationRequest ParseDelimitedFrom(global::System.IO.Stream 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) { + public static SendInvitationRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SendInvitationRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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::ExtendableBuilder { protected override Builder ThisBuilder { get { return this; } } - public Builder() {} + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SendInvitationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SendInvitationRequest result; - SendInvitationRequest result = new SendInvitationRequest(); + 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 result; } + 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 { @@ -1295,12 +1491,11 @@ public override SendInvitationRequest DefaultInstanceForType { } public override SendInvitationRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SendInvitationRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1314,6 +1509,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SendInvitationRequest other) { if (other == global::bnet.protocol.invitation.SendInvitationRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentIdentity) { MergeAgentIdentity(other.AgentIdentity); } @@ -1331,20 +1527,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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1356,12 +1563,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.Identity.Builder subBuilder = global::bnet.protocol.Identity.CreateBuilder(); - if (HasAgentIdentity) { + if (result.hasAgentIdentity) { subBuilder.MergeFrom(AgentIdentity); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1370,7 +1577,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); @@ -1378,20 +1585,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 26: { - InvitationMessage = input.ReadString(); + result.hasInvitationMessage = input.ReadString(ref result.invitationMessage_); break; } case 32: { - ExpirationTime = input.ReadUInt64(); + result.hasExpirationTime = input.ReadUInt64(ref result.expirationTime_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasAgentIdentity { - get { return result.HasAgentIdentity; } + get { return result.hasAgentIdentity; } } public global::bnet.protocol.Identity AgentIdentity { get { return result.AgentIdentity; } @@ -1399,19 +1611,22 @@ public bool HasAgentIdentity { } 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"); - if (result.HasAgentIdentity && + PrepareBuilder(); + if (result.hasAgentIdentity && result.agentIdentity_ != global::bnet.protocol.Identity.DefaultInstance) { result.agentIdentity_ = global::bnet.protocol.Identity.CreateBuilder(result.agentIdentity_).MergeFrom(value).BuildPartial(); } else { @@ -1421,13 +1636,14 @@ public Builder MergeAgentIdentity(global::bnet.protocol.Identity value) { return this; } public Builder ClearAgentIdentity() { + PrepareBuilder(); result.hasAgentIdentity = false; - result.agentIdentity_ = global::bnet.protocol.Identity.DefaultInstance; + result.agentIdentity_ = null; return this; } public bool HasTargetId { - get { return result.HasTargetId; } + get { return result.hasTargetId; } } public global::bnet.protocol.EntityId TargetId { get { return result.TargetId; } @@ -1435,19 +1651,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 { @@ -1457,13 +1676,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 HasInvitationMessage { - get { return result.HasInvitationMessage; } + get { return result.hasInvitationMessage; } } public string InvitationMessage { get { return result.InvitationMessage; } @@ -1471,29 +1691,33 @@ public string InvitationMessage { } 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; } + 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; @@ -1504,14 +1728,20 @@ static SendInvitationRequest() { } } + [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 static readonly SendInvitationResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override SendInvitationResponse ThisMessage { @@ -1528,12 +1758,12 @@ protected override SendInvitationResponse ThisMessage { public const int InvitationFieldNumber = 2; 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 { @@ -1545,10 +1775,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(2, Invitation); + string[] field_names = _sendInvitationResponseFieldNames; + if (hasInvitation) { + output.WriteMessage(2, field_names[0], Invitation); } UnknownFields.WriteTo(output); } @@ -1560,7 +1791,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasInvitation) { + if (hasInvitation) { size += pb::CodedOutputStream.ComputeMessageSize(2, Invitation); } size += UnknownFields.SerializedSize; @@ -1593,38 +1824,72 @@ public static SendInvitationResponse ParseDelimitedFrom(global::System.IO.Stream 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) { + public static SendInvitationResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SendInvitationResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(SendInvitationResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SendInvitationResponse result = new SendInvitationResponse(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SendInvitationResponse(); + 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 { @@ -1636,12 +1901,11 @@ public override SendInvitationResponse DefaultInstanceForType { } public override SendInvitationResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SendInvitationResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1655,6 +1919,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SendInvitationResponse other) { if (other == global::bnet.protocol.invitation.SendInvitationResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasInvitation) { MergeInvitation(other.Invitation); } @@ -1662,20 +1927,31 @@ public override Builder MergeFrom(SendInvitationResponse 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1687,12 +1963,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: { 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); @@ -1701,11 +1977,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; } @@ -1713,19 +1994,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 { @@ -1735,8 +2019,9 @@ 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; } } @@ -1745,14 +2030,20 @@ static SendInvitationResponse() { } } + [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 static readonly GenericRequest defaultInstance = new Builder().BuildPartial(); + private GenericRequest() { } + private static readonly GenericRequest defaultInstance = new GenericRequest().MakeReadOnly(); + private static readonly string[] _genericRequestFieldNames = new string[] { "agent_id", "invitation_id", "target_id" }; + private static readonly uint[] _genericRequestFieldTags = new uint[] { 10, 25, 18 }; public static GenericRequest DefaultInstance { get { return defaultInstance; } } public override GenericRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override GenericRequest ThisMessage { @@ -1769,27 +2060,27 @@ protected override GenericRequest ThisMessage { 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; } } @@ -1810,16 +2101,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 = _genericRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasTargetId) { - output.WriteMessage(2, TargetId); + if (hasTargetId) { + output.WriteMessage(2, field_names[2], TargetId); } - if (HasInvitationId) { - output.WriteFixed64(3, InvitationId); + if (hasInvitationId) { + output.WriteFixed64(3, field_names[1], InvitationId); } UnknownFields.WriteTo(output); } @@ -1831,13 +2123,13 @@ 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); } size += UnknownFields.SerializedSize; @@ -1870,38 +2162,72 @@ public static GenericRequest ParseDelimitedFrom(global::System.IO.Stream input) 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) { + public static GenericRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static GenericRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static GenericRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private GenericRequest MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(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; + } - GenericRequest result = new GenericRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override GenericRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new GenericRequest(); + 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 { @@ -1913,12 +2239,11 @@ public override GenericRequest DefaultInstanceForType { } public override GenericRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - GenericRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1932,6 +2257,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(GenericRequest other) { if (other == global::bnet.protocol.invitation.GenericRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -1945,20 +2271,31 @@ public override Builder MergeFrom(GenericRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1970,12 +2307,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); @@ -1984,7 +2321,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); @@ -1992,16 +2329,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 25: { - InvitationId = input.ReadFixed64(); + result.hasInvitationId = input.ReadFixed64(ref result.invitationId_); 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; } @@ -2009,19 +2351,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 { @@ -2031,13 +2376,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; } @@ -2045,19 +2391,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 { @@ -2067,24 +2416,27 @@ 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; @@ -2098,3 +2450,5 @@ static GenericRequest() { #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/notification/Notification.cs b/src/LibMooNet/bnet/protocol/notification/Notification.cs similarity index 71% rename from source/D3Proto/bnet/protocol/notification/Notification.cs rename to src/LibMooNet/bnet/protocol/notification/Notification.cs index a79b7406..41f5f63b 100644 --- a/source/D3Proto/bnet/protocol/notification/Notification.cs +++ b/src/LibMooNet/bnet/protocol/notification/Notification.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.notification { 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 Notification { #region Extension registration @@ -34,33 +39,34 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static Notification() { 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="); + "CjJzZXJ2aWNlL25vdGlmaWNhdGlvbi9kZWZpbml0aW9uL25vdGlmaWNhdGlv" + + "bi5wcm90bxIaYm5ldC5wcm90b2NvbC5ub3RpZmljYXRpb24aHGxpYi9wcm90" + + "b2NvbC9hdHRyaWJ1dGUucHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJv" + + "dG8aEWxpYi9ycGMvcnBjLnByb3RvIuEBCgxOb3RpZmljYXRpb24SKgoJc2Vu" + + "ZGVyX2lkGAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBI0ChNzZW5k" + + "ZXJfZ2FtZV9hY2NvdW50GAIgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJ" + + "ZBIqCgl0YXJnZXRfaWQYAyACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlk" + + "EgwKBHR5cGUYBCACKAkSNQoJYXR0cmlidXRlGAUgAygLMiIuYm5ldC5wcm90" + + "b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlIj8KEUZpbmRDbGllbnRSZXF1ZXN0" + + "EioKCWVudGl0eV9pZBgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQi" + + "WAoSRmluZENsaWVudFJlc3BvbnNlEg0KBWxhYmVsGAEgAigNEjMKEWNsaWVu" + + "dF9wcm9jZXNzX2lkGAIgASgLMhguYm5ldC5wcm90b2NvbC5Qcm9jZXNzSWQi" + + "QwoVUmVnaXN0ZXJDbGllbnRSZXF1ZXN0EioKCWVudGl0eV9pZBgBIAIoCzIX" + + "LmJuZXQucHJvdG9jb2wuRW50aXR5SWQiRQoXVW5yZWdpc3RlckNsaWVudFJl" + + "cXVlc3QSKgoJZW50aXR5X2lkGAEgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRp" + + "dHlJZDKrAwoTTm90aWZpY2F0aW9uU2VydmljZRJZChBTZW5kTm90aWZpY2F0" + + "aW9uEiguYm5ldC5wcm90b2NvbC5ub3RpZmljYXRpb24uTm90aWZpY2F0aW9u" + + "GhUuYm5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAESYAoOUmVnaXN0ZXJDbGll" + + "bnQSMS5ibmV0LnByb3RvY29sLm5vdGlmaWNhdGlvbi5SZWdpc3RlckNsaWVu" + + "dFJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYAhJkChBVbnJl" + + "Z2lzdGVyQ2xpZW50EjMuYm5ldC5wcm90b2NvbC5ub3RpZmljYXRpb24uVW5y" + + "ZWdpc3RlckNsaWVudFJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIE" + + "gLUYAxJxCgpGaW5kQ2xpZW50Ei0uYm5ldC5wcm90b2NvbC5ub3RpZmljYXRp" + + "b24uRmluZENsaWVudFJlcXVlc3QaLi5ibmV0LnByb3RvY29sLm5vdGlmaWNh" + + "dGlvbi5GaW5kQ2xpZW50UmVzcG9uc2UiBIC1GAQyfAoUTm90aWZpY2F0aW9u" + + "TGlzdGVuZXISZAoWT25Ob3RpZmljYXRpb25SZWNlaXZlZBIoLmJuZXQucHJv" + + "dG9jb2wubm90aWZpY2F0aW9uLk5vdGlmaWNhdGlvbhoaLmJuZXQucHJvdG9j" + + "b2wuTk9fUkVTUE9OU0UiBIC1GAFCA4ABAA=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_notification_Notification__Descriptor = Descriptor.MessageTypes[0]; @@ -83,7 +89,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 +108,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_game_account", "sender_id", "target_id", "type" }; + private static readonly uint[] _notificationFieldTags = new uint[] { 42, 18, 10, 26, 34 }; public static Notification DefaultInstance { get { return defaultInstance; } } public override Notification DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Notification ThisMessage { @@ -121,32 +138,32 @@ protected override Notification ThisMessage { 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_; } + get { return senderId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public const int SenderGameAccountFieldNumber = 2; private bool hasSenderGameAccount; - private global::bnet.protocol.EntityId senderGameAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId senderGameAccount_; public bool HasSenderGameAccount { get { return hasSenderGameAccount; } } public global::bnet.protocol.EntityId SenderGameAccount { - get { return senderGameAccount_; } + get { return senderGameAccount_ ?? 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 TypeFieldNumber = 4; @@ -189,22 +206,23 @@ public override bool IsInitialized { } } - 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[2], SenderId); } - if (HasSenderGameAccount) { - output.WriteMessage(2, SenderGameAccount); + if (hasSenderGameAccount) { + output.WriteMessage(2, field_names[1], SenderGameAccount); } - if (HasTargetId) { - output.WriteMessage(3, TargetId); + if (hasTargetId) { + output.WriteMessage(3, field_names[3], TargetId); } - if (HasType) { - output.WriteString(4, Type); + if (hasType) { + output.WriteString(4, field_names[4], Type); } - 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); } @@ -216,16 +234,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSenderId) { + if (hasSenderId) { size += pb::CodedOutputStream.ComputeMessageSize(1, SenderId); } - if (HasSenderGameAccount) { + if (hasSenderGameAccount) { size += pb::CodedOutputStream.ComputeMessageSize(2, SenderGameAccount); } - if (HasTargetId) { + if (hasTargetId) { size += pb::CodedOutputStream.ComputeMessageSize(3, TargetId); } - if (HasType) { + if (hasType) { size += pb::CodedOutputStream.ComputeStringSize(4, Type); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { @@ -261,38 +279,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; + } - Notification result = new Notification(); + private bool resultIsReadOnly; + private Notification result; + + private Notification PrepareBuilder() { + if (resultIsReadOnly) { + Notification original = result; + result = new Notification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +357,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,6 +375,7 @@ 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); } @@ -337,26 +389,37 @@ 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_); } 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 +431,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,7 +445,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasSenderGameAccount) { + if (result.hasSenderGameAccount) { subBuilder.MergeFrom(SenderGameAccount); } input.ReadMessage(subBuilder, extensionRegistry); @@ -391,7 +454,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); @@ -399,22 +462,25 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 34: { - Type = input.ReadString(); + result.hasType = input.ReadString(ref result.type_); 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 HasSenderId { - get { return result.HasSenderId; } + get { return result.hasSenderId; } } public global::bnet.protocol.EntityId SenderId { get { return result.SenderId; } @@ -422,19 +488,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,13 +513,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; + result.senderId_ = null; return this; } public bool HasSenderGameAccount { - get { return result.HasSenderGameAccount; } + get { return result.hasSenderGameAccount; } } public global::bnet.protocol.EntityId SenderGameAccount { get { return result.SenderGameAccount; } @@ -458,19 +528,22 @@ public bool HasSenderGameAccount { } public Builder SetSenderGameAccount(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasSenderGameAccount = true; result.senderGameAccount_ = value; return this; } public Builder SetSenderGameAccount(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasSenderGameAccount && result.senderGameAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { result.senderGameAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.senderGameAccount_).MergeFrom(value).BuildPartial(); } else { @@ -480,13 +553,14 @@ public Builder MergeSenderGameAccount(global::bnet.protocol.EntityId value) { return this; } public Builder ClearSenderGameAccount() { + PrepareBuilder(); result.hasSenderGameAccount = false; - result.senderGameAccount_ = global::bnet.protocol.EntityId.DefaultInstance; + result.senderGameAccount_ = 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 +568,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 +593,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 +608,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,29 +631,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; } @@ -583,14 +669,20 @@ static Notification() { } } + [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 { @@ -607,12 +699,12 @@ protected override FindClientRequest ThisMessage { 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 +715,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 +731,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 +764,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; - FindClientRequest result = new FindClientRequest(); + private FindClientRequest PrepareBuilder() { + if (resultIsReadOnly) { + FindClientRequest original = result; + result = new FindClientRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +841,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 +859,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 +867,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 +903,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 +917,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 +934,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,8 +959,9 @@ 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; } } @@ -823,14 +970,20 @@ static FindClientRequest() { } } + [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 { @@ -847,7 +1000,7 @@ protected override FindClientResponse ThisMessage { public const int LabelFieldNumber = 1; private bool hasLabel; - private uint label_ = 0; + private uint label_; public bool HasLabel { get { return hasLabel; } } @@ -857,12 +1010,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 +1028,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 +1047,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 +1083,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 +1160,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 +1178,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 +1189,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 +1225,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 +1243,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 +1280,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,8 +1305,9 @@ 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; } } @@ -1106,14 +1316,20 @@ static FindClientResponse() { } } + [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 { @@ -1130,12 +1346,12 @@ protected override RegisterClientRequest ThisMessage { 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 +1362,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 +1378,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 +1411,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 +1488,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 +1506,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 +1514,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 +1550,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 +1564,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 +1581,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,8 +1606,9 @@ 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; } } @@ -1346,14 +1617,20 @@ static RegisterClientRequest() { } } + [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 { @@ -1370,12 +1647,12 @@ protected override UnregisterClientRequest ThisMessage { 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 +1663,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 +1679,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 +1712,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; + } - UnregisterClientRequest result = new UnregisterClientRequest(); + private bool resultIsReadOnly; + private UnregisterClientRequest result; + + private UnregisterClientRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnregisterClientRequest original = result; + result = new UnregisterClientRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +1789,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 +1807,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 +1815,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 +1851,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 +1865,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 +1882,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,8 +1907,9 @@ 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; } } @@ -1589,6 +1921,9 @@ static UnregisterClientRequest() { #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, @@ -1691,6 +2026,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,6 +2077,9 @@ 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, @@ -1802,6 +2143,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; @@ -1826,3 +2170,5 @@ public override void OnNotificationReceived( #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/presence/Presence.cs b/src/LibMooNet/bnet/protocol/presence/Presence.cs similarity index 59% rename from source/D3Proto/bnet/protocol/presence/Presence.cs rename to src/LibMooNet/bnet/protocol/presence/Presence.cs index f16a1c1f..caa56f13 100644 --- a/source/D3Proto/bnet/protocol/presence/Presence.cs +++ b/src/LibMooNet/bnet/protocol/presence/Presence.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 Presence { #region Extension registration @@ -23,6 +28,8 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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 { @@ -32,30 +39,36 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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="); + "CipzZXJ2aWNlL3ByZXNlbmNlL2RlZmluaXRpb24vcHJlc2VuY2UucHJvdG8S" + + "FmJuZXQucHJvdG9jb2wucHJlc2VuY2UaHGxpYi9wcm90b2NvbC9hdHRyaWJ1" + + "dGUucHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJvdG8aEWxpYi9ycGMv" + + "cnBjLnByb3RvGjBzZXJ2aWNlL3ByZXNlbmNlL2RlZmluaXRpb24vcHJlc2Vu" + + "Y2VfdHlwZXMucHJvdG8ifAoQU3Vic2NyaWJlUmVxdWVzdBIpCghhZ2VudF9p" + + "ZBgBIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSKgoJZW50aXR5X2lk" + + "GAIgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIRCglvYmplY3RfaWQY" + + "AyACKAQiawoSVW5zdWJzY3JpYmVSZXF1ZXN0EikKCGFnZW50X2lkGAEgASgL" + + "MhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBIqCgllbnRpdHlfaWQYAiACKAsy" + + "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkInwKDVVwZGF0ZVJlcXVlc3QSKgoJ" + + "ZW50aXR5X2lkGAEgAigLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZBI/Cg9m" + + "aWVsZF9vcGVyYXRpb24YAiADKAsyJi5ibmV0LnByb3RvY29sLnByZXNlbmNl" + + "LkZpZWxkT3BlcmF0aW9uImkKDFF1ZXJ5UmVxdWVzdBIqCgllbnRpdHlfaWQY" + + "ASACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEi0KA2tleRgCIAMoCzIg" + + "LmJuZXQucHJvdG9jb2wucHJlc2VuY2UuRmllbGRLZXkiPQoNUXVlcnlSZXNw" + + "b25zZRIsCgVmaWVsZBgCIAMoCzIdLmJuZXQucHJvdG9jb2wucHJlc2VuY2Uu" + + "RmllbGQiYAoQT3duZXJzaGlwUmVxdWVzdBIqCgllbnRpdHlfaWQYASACKAsy" + + "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkEiAKEXJlbGVhc2Vfb3duZXJzaGlw" + + "GAIgASgIOgVmYWxzZTKHBAoPUHJlc2VuY2VTZXJ2aWNlElIKCVN1YnNjcmli" + + "ZRIoLmJuZXQucHJvdG9jb2wucHJlc2VuY2UuU3Vic2NyaWJlUmVxdWVzdBoV" + + "LmJuZXQucHJvdG9jb2wuTm9EYXRhIgSAtRgBElYKC1Vuc3Vic2NyaWJlEiou" + + "Ym5ldC5wcm90b2NvbC5wcmVzZW5jZS5VbnN1YnNjcmliZVJlcXVlc3QaFS5i" + + "bmV0LnByb3RvY29sLk5vRGF0YSIEgLUYAhJMCgZVcGRhdGUSJS5ibmV0LnBy" + + "b3RvY29sLnByZXNlbmNlLlVwZGF0ZVJlcXVlc3QaFS5ibmV0LnByb3RvY29s" + + "Lk5vRGF0YSIEgLUYAxJaCgVRdWVyeRIkLmJuZXQucHJvdG9jb2wucHJlc2Vu" + + "Y2UuUXVlcnlSZXF1ZXN0GiUuYm5ldC5wcm90b2NvbC5wcmVzZW5jZS5RdWVy" + + "eVJlc3BvbnNlIgSAtRgEElIKCU93bmVyc2hpcBIoLmJuZXQucHJvdG9jb2wu" + + "cHJlc2VuY2UuT3duZXJzaGlwUmVxdWVzdBoVLmJuZXQucHJvdG9jb2wuTm9E" + + "YXRhIgSAtRgFEkoKBEhlYWwSJS5ibmV0LnByb3RvY29sLnByZXNlbmNlLlVw" + + "ZGF0ZVJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0YSIEgLUYBkIDgAEA"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_presence_SubscribeRequest__Descriptor = Descriptor.MessageTypes[0]; @@ -78,7 +91,17 @@ static Presence() { internal__static_bnet_protocol_presence_QueryResponse__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_presence_QueryResponse__Descriptor, new string[] { "Field", }); - return null; + internal__static_bnet_protocol_presence_OwnershipRequest__Descriptor = Descriptor.MessageTypes[5]; + 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[] { @@ -92,14 +115,20 @@ static Presence() { } #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 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", "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; } + get { return DefaultInstance; } } protected override SubscribeRequest ThisMessage { @@ -116,27 +145,27 @@ protected override SubscribeRequest ThisMessage { 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 EntityIdFieldNumber = 2; 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 ObjectIdFieldNumber = 3; private bool hasObjectId; - private ulong objectId_ = 0UL; + private ulong objectId_; public bool HasObjectId { get { return hasObjectId; } } @@ -156,16 +185,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 = _subscribeRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasEntityId) { - output.WriteMessage(2, EntityId); + if (hasEntityId) { + output.WriteMessage(2, field_names[1], EntityId); } - if (HasObjectId) { - output.WriteUInt64(3, ObjectId); + if (hasObjectId) { + output.WriteUInt64(3, field_names[2], ObjectId); } UnknownFields.WriteTo(output); } @@ -177,13 +207,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasEntityId) { + if (hasEntityId) { size += pb::CodedOutputStream.ComputeMessageSize(2, EntityId); } - if (HasObjectId) { + if (hasObjectId) { size += pb::CodedOutputStream.ComputeUInt64Size(3, ObjectId); } size += UnknownFields.SerializedSize; @@ -216,38 +246,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 { @@ -259,12 +323,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) { @@ -278,6 +341,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SubscribeRequest other) { if (other == global::bnet.protocol.presence.SubscribeRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -291,20 +355,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)) { @@ -316,12 +391,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); @@ -330,7 +405,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasEntityId) { + if (result.hasEntityId) { subBuilder.MergeFrom(EntityId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -338,16 +413,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 24: { - 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; } @@ -355,19 +435,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 { @@ -377,13 +460,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 HasEntityId { - get { return result.HasEntityId; } + get { return result.hasEntityId; } } public global::bnet.protocol.EntityId EntityId { get { return result.EntityId; } @@ -391,19 +475,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 { @@ -413,24 +500,27 @@ 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 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; @@ -441,14 +531,20 @@ static SubscribeRequest() { } } + [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", "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; } + get { return DefaultInstance; } } protected override UnsubscribeRequest ThisMessage { @@ -465,22 +561,22 @@ protected override UnsubscribeRequest ThisMessage { 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 EntityIdFieldNumber = 2; 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 { @@ -494,13 +590,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 = _unsubscribeRequestFieldNames; + if (hasAgentId) { + output.WriteMessage(1, field_names[0], AgentId); } - if (HasEntityId) { - output.WriteMessage(2, EntityId); + if (hasEntityId) { + output.WriteMessage(2, field_names[1], EntityId); } UnknownFields.WriteTo(output); } @@ -512,10 +609,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(1, AgentId); } - if (HasEntityId) { + if (hasEntityId) { size += pb::CodedOutputStream.ComputeMessageSize(2, EntityId); } size += UnknownFields.SerializedSize; @@ -548,38 +645,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 { @@ -591,12 +722,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) { @@ -610,6 +740,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(UnsubscribeRequest other) { if (other == global::bnet.protocol.presence.UnsubscribeRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasAgentId) { MergeAgentId(other.AgentId); } @@ -620,20 +751,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)) { @@ -645,12 +787,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); @@ -659,7 +801,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasEntityId) { + if (result.hasEntityId) { subBuilder.MergeFrom(EntityId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -668,11 +810,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; } @@ -680,19 +827,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 { @@ -702,13 +852,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 HasEntityId { - get { return result.HasEntityId; } + get { return result.hasEntityId; } } public global::bnet.protocol.EntityId EntityId { get { return result.EntityId; } @@ -716,19 +867,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 { @@ -738,8 +892,9 @@ 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; } } @@ -748,14 +903,20 @@ static UnsubscribeRequest() { } } + [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 static readonly UpdateRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override UpdateRequest ThisMessage { @@ -772,12 +933,12 @@ protected override UpdateRequest ThisMessage { 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; @@ -803,13 +964,14 @@ 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 = _updateRequestFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); } - foreach (global::bnet.protocol.presence.FieldOperation element in FieldOperationList) { - output.WriteMessage(2, element); + if (fieldOperation_.Count > 0) { + output.WriteMessageArray(2, field_names[1], fieldOperation_); } UnknownFields.WriteTo(output); } @@ -821,7 +983,7 @@ 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) { @@ -857,38 +1019,73 @@ public static UpdateRequest ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static UpdateRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static UpdateRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(UpdateRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - UpdateRequest result = new UpdateRequest(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new UpdateRequest(); + 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 { @@ -900,13 +1097,11 @@ public override UpdateRequest DefaultInstanceForType { } public override UpdateRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.fieldOperation_.MakeReadOnly(); - UpdateRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -920,30 +1115,42 @@ public override Builder MergeFrom(pb::IMessage other) { 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) { - base.AddRange(other.fieldOperation_, result.fieldOperation_); + result.fieldOperation_.Add(other.fieldOperation_); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -955,12 +1162,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); @@ -968,18 +1175,21 @@ 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; } } } + + 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; } @@ -987,19 +1197,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 { @@ -1009,13 +1222,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; } @@ -1025,29 +1239,35 @@ 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; } @@ -1057,14 +1277,20 @@ static UpdateRequest() { } } + [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 static readonly QueryRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override QueryRequest ThisMessage { @@ -1081,12 +1307,12 @@ protected override QueryRequest ThisMessage { 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 KeyFieldNumber = 2; @@ -1112,13 +1338,14 @@ 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 = _queryRequestFieldNames; + if (hasEntityId) { + output.WriteMessage(1, field_names[0], EntityId); } - foreach (global::bnet.protocol.presence.FieldKey element in KeyList) { - output.WriteMessage(2, element); + if (key_.Count > 0) { + output.WriteMessageArray(2, field_names[1], key_); } UnknownFields.WriteTo(output); } @@ -1130,7 +1357,7 @@ 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.FieldKey element in KeyList) { @@ -1166,38 +1393,73 @@ public static QueryRequest ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static QueryRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(QueryRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - QueryRequest result = new QueryRequest(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QueryRequest(); + 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 { @@ -1209,13 +1471,11 @@ public override QueryRequest DefaultInstanceForType { } public override QueryRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.key_.MakeReadOnly(); - QueryRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1229,30 +1489,42 @@ public override Builder MergeFrom(pb::IMessage other) { 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) { - base.AddRange(other.key_, result.key_); + result.key_.Add(other.key_); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1264,12 +1536,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); @@ -1277,18 +1549,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 18: { - global::bnet.protocol.presence.FieldKey.Builder subBuilder = global::bnet.protocol.presence.FieldKey.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddKey(subBuilder.BuildPartial()); + 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; } + get { return result.hasEntityId; } } public global::bnet.protocol.EntityId EntityId { get { return result.EntityId; } @@ -1296,19 +1571,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 { @@ -1318,13 +1596,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 KeyList { - get { return result.key_; } + get { return PrepareBuilder().key_; } } public int KeyCount { get { return result.KeyCount; } @@ -1334,29 +1613,35 @@ public int KeyCount { } 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) { - base.AddRange(values, result.key_); + PrepareBuilder(); + result.key_.Add(values); return this; } public Builder ClearKey() { + PrepareBuilder(); result.key_.Clear(); return this; } @@ -1366,14 +1651,20 @@ static QueryRequest() { } } + [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 static readonly QueryResponse defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override QueryResponse ThisMessage { @@ -1409,10 +1700,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.presence.Field element in FieldList) { - output.WriteMessage(2, element); + string[] field_names = _queryResponseFieldNames; + if (field_.Count > 0) { + output.WriteMessageArray(2, field_names[0], field_); } UnknownFields.WriteTo(output); } @@ -1457,38 +1749,73 @@ public static QueryResponse ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static QueryResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static QueryResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(QueryResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - QueryResponse result = new QueryResponse(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new QueryResponse(); + 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 { @@ -1500,13 +1827,11 @@ public override QueryResponse DefaultInstanceForType { } public override QueryResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.field_.MakeReadOnly(); - QueryResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1520,27 +1845,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(QueryResponse other) { if (other == global::bnet.protocol.presence.QueryResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.field_.Count != 0) { - base.AddRange(other.field_, result.field_); + result.field_.Add(other.field_); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1552,22 +1889,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 18: { - global::bnet.protocol.presence.Field.Builder subBuilder = global::bnet.protocol.presence.Field.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddField(subBuilder.BuildPartial()); + 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 result.field_; } + get { return PrepareBuilder().field_; } } public int FieldCount { get { return result.FieldCount; } @@ -1577,29 +1917,35 @@ public int FieldCount { } 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) { - base.AddRange(values, result.field_); + PrepareBuilder(); + result.field_.Add(values); return this; } public Builder ClearField() { + PrepareBuilder(); result.field_.Clear(); return this; } @@ -1609,9 +1955,356 @@ static QueryResponse() { } } + [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.Presence.internal__static_bnet_protocol_presence_OwnershipRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.presence.Presence.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.Presence.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, @@ -1629,6 +2322,14 @@ 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 static pbd::ServiceDescriptor Descriptor { get { return Presence.Descriptor.Services[0]; } @@ -1667,6 +2368,16 @@ public void CallMethod( 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; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -1686,6 +2397,10 @@ public void CallMethod( 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; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -1705,6 +2420,10 @@ public void CallMethod( 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; default: throw new global::System.InvalidOperationException("Can't get here."); } @@ -1714,6 +2433,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.presence.PresenceService { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -1760,8 +2482,28 @@ public override void Query( 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)); + } } } #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 66% rename from source/D3Proto/bnet/protocol/presence/PresenceTypes.cs rename to src/LibMooNet/bnet/protocol/presence/PresenceTypes.cs index df849e1f..64d37f68 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 @@ -31,23 +36,24 @@ 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"); + "CjBzZXJ2aWNlL3ByZXNlbmNlL2RlZmluaXRpb24vcHJlc2VuY2VfdHlwZXMu" + + "cHJvdG8SFmJuZXQucHJvdG9jb2wucHJlc2VuY2UaHGxpYi9wcm90b2NvbC9h" + + "dHRyaWJ1dGUucHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJvdG8aLnNl" + + "cnZpY2UvY2hhbm5lbC9kZWZpbml0aW9uL2NoYW5uZWxfdHlwZXMucHJvdG8i" + + "SwoIRmllbGRLZXkSDwoHcHJvZ3JhbRgBIAIoDRINCgVncm91cBgCIAIoDRIN" + + "CgVmaWVsZBgDIAIoDRIQCgVpbmRleBgEIAEoBDoBMCJnCgVGaWVsZBItCgNr" + + "ZXkYASACKAsyIC5ibmV0LnByb3RvY29sLnByZXNlbmNlLkZpZWxkS2V5Ei8K" + + "BXZhbHVlGAIgAigLMiAuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuVmFyaWFu" + + "dCKxAQoORmllbGRPcGVyYXRpb24SLAoFZmllbGQYASACKAsyHS5ibmV0LnBy" + + "b3RvY29sLnByZXNlbmNlLkZpZWxkEkwKCW9wZXJhdGlvbhgCIAEoDjI0LmJu" + + "ZXQucHJvdG9jb2wucHJlc2VuY2UuRmllbGRPcGVyYXRpb24uT3BlcmF0aW9u" + + "VHlwZToDU0VUIiMKDU9wZXJhdGlvblR5cGUSBwoDU0VUEAASCQoFQ0xFQVIQ" + + "ASLwAQoMQ2hhbm5lbFN0YXRlEioKCWVudGl0eV9pZBgBIAEoCzIXLmJuZXQu" + + "cHJvdG9jb2wuRW50aXR5SWQSPwoPZmllbGRfb3BlcmF0aW9uGAIgAygLMiYu" + + "Ym5ldC5wcm90b2NvbC5wcmVzZW5jZS5GaWVsZE9wZXJhdGlvbhIWCgdoZWFs" + + "aW5nGAMgASgIOgVmYWxzZTJbCghwcmVzZW5jZRIjLmJuZXQucHJvdG9jb2wu" + + "Y2hhbm5lbC5DaGFubmVsU3RhdGUYZSABKAsyJC5ibmV0LnByb3RvY29sLnBy" + + "ZXNlbmNlLkNoYW5uZWxTdGF0ZQ=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_presence_FieldKey__Descriptor = Descriptor.MessageTypes[0]; @@ -65,7 +71,7 @@ static PresenceTypes() { internal__static_bnet_protocol_presence_ChannelState__Descriptor = Descriptor.MessageTypes[3]; 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 +86,20 @@ 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 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 +116,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 +126,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 +136,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 +146,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 +163,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 +188,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 +230,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; + } - FieldKey result = new FieldKey(); + private bool resultIsReadOnly; + private FieldKey result; + + private FieldKey PrepareBuilder() { + if (resultIsReadOnly) { + FieldKey original = result; + result = new FieldKey(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +307,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 +325,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 +342,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 +378,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 +492,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 +522,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 +545,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 +569,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 +605,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; + } - Field result = new Field(); + private bool resultIsReadOnly; + private Field result; + + private Field PrepareBuilder() { + if (resultIsReadOnly) { + Field original = result; + result = new Field(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +682,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 +700,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 +711,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 +747,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 +761,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 +770,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 +787,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 +812,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 +827,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 +852,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 +863,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 +892,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 +908,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 +934,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 +953,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 +989,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 +1066,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 +1084,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 +1095,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 +1131,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 +1144,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 +1174,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 +1199,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 +1230,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 +1262,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 +1282,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 +1304,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 +1326,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 +1365,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; + } + + private bool resultIsReadOnly; + private ChannelState result; + + private ChannelState PrepareBuilder() { + if (resultIsReadOnly) { + ChannelState original = result; + result = new ChannelState(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - ChannelState result = new ChannelState(); + 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 +1443,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 +1461,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 +1511,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 +1524,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 +1550,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 +1575,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 +1592,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 +1653,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 68% rename from source/D3Proto/bnet/protocol/profanity/Profanity.cs rename to src/LibMooNet/bnet/protocol/profanity/Profanity.cs index 4bcae78c..05c58c62 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 @@ -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/resources/Resources.cs b/src/LibMooNet/bnet/protocol/resources/Resources.cs new file mode 100644 index 00000000..e7670731 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/resources/Resources.cs @@ -0,0 +1,524 @@ +// 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 { + + 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 Resources { + + #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 Resources() { + byte[] descriptorData = global::System.Convert.FromBase64String( + "CixzZXJ2aWNlL3Jlc291cmNlcy9kZWZpbml0aW9uL3Jlc291cmNlcy5wcm90" + + "bxIXYm5ldC5wcm90b2NvbC5yZXNvdXJjZXMaIWxpYi9wcm90b2NvbC9jb250" + + "ZW50X2hhbmRsZS5wcm90bxoRbGliL3JwYy9ycGMucHJvdG8iWQoUQ29udGVu" + + "dEhhbmRsZVJlcXVlc3QSEgoKcHJvZ3JhbV9pZBgBIAIoBxIRCglzdHJlYW1f" + + "aWQYAiACKAcSGgoGbG9jYWxlGAMgASgHOgoxNzAxNzI5NjE5MnIKCVJlc291" + + "cmNlcxJlChBHZXRDb250ZW50SGFuZGxlEi0uYm5ldC5wcm90b2NvbC5yZXNv" + + "dXJjZXMuQ29udGVudEhhbmRsZVJlcXVlc3QaHC5ibmV0LnByb3RvY29sLkNv" + + "bnRlbnRIYW5kbGUiBIC1GAFCA4ABAA=="); + 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.Proto.Resources.internal__static_bnet_protocol_resources_ContentHandleRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.resources.Proto.Resources.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.Proto.Resources.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 Proto.Resources.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/source/D3Proto/bnet/protocol/search/Search.cs b/src/LibMooNet/bnet/protocol/search/Search.cs similarity index 50% rename from source/D3Proto/bnet/protocol/search/Search.cs rename to src/LibMooNet/bnet/protocol/search/Search.cs index 066bddff..c11d15e4 100644 --- a/source/D3Proto/bnet/protocol/search/Search.cs +++ b/src/LibMooNet/bnet/protocol/search/Search.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 Search { #region Extension registration @@ -23,6 +28,10 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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; + 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 { @@ -32,23 +41,29 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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=="); + "CiZzZXJ2aWNlL3NlYXJjaC9kZWZpbml0aW9uL3NlYXJjaC5wcm90bxIUYm5l" + + "dC5wcm90b2NvbC5zZWFyY2gaEWxpYi9ycGMvcnBjLnByb3RvGixzZXJ2aWNl" + + "L3NlYXJjaC9kZWZpbml0aW9uL3NlYXJjaF90eXBlcy5wcm90byKCAQoSRmlu" + + "ZE1hdGNoZXNSZXF1ZXN0EhAKCHVuaXZlcnNlGAEgAigJEi0KB2ZpbHRlcnMY" + + "AiADKAsyHC5ibmV0LnByb3RvY29sLnNlYXJjaC5GaWx0ZXISGQoOc3RhcnRp" + + "bmdfaW5kZXgYAyABKA06ATASEAoFY291bnQYBCABKA06ATAiWQoTRmluZE1h" + + "dGNoZXNSZXNwb25zZRITCgt0b3RhbF9jb3VudBgBIAIoDRItCgdvYmplY3Rz" + + "GAIgAygLMhwuYm5ldC5wcm90b2NvbC5zZWFyY2guT2JqZWN0IkEKEFNldE9i" + + "amVjdFJlcXVlc3QSLQoHb2JqZWN0cxgBIAMoCzIcLmJuZXQucHJvdG9jb2wu" + + "c2VhcmNoLk9iamVjdCI4ChRSZW1vdmVPYmplY3RzUmVxdWVzdBIQCghzdGFy" + + "dF9pZBgBIAIoDBIOCgZlbmRfaWQYAiACKAwiDgoMU2VhcmNoQ29uZmlnInYK" + + "G1NlYXJjaFVuaXZlcnNlTGljZW5zZUNvbmZpZxIQCgh1bml2ZXJzZRgBIAIo" + + "CRIhChZzZWFyY2hfZW5hYmxlZF9saWNlbnNlGAIgASgNOgEwEiIKF3NlYXJj" + + "aF9kaXNhYmxlZF9saWNlbnNlGAMgASgNOgEwImMKE1NlYXJjaExpY2Vuc2VD" + + "b25maWcSTAoRdW5pdmVyc2VfbGljZW5zZXMYASADKAsyMS5ibmV0LnByb3Rv" + + "Y29sLnNlYXJjaC5TZWFyY2hVbml2ZXJzZUxpY2Vuc2VDb25maWcyrwIKDVNl" + + "YXJjaFNlcnZpY2USaAoLRmluZE1hdGNoZXMSKC5ibmV0LnByb3RvY29sLnNl" + + "YXJjaC5GaW5kTWF0Y2hlc1JlcXVlc3QaKS5ibmV0LnByb3RvY29sLnNlYXJj" + + "aC5GaW5kTWF0Y2hlc1Jlc3BvbnNlIgSAtRgBElUKCVNldE9iamVjdBImLmJu" + + "ZXQucHJvdG9jb2wuc2VhcmNoLlNldE9iamVjdFJlcXVlc3QaGi5ibmV0LnBy" + + "b3RvY29sLk5PX1JFU1BPTlNFIgSAtRgCEl0KDVJlbW92ZU9iamVjdHMSKi5i" + + "bmV0LnByb3RvY29sLnNlYXJjaC5SZW1vdmVPYmplY3RzUmVxdWVzdBoaLmJu" + + "ZXQucHJvdG9jb2wuTk9fUkVTUE9OU0UiBIC1GANCA4ABAA=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_search_FindMatchesRequest__Descriptor = Descriptor.MessageTypes[0]; @@ -71,7 +86,19 @@ static Search() { internal__static_bnet_protocol_search_SearchConfig__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_search_SearchConfig__Descriptor, new string[] { }); - return null; + internal__static_bnet_protocol_search_SearchUniverseLicenseConfig__Descriptor = Descriptor.MessageTypes[5]; + 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[6]; + 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[] { @@ -83,14 +110,20 @@ static Search() { } #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 static readonly FindMatchesRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override FindMatchesRequest ThisMessage { @@ -129,7 +162,7 @@ public int FiltersCount { public const int StartingIndexFieldNumber = 3; private bool hasStartingIndex; - private uint startingIndex_ = 0; + private uint startingIndex_; public bool HasStartingIndex { get { return hasStartingIndex; } } @@ -139,7 +172,7 @@ public uint StartingIndex { public const int CountFieldNumber = 4; private bool hasCount; - private uint count_ = 0; + private uint count_; public bool HasCount { get { return hasCount; } } @@ -157,19 +190,20 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasUniverse) { - output.WriteString(1, Universe); + string[] field_names = _findMatchesRequestFieldNames; + if (hasUniverse) { + output.WriteString(1, field_names[3], Universe); } - foreach (global::bnet.protocol.search.Filter element in FiltersList) { - output.WriteMessage(2, element); + if (filters_.Count > 0) { + output.WriteMessageArray(2, field_names[1], filters_); } - if (HasStartingIndex) { - output.WriteUInt32(3, StartingIndex); + if (hasStartingIndex) { + output.WriteUInt32(3, field_names[2], StartingIndex); } - if (HasCount) { - output.WriteUInt32(4, Count); + if (hasCount) { + output.WriteUInt32(4, field_names[0], Count); } UnknownFields.WriteTo(output); } @@ -181,16 +215,16 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasUniverse) { + 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) { + if (hasStartingIndex) { size += pb::CodedOutputStream.ComputeUInt32Size(3, StartingIndex); } - if (HasCount) { + if (hasCount) { size += pb::CodedOutputStream.ComputeUInt32Size(4, Count); } size += UnknownFields.SerializedSize; @@ -223,38 +257,73 @@ public static FindMatchesRequest ParseDelimitedFrom(global::System.IO.Stream inp 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) { + public static FindMatchesRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FindMatchesRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - FindMatchesRequest result = new FindMatchesRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override FindMatchesRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new FindMatchesRequest(); + 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 { @@ -266,13 +335,11 @@ public override FindMatchesRequest DefaultInstanceForType { } public override FindMatchesRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.filters_.MakeReadOnly(); - FindMatchesRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -286,11 +353,12 @@ public override Builder MergeFrom(pb::IMessage other) { 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) { - base.AddRange(other.filters_, result.filters_); + result.filters_.Add(other.filters_); } if (other.HasStartingIndex) { StartingIndex = other.StartingIndex; @@ -302,20 +370,31 @@ public override Builder MergeFrom(FindMatchesRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -327,34 +406,37 @@ 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: { - Universe = input.ReadString(); + result.hasUniverse = input.ReadString(ref result.universe_); break; } case 18: { - global::bnet.protocol.search.Filter.Builder subBuilder = global::bnet.protocol.search.Filter.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddFilters(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.filters_, global::bnet.protocol.search.Filter.DefaultInstance, extensionRegistry); break; } case 24: { - StartingIndex = input.ReadUInt32(); + result.hasStartingIndex = input.ReadUInt32(ref result.startingIndex_); break; } case 32: { - Count = input.ReadUInt32(); + result.hasCount = input.ReadUInt32(ref result.count_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasUniverse { - get { return result.HasUniverse; } + get { return result.hasUniverse; } } public string Universe { get { return result.Universe; } @@ -362,18 +444,20 @@ public string Universe { } 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 result.filters_; } + get { return PrepareBuilder().filters_; } } public int FiltersCount { get { return result.FiltersCount; } @@ -383,64 +467,74 @@ public int FiltersCount { } 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) { - base.AddRange(values, result.filters_); + PrepareBuilder(); + result.filters_.Add(values); return this; } public Builder ClearFilters() { + PrepareBuilder(); result.filters_.Clear(); return this; } public bool HasStartingIndex { - get { return result.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; } + 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; @@ -451,14 +545,20 @@ static FindMatchesRequest() { } } + [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 static readonly FindMatchesResponse defaultInstance = new Builder().BuildPartial(); + private FindMatchesResponse() { } + private static readonly FindMatchesResponse defaultInstance = new FindMatchesResponse().MakeReadOnly(); + private static readonly string[] _findMatchesResponseFieldNames = new string[] { "objects", "total_count" }; + private static readonly uint[] _findMatchesResponseFieldTags = new uint[] { 18, 8 }; public static FindMatchesResponse DefaultInstance { get { return defaultInstance; } } public override FindMatchesResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override FindMatchesResponse ThisMessage { @@ -475,7 +575,7 @@ protected override FindMatchesResponse ThisMessage { public const int TotalCountFieldNumber = 1; private bool hasTotalCount; - private uint totalCount_ = 0; + private uint totalCount_; public bool HasTotalCount { get { return hasTotalCount; } } @@ -505,13 +605,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasTotalCount) { - output.WriteUInt32(1, TotalCount); + string[] field_names = _findMatchesResponseFieldNames; + if (hasTotalCount) { + output.WriteUInt32(1, field_names[1], TotalCount); } - foreach (global::bnet.protocol.search.Object element in ObjectsList) { - output.WriteMessage(2, element); + if (objects_.Count > 0) { + output.WriteMessageArray(2, field_names[0], objects_); } UnknownFields.WriteTo(output); } @@ -523,7 +624,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasTotalCount) { + if (hasTotalCount) { size += pb::CodedOutputStream.ComputeUInt32Size(1, TotalCount); } foreach (global::bnet.protocol.search.Object element in ObjectsList) { @@ -559,38 +660,73 @@ public static FindMatchesResponse ParseDelimitedFrom(global::System.IO.Stream in 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) { + public static FindMatchesResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static FindMatchesResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(FindMatchesResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - FindMatchesResponse result = new FindMatchesResponse(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new FindMatchesResponse(); + 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 { @@ -602,13 +738,11 @@ public override FindMatchesResponse DefaultInstanceForType { } public override FindMatchesResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.objects_.MakeReadOnly(); - FindMatchesResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -622,30 +756,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(FindMatchesResponse other) { if (other == global::bnet.protocol.search.FindMatchesResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasTotalCount) { TotalCount = other.TotalCount; } if (other.objects_.Count != 0) { - base.AddRange(other.objects_, result.objects_); + result.objects_.Add(other.objects_); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -657,44 +803,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: { - TotalCount = input.ReadUInt32(); + result.hasTotalCount = input.ReadUInt32(ref result.totalCount_); break; } case 18: { - global::bnet.protocol.search.Object.Builder subBuilder = global::bnet.protocol.search.Object.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddObjects(subBuilder.BuildPartial()); + 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 bool HasTotalCount { - get { return result.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; } public pbc::IPopsicleList ObjectsList { - get { return result.objects_; } + get { return PrepareBuilder().objects_; } } public int ObjectsCount { get { return result.ObjectsCount; } @@ -704,29 +855,35 @@ public int ObjectsCount { } 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) { - base.AddRange(values, result.objects_); + PrepareBuilder(); + result.objects_.Add(values); return this; } public Builder ClearObjects() { + PrepareBuilder(); result.objects_.Clear(); return this; } @@ -736,14 +893,20 @@ static FindMatchesResponse() { } } + [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 static readonly SetObjectRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override SetObjectRequest ThisMessage { @@ -779,10 +942,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.search.Object element in ObjectsList) { - output.WriteMessage(1, element); + string[] field_names = _setObjectRequestFieldNames; + if (objects_.Count > 0) { + output.WriteMessageArray(1, field_names[0], objects_); } UnknownFields.WriteTo(output); } @@ -827,38 +991,73 @@ public static SetObjectRequest ParseDelimitedFrom(global::System.IO.Stream input 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) { + public static SetObjectRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SetObjectRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(SetObjectRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SetObjectRequest result = new SetObjectRequest(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SetObjectRequest(); + 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 { @@ -870,13 +1069,11 @@ public override SetObjectRequest DefaultInstanceForType { } public override SetObjectRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.objects_.MakeReadOnly(); - SetObjectRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -890,27 +1087,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SetObjectRequest other) { if (other == global::bnet.protocol.search.SetObjectRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.objects_.Count != 0) { - base.AddRange(other.objects_, result.objects_); + result.objects_.Add(other.objects_); } 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -922,22 +1131,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.search.Object.Builder subBuilder = global::bnet.protocol.search.Object.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddObjects(subBuilder.BuildPartial()); + 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 result.objects_; } + get { return PrepareBuilder().objects_; } } public int ObjectsCount { get { return result.ObjectsCount; } @@ -947,29 +1159,35 @@ public int ObjectsCount { } 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) { - base.AddRange(values, result.objects_); + PrepareBuilder(); + result.objects_.Add(values); return this; } public Builder ClearObjects() { + PrepareBuilder(); result.objects_.Clear(); return this; } @@ -979,14 +1197,20 @@ static SetObjectRequest() { } } + [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 static readonly RemoveObjectsRequest defaultInstance = new Builder().BuildPartial(); + 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; } + get { return DefaultInstance; } } protected override RemoveObjectsRequest ThisMessage { @@ -1029,13 +1253,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasStartId) { - output.WriteBytes(1, StartId); + string[] field_names = _removeObjectsRequestFieldNames; + if (hasStartId) { + output.WriteBytes(1, field_names[1], StartId); } - if (HasEndId) { - output.WriteBytes(2, EndId); + if (hasEndId) { + output.WriteBytes(2, field_names[0], EndId); } UnknownFields.WriteTo(output); } @@ -1047,10 +1272,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasStartId) { + if (hasStartId) { size += pb::CodedOutputStream.ComputeBytesSize(1, StartId); } - if (HasEndId) { + if (hasEndId) { size += pb::CodedOutputStream.ComputeBytesSize(2, EndId); } size += UnknownFields.SerializedSize; @@ -1083,38 +1308,72 @@ public static RemoveObjectsRequest ParseDelimitedFrom(global::System.IO.Stream i 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) { + public static RemoveObjectsRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static RemoveObjectsRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - RemoveObjectsRequest result = new RemoveObjectsRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override RemoveObjectsRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new RemoveObjectsRequest(); + 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 { @@ -1126,12 +1385,11 @@ public override RemoveObjectsRequest DefaultInstanceForType { } public override RemoveObjectsRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - RemoveObjectsRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1145,6 +1403,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(RemoveObjectsRequest other) { if (other == global::bnet.protocol.search.RemoveObjectsRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasStartId) { StartId = other.StartId; } @@ -1155,20 +1414,31 @@ public override Builder MergeFrom(RemoveObjectsRequest 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1180,24 +1450,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: { - StartId = input.ReadBytes(); + result.hasStartId = input.ReadBytes(ref result.startId_); break; } case 18: { - EndId = input.ReadBytes(); + result.hasEndId = input.ReadBytes(ref result.endId_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasStartId { - get { return result.HasStartId; } + get { return result.hasStartId; } } public pb::ByteString StartId { get { return result.StartId; } @@ -1205,18 +1480,20 @@ public bool HasStartId { } 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; } + get { return result.hasEndId; } } public pb::ByteString EndId { get { return result.EndId; } @@ -1224,11 +1501,13 @@ public bool HasEndId { } 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; @@ -1239,14 +1518,20 @@ static RemoveObjectsRequest() { } } + [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 static readonly SearchConfig defaultInstance = new Builder().BuildPartial(); + private SearchConfig() { } + private static readonly SearchConfig defaultInstance = new SearchConfig().MakeReadOnly(); + private static readonly string[] _searchConfigFieldNames = new string[] { }; + private static readonly uint[] _searchConfigFieldTags = new uint[] { }; public static SearchConfig DefaultInstance { get { return defaultInstance; } } public override SearchConfig DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SearchConfig ThisMessage { @@ -1267,8 +1552,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 = _searchConfigFieldNames; UnknownFields.WriteTo(output); } @@ -1309,38 +1595,72 @@ public static SearchConfig ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static SearchConfig ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SearchConfig ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(SearchConfig cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - SearchConfig result = new SearchConfig(); + 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 result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SearchConfig(); + 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 { @@ -1352,12 +1672,11 @@ public override SearchConfig DefaultInstanceForType { } public override SearchConfig BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SearchConfig returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1371,24 +1690,36 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SearchConfig other) { if (other == global::bnet.protocol.search.SearchConfig.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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1400,11 +1731,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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } @@ -1413,9 +1749,678 @@ static SearchConfig() { } } + [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.Search.internal__static_bnet_protocol_search_SearchUniverseLicenseConfig__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.search.Search.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.Search.Descriptor, 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.Search.internal__static_bnet_protocol_search_SearchLicenseConfig__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.search.Search.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.Search.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, @@ -1505,6 +2510,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.search.SearchService { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -1547,3 +2555,5 @@ public override void RemoveObjects( #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..103b704a 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,19 @@ 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"); + "CixzZXJ2aWNlL3NlYXJjaC9kZWZpbml0aW9uL3NlYXJjaF90eXBlcy5wcm90" + + "bxIUYm5ldC5wcm90b2NvbC5zZWFyY2giKQoJU3RhdGlzdGljEg0KAmlkGAEg" + + "ASgEOgEwEg0KBXZhbHVlGAIgAigFItMCCgZGaWx0ZXISMgoJc3RhdGlzdGlj" + + "GAEgAigLMh8uYm5ldC5wcm90b2NvbC5zZWFyY2guU3RhdGlzdGljEjkKCWNv" + + "bXBhcmFuZBgCIAIoDjImLmJuZXQucHJvdG9jb2wuc2VhcmNoLkZpbHRlci5D" + + "b21wYXJhbmQSRwoOc29ydF9kaXJlY3Rpb24YAyABKA4yKi5ibmV0LnByb3Rv" + + "Y29sLnNlYXJjaC5GaWx0ZXIuU29ydERpcmVjdGlvbjoDQVNDIm0KCUNvbXBh" + + "cmFuZBIKCgZFUVVBTFMQABINCglMRVNTX1RIQU4QARIXChNMRVNTX1RIQU5f" + + "T1JfRVFVQUxTEAISEAoMR1JFQVRFUl9USEFOEAMSGgoWR1JFQVRFUl9USEFO" + + "X09SX0VRVUFMUxAEIiIKDVNvcnREaXJlY3Rpb24SBwoDQVNDEAASCAoEREVT" + + "QxABIlcKBk9iamVjdBIKCgJpZBgBIAIoDBIMCgRkYXRhGAIgASgMEjMKCnN0" + + "YXRpc3RpY3MYAyADKAsyHy5ibmV0LnByb3RvY29sLnNlYXJjaC5TdGF0aXN0" + + "aWM="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_search_Statistic__Descriptor = Descriptor.MessageTypes[0]; @@ -64,14 +70,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 +100,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 +125,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 +144,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 +180,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 +257,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 +275,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 +286,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 +322,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 +388,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 +417,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 +431,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 +443,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 +480,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 +502,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 +541,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 +618,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 +636,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 +650,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 +686,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 +699,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 +741,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 +766,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 +817,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 +887,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 +909,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 +948,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 +1026,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 +1044,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 +1052,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 +1094,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 +1128,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 +1149,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 +1172,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 +1213,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/ServerPool.cs similarity index 68% rename from source/D3Proto/bnet/protocol/server_pool/ServerPool.cs rename to src/LibMooNet/bnet/protocol/server_pool/ServerPool.cs index 14c36650..dcd449a1 100644 --- a/source/D3Proto/bnet/protocol/server_pool/ServerPool.cs +++ b/src/LibMooNet/bnet/protocol/server_pool/ServerPool.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.server_pool { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class ServerPool { #region Extension registration @@ -32,21 +37,21 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { static ServerPool() { byte[] descriptorData = global::System.Convert.FromBase64String( - "CiVzZXJ2aWNlL3NlcnZlcl9wb29sL3NlcnZlcl9wb29sLnByb3RvEhlibmV0" + - "LnByb3RvY29sLnNlcnZlcl9wb29sGhxsaWIvcHJvdG9jb2wvYXR0cmlidXRl" + - "LnByb3RvGhFsaWIvcnBjL3JwYy5wcm90byIQCg5HZXRMb2FkUmVxdWVzdCJW" + - "CgtTZXJ2ZXJTdGF0ZRIXCgxjdXJyZW50X2xvYWQYASABKAI6ATESFQoKZ2Ft" + - "ZV9jb3VudBgCIAEoBToBMBIXCgxwbGF5ZXJfY291bnQYAyABKAU6ATAizgEK" + - "ClNlcnZlckluZm8SJgoEaG9zdBgBIAIoCzIYLmJuZXQucHJvdG9jb2wuUHJv" + - "Y2Vzc0lkEhYKB3JlcGxhY2UYAiABKAg6BWZhbHNlEjUKBXN0YXRlGAMgASgL" + - "MiYuYm5ldC5wcm90b2NvbC5zZXJ2ZXJfcG9vbC5TZXJ2ZXJTdGF0ZRI1Cglh" + - "dHRyaWJ1dGUYBCADKAsyIi5ibmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRy" + - "aWJ1dGUSEgoKcHJvZ3JhbV9pZBgFIAEoByISChBQb29sU3RhdGVSZXF1ZXN0" + - "IkgKEVBvb2xTdGF0ZVJlc3BvbnNlEjMKBGluZm8YASADKAsyJS5ibmV0LnBy" + - "b3RvY29sLnNlcnZlcl9wb29sLlNlcnZlckluZm8yfgoRU2VydmVyUG9vbFNl" + - "cnZpY2USaQoMR2V0UG9vbFN0YXRlEisuYm5ldC5wcm90b2NvbC5zZXJ2ZXJf" + - "cG9vbC5Qb29sU3RhdGVSZXF1ZXN0GiwuYm5ldC5wcm90b2NvbC5zZXJ2ZXJf" + - "cG9vbC5Qb29sU3RhdGVSZXNwb25zZUIDgAEB"); + "CjBzZXJ2aWNlL3NlcnZlcl9wb29sL2RlZmluaXRpb24vc2VydmVyX3Bvb2wu" + + "cHJvdG8SGWJuZXQucHJvdG9jb2wuc2VydmVyX3Bvb2waHGxpYi9wcm90b2Nv" + + "bC9hdHRyaWJ1dGUucHJvdG8aEWxpYi9ycGMvcnBjLnByb3RvIhAKDkdldExv" + + "YWRSZXF1ZXN0IlYKC1NlcnZlclN0YXRlEhcKDGN1cnJlbnRfbG9hZBgBIAEo" + + "AjoBMRIVCgpnYW1lX2NvdW50GAIgASgFOgEwEhcKDHBsYXllcl9jb3VudBgD" + + "IAEoBToBMCLOAQoKU2VydmVySW5mbxImCgRob3N0GAEgAigLMhguYm5ldC5w" + + "cm90b2NvbC5Qcm9jZXNzSWQSFgoHcmVwbGFjZRgCIAEoCDoFZmFsc2USNQoF" + + "c3RhdGUYAyABKAsyJi5ibmV0LnByb3RvY29sLnNlcnZlcl9wb29sLlNlcnZl" + + "clN0YXRlEjUKCWF0dHJpYnV0ZRgEIAMoCzIiLmJuZXQucHJvdG9jb2wuYXR0" + + "cmlidXRlLkF0dHJpYnV0ZRISCgpwcm9ncmFtX2lkGAUgASgHIhIKEFBvb2xT" + + "dGF0ZVJlcXVlc3QiSAoRUG9vbFN0YXRlUmVzcG9uc2USMwoEaW5mbxgBIAMo" + + "CzIlLmJuZXQucHJvdG9jb2wuc2VydmVyX3Bvb2wuU2VydmVySW5mbzKEAQoR" + + "U2VydmVyUG9vbFNlcnZpY2USbwoMR2V0UG9vbFN0YXRlEisuYm5ldC5wcm90" + + "b2NvbC5zZXJ2ZXJfcG9vbC5Qb29sU3RhdGVSZXF1ZXN0GiwuYm5ldC5wcm90" + + "b2NvbC5zZXJ2ZXJfcG9vbC5Qb29sU3RhdGVSZXNwb25zZSIEgLUYAUIDgAEA"); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_server_pool_GetLoadRequest__Descriptor = Descriptor.MessageTypes[0]; @@ -69,7 +74,11 @@ static ServerPool() { 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; + 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[] { @@ -81,14 +90,20 @@ static ServerPool() { } #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 { @@ -109,8 +124,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 +167,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; + } + + private bool resultIsReadOnly; + private GetLoadRequest result; + + private GetLoadRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetLoadRequest original = result; + result = new GetLoadRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - GetLoadRequest result = new GetLoadRequest(); + 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 +244,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 +262,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,11 +303,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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } @@ -255,14 +321,20 @@ static GetLoadRequest() { } } + [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 { @@ -289,7 +361,7 @@ public float CurrentLoad { public const int GameCountFieldNumber = 2; private bool hasGameCount; - private int gameCount_ = 0; + private int gameCount_; public bool HasGameCount { get { return hasGameCount; } } @@ -299,7 +371,7 @@ public int GameCount { public const int PlayerCountFieldNumber = 3; private bool hasPlayerCount; - private int playerCount_ = 0; + private int playerCount_; public bool HasPlayerCount { get { return hasPlayerCount; } } @@ -313,16 +385,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.WriteInt32(2, field_names[1], GameCount); } - if (HasPlayerCount) { - output.WriteInt32(3, PlayerCount); + if (hasPlayerCount) { + output.WriteInt32(3, field_names[2], PlayerCount); } UnknownFields.WriteTo(output); } @@ -334,13 +407,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasCurrentLoad) { + if (hasCurrentLoad) { size += pb::CodedOutputStream.ComputeFloatSize(1, CurrentLoad); } - if (HasGameCount) { + if (hasGameCount) { size += pb::CodedOutputStream.ComputeInt32Size(2, GameCount); } - if (HasPlayerCount) { + if (hasPlayerCount) { size += pb::CodedOutputStream.ComputeInt32Size(3, PlayerCount); } size += UnknownFields.SerializedSize; @@ -373,38 +446,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; + } + + private bool resultIsReadOnly; + private ServerState result; + + private ServerState PrepareBuilder() { + if (resultIsReadOnly) { + ServerState original = result; + result = new ServerState(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - ServerState result = new ServerState(); + 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 +523,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 +541,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 +555,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,75 +591,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: { - CurrentLoad = input.ReadFloat(); + result.hasCurrentLoad = input.ReadFloat(ref result.currentLoad_); break; } case 16: { - GameCount = input.ReadInt32(); + result.hasGameCount = input.ReadInt32(ref result.gameCount_); break; } case 24: { - PlayerCount = input.ReadInt32(); + result.hasPlayerCount = input.ReadInt32(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 { get { return result.GameCount; } set { SetGameCount(value); } } public Builder SetGameCount(int 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 { get { return result.PlayerCount; } set { SetPlayerCount(value); } } public Builder SetPlayerCount(int value) { + PrepareBuilder(); result.hasPlayerCount = true; result.playerCount_ = value; return this; } public Builder ClearPlayerCount() { + PrepareBuilder(); result.hasPlayerCount = false; result.playerCount_ = 0; return this; @@ -552,14 +681,20 @@ static ServerState() { } } + [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 { @@ -576,17 +711,17 @@ protected override ServerInfo ThisMessage { 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 +731,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 +753,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 +772,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 +800,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 +845,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 +923,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 +941,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 +952,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 +961,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 +997,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 +1010,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 +1023,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 +1049,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 +1074,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 +1109,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 +1134,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,46 +1151,54 @@ 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; @@ -1007,14 +1209,20 @@ static ServerInfo() { } } + [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 { @@ -1035,8 +1243,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 +1286,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; - PoolStateRequest result = new PoolStateRequest(); + private PoolStateRequest PrepareBuilder() { + if (resultIsReadOnly) { + PoolStateRequest original = result; + result = new PoolStateRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +1363,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 +1381,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,11 +1422,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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } @@ -1181,14 +1440,20 @@ static PoolStateRequest() { } } + [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 { @@ -1224,10 +1489,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 +1538,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; + } - PoolStateResponse result = new PoolStateResponse(); + private bool resultIsReadOnly; + private PoolStateResponse result; + + private PoolStateResponse PrepareBuilder() { + if (resultIsReadOnly) { + PoolStateResponse original = result; + result = new PoolStateResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + 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 +1616,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 +1634,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 +1678,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,29 +1706,35 @@ 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; } @@ -1427,6 +1747,9 @@ static PoolStateResponse() { #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, @@ -1490,6 +1813,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 +1840,5 @@ public override void GetPoolState( #endregion } + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/storage/Storage.cs b/src/LibMooNet/bnet/protocol/storage/Storage.cs similarity index 64% rename from source/D3Proto/bnet/protocol/storage/Storage.cs rename to src/LibMooNet/bnet/protocol/storage/Storage.cs index 47b65966..b90be980 100644 --- a/source/D3Proto/bnet/protocol/storage/Storage.cs +++ b/src/LibMooNet/bnet/protocol/storage/Storage.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.storage { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class Storage { #region Extension registration @@ -21,8 +26,8 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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_Predicate__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_storage_Predicate__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; @@ -52,81 +57,87 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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"); + "CihzZXJ2aWNlL3N0b3JhZ2UvZGVmaW5pdGlvbi9zdG9yYWdlLnByb3RvEhVi" + + "bmV0LnByb3RvY29sLnN0b3JhZ2UaHWxpYi9wcm90b2NvbC9kZXNjcmlwdG9y" + + "LnByb3RvGhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3RvGhFsaWIvcnBjL3Jw" + + "Yy5wcm90byIXCgdUYWJsZUlkEgwKBGhhc2gYASACKAwiGAoIQ29sdW1uSWQS" + + "DAoEaGFzaBgBIAIoDCIVCgVSb3dJZBIMCgRoYXNoGAEgAigMInMKCVByaXZp" + + "bGVnZRIPCgRiaXRzGAEgASgGOgEwEhIKB3Byb2dyYW0YAiABKAc6ATAiQQoK" + + "UGVybWlzc2lvbhIJCgVPV05FUhABEgoKBkZSSUVORBACEgkKBU9USEVSEAQS" + + "CAoER0FNRRAIEgcKA0FMTBAPIocDCglQcmVkaWNhdGUSLwoCb3AYASACKA4y" + + "Iy5ibmV0LnByb3RvY29sLnN0b3JhZ2UuUHJlZGljYXRlLk9wEiIKBWZpZWxk" + + "GAIgAigLMhMuYm5ldC5wcm90b2NvbC5QYXRoEhUKCXNpbnRfZGF0YRgDIAMo" + + "EkICEAESFQoJdWludF9kYXRhGAQgAygEQgIQARIWCgpmbG9hdF9kYXRhGAUg" + + "AygCQgIQARIXCgtkb3VibGVfZGF0YRgGIAMoAUICEAESEgoKYnl0ZXNfZGF0" + + "YRgHIAMoDCKxAQoCT3ASDAoISVNfQ0xFQVIQARINCglOT1RfQ0xFQVIQAhIN" + + "CglJU19FUVVBTFMQAxIOCgpOT1RfRVFVQUxTEAQSEwoPSVNfR1JFQVRFUl9U" + + "SEFOEAUSFAoQTk9UX0dSRUFURVJfVEhBThAGEhAKDElTX0xFU1NfVEhBThAH" + + "EhEKDU5PVF9MRVNTX1RIQU4QCBIOCgpJU19CRVRXRUVOEAkSDwoLTk9UX0JF" + + "VFdFRU4QCiLYBgoHQ29tbWFuZBItCgJvcBgBIAIoDjIhLmJuZXQucHJvdG9j" + + "b2wuc3RvcmFnZS5Db21tYW5kLk9wEgwKBGRhdGEYAiABKAwSIwoGZmllbGRz" + + "GAMgAygLMhMuYm5ldC5wcm90b2NvbC5QYXRoEhMKC21pbl92ZXJzaW9uGAQg" + + "ASgGEhMKC21heF92ZXJzaW9uGAUgASgGEjMKCXByZWRpY2F0ZRgGIAMoCzIg" + + "LmJuZXQucHJvdG9jb2wuc3RvcmFnZS5QcmVkaWNhdGUSDQoFbGltaXQYByAB" + + "KA0SNgoJY29uZGl0aW9uGAggASgOMiMuYm5ldC5wcm90b2NvbC5zdG9yYWdl" + + "LkNvbW1hbmQuQ29uZBIPCgdtZXNzYWdlGAsgASgJEhYKB25vX2RhdGEYDCAB" + + "KAg6BWZhbHNlEhMKC3VzaW5nX2luZGV4GA0gASgJEhUKDWlucHV0X3ZlcnNp" + + "b24YDiABKAYitwIKAk9wEg4KClJPV19ERUxFVEUQARINCglST1dfRkVUQ0gQ" + + "AhIOCgpDT0xfREVMRVRFEAMSDQoJQ09MX0ZFVENIEAQSDQoJQ09MX1dSSVRF" + + "EAUSDQoJQ09MX01FUkdFEAYSDQoJRkxEX0NMRUFSEAcSDQoJRkxEX0ZFVENI" + + "EAgSDQoJRkxEX1dSSVRFEAkSDQoJRkxEX01FUkdFEAoSDAoIRkxEX0lOQ1IQ" + + "CxIMCghGTERfVEVTVBAMEgwKCEZMRF9TQ0FOEA0SDAoIUk9XX1RFU1QQDhIM" + + "CghDT0xfVEVTVBAPEgwKCEZMRF9TTUFYEBASDAoIQ09MX0NPTkQQERIMCghG" + + "TERfQ09ORBASEgwKCENPTkRfUE9QEBMSDQoJTE9HX0RFQlVHEBQSDAoIQ09M" + + "X0NPUFkQFSK1AQoEQ29uZBIPCgtDT05EX0FMV0FZUxAAEhMKD0NPTkRfTk9U" + + "X0VYSVNUUxABEhIKDkNPTkRfTk9UX0VRVUFMEAISEgoOQ09ORF9MRVNTX1RI" + + "QU4QAxIUChBDT05EX05PVF9HUkVBVEVSEAQSDwoLQ09ORF9FUVVBTFMQBRIR" + + "Cg1DT05EX05PVF9MRVNTEAYSFQoRQ09ORF9HUkVBVEVSX1RIQU4QBxIOCgpD" + + "T05EX05FVkVSEAgivAIKCU9wZXJhdGlvbhIwCgh0YWJsZV9pZBgBIAIoCzIe" + + "LmJuZXQucHJvdG9jb2wuc3RvcmFnZS5UYWJsZUlkEjIKCWNvbHVtbl9pZBgC" + + "IAEoCzIfLmJuZXQucHJvdG9jb2wuc3RvcmFnZS5Db2x1bW5JZBIsCgZyb3df" + + "aWQYAyABKAsyHC5ibmV0LnByb3RvY29sLnN0b3JhZ2UuUm93SWQSDwoHcm93" + + "X2tleRgEIAEoDBIPCgd2ZXJzaW9uGAUgASgGEiwKBHJvcHMYBiADKAsyHi5i" + + "bmV0LnByb3RvY29sLnN0b3JhZ2UuQ29tbWFuZBIWCg5tdXRhdGVfdmVyc2lv" + + "bhgHIAEoBhIzCglwcml2aWxlZ2UYCCABKAsyIC5ibmV0LnByb3RvY29sLnN0" + + "b3JhZ2UuUHJpdmlsZWdlIpgBCgRDZWxsEjIKCWNvbHVtbl9pZBgBIAIoCzIf" + + "LmJuZXQucHJvdG9jb2wuc3RvcmFnZS5Db2x1bW5JZBIsCgZyb3dfaWQYAiAC" + + "KAsyHC5ibmV0LnByb3RvY29sLnN0b3JhZ2UuUm93SWQSDwoHcm93X2tleRgD" + + "IAEoDBIPCgd2ZXJzaW9uGAQgASgGEgwKBGRhdGEYBSABKAwihQEKD09wZXJh" + + "dGlvblJlc3VsdBIVCgplcnJvcl9jb2RlGAEgASgNOgEwEjAKCHRhYmxlX2lk" + + "GAIgAigLMh4uYm5ldC5wcm90b2NvbC5zdG9yYWdlLlRhYmxlSWQSKQoEZGF0" + + "YRgDIAMoCzIbLmJuZXQucHJvdG9jb2wuc3RvcmFnZS5DZWxsItMBChBPcGVu" + + "VGFibGVSZXF1ZXN0EhcKBnNjaGVtYRgBIAEoCToHREVGQVVMVBIzCglwcml2" + + "aWxlZ2UYAiABKAsyIC5ibmV0LnByb3RvY29sLnN0b3JhZ2UuUHJpdmlsZWdl" + + "EjAKCHRhYmxlX2lkGAMgAigLMh4uYm5ldC5wcm90b2NvbC5zdG9yYWdlLlRh" + + "YmxlSWQSKQoIYWdlbnRfaWQYBCABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0" + + "eUlkEhQKDHByb2Nlc3NfbmFtZRgFIAEoCSITChFPcGVuVGFibGVSZXNwb25z" + + "ZSKcAgoRT3BlbkNvbHVtblJlcXVlc3QSFwoGc2NoZW1hGAEgASgJOgdERUZB" + + "VUxUEjMKCXByaXZpbGVnZRgCIAEoCzIgLmJuZXQucHJvdG9jb2wuc3RvcmFn" + + "ZS5Qcml2aWxlZ2USMAoIdGFibGVfaWQYBCACKAsyHi5ibmV0LnByb3RvY29s" + + "LnN0b3JhZ2UuVGFibGVJZBIyCgljb2x1bW5faWQYBSACKAsyHy5ibmV0LnBy" + + "b3RvY29sLnN0b3JhZ2UuQ29sdW1uSWQSEgoKcHJvdG9fdHlwZRgGIAEoCRIp" + + "CghhZ2VudF9pZBgHIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSFAoM" + + "cHJvY2Vzc19uYW1lGAggASgJIjUKEk9wZW5Db2x1bW5SZXNwb25zZRIfChBz" + + "ZXJ2ZXJfZmllbGRfb3BzGAIgASgIOgVmYWxzZSL9AgoORXhlY3V0ZVJlcXVl" + + "c3QSFwoGc2NoZW1hGAEgASgJOgdERUZBVUxUEjMKCXByaXZpbGVnZRgCIAEo" + + "CzIgLmJuZXQucHJvdG9jb2wuc3RvcmFnZS5Qcml2aWxlZ2USGAoJcmVhZF9v" + + "bmx5GAMgASgIOgVmYWxzZRIcCg13YW50c19yb3dfa2V5GAQgASgIOgVmYWxz" + + "ZRIgChF3YW50c19jb2x1bW5fbmFtZRgFIAEoCDoFZmFsc2USHwoNbWF4X2Rh" + + "dGFfc2l6ZRgGIAEoDToIMTY3NzcyMTUSNAoKb3BlcmF0aW9ucxgHIAMoCzIg" + + "LmJuZXQucHJvdG9jb2wuc3RvcmFnZS5PcGVyYXRpb24SDwoHdGltZW91dBgM" + + "IAEoDRIpCghhZ2VudF9pZBgJIAEoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5" + + "SWQSGgoKcXVlcnlfbmFtZRgKIAEoCToGTm9OYW1lEhQKDHByb2Nlc3NfbmFt" + + "ZRgLIAEoCSJ4Cg9FeGVjdXRlUmVzcG9uc2USFQoKZXJyb3JfY29kZRgBIAEo" + + "DToBMBI3CgdyZXN1bHRzGAIgAygLMiYuYm5ldC5wcm90b2NvbC5zdG9yYWdl" + + "Lk9wZXJhdGlvblJlc3VsdBIVCg1lcnJvcl9tZXNzYWdlGAMgASgJMsYCCg5T" + + "dG9yYWdlU2VydmljZRJlCgdFeGVjdXRlEiUuYm5ldC5wcm90b2NvbC5zdG9y" + + "YWdlLkV4ZWN1dGVSZXF1ZXN0GiYuYm5ldC5wcm90b2NvbC5zdG9yYWdlLkV4" + + "ZWN1dGVSZXNwb25zZSILgLUYAZW1GAAA8EESZAoJT3BlblRhYmxlEicuYm5l" + + "dC5wcm90b2NvbC5zdG9yYWdlLk9wZW5UYWJsZVJlcXVlc3QaKC5ibmV0LnBy" + + "b3RvY29sLnN0b3JhZ2UuT3BlblRhYmxlUmVzcG9uc2UiBIC1GAISZwoKT3Bl" + + "bkNvbHVtbhIoLmJuZXQucHJvdG9jb2wuc3RvcmFnZS5PcGVuQ29sdW1uUmVx" + + "dWVzdBopLmJuZXQucHJvdG9jb2wuc3RvcmFnZS5PcGVuQ29sdW1uUmVzcG9u" + + "c2UiBIC1GANCA4ABAA=="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_storage_TableId__Descriptor = Descriptor.MessageTypes[0]; @@ -145,14 +156,14 @@ static Storage() { 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_Predicate__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_storage_Predicate__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_storage_Predicate__Descriptor, + new string[] { "Op", "Field", "SintData", "UintData", "FloatData", "DoubleData", "BytesData", }); 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", }); + new string[] { "Op", "Data", "Fields", "MinVersion", "MaxVersion", "Predicate", "Limit", "Condition", "Message", "NoData", "UsingIndex", "InputVersion", }); 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, @@ -189,11 +200,16 @@ static Storage() { 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; + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.Descriptor.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.Descriptor.Descriptor_, + global::bnet.protocol.Descriptor.DescriptorProp, global::bnet.protocol.Entity.Descriptor, global::bnet.protocol.Rpc.Descriptor, }, assigner); @@ -202,14 +218,20 @@ static Storage() { } #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 TableId : pb::GeneratedMessage { - private static readonly TableId defaultInstance = new Builder().BuildPartial(); + private TableId() { } + private static readonly TableId defaultInstance = new TableId().MakeReadOnly(); + private static readonly string[] _tableIdFieldNames = new string[] { "hash" }; + private static readonly uint[] _tableIdFieldTags = new uint[] { 10 }; public static TableId DefaultInstance { get { return defaultInstance; } } public override TableId DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override TableId ThisMessage { @@ -241,10 +263,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasHash) { - output.WriteBytes(1, Hash); + string[] field_names = _tableIdFieldNames; + if (hasHash) { + output.WriteBytes(1, field_names[0], Hash); } UnknownFields.WriteTo(output); } @@ -256,7 +279,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasHash) { + if (hasHash) { size += pb::CodedOutputStream.ComputeBytesSize(1, Hash); } size += UnknownFields.SerializedSize; @@ -289,38 +312,72 @@ public static TableId ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static TableId ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static TableId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static TableId ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private TableId MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(TableId cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TableId result; + + private TableId PrepareBuilder() { + if (resultIsReadOnly) { + TableId original = result; + result = new TableId(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - TableId result = new TableId(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override TableId MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new TableId(); + 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 { @@ -332,12 +389,11 @@ public override TableId DefaultInstanceForType { } public override TableId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - TableId returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -351,6 +407,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(TableId other) { if (other == global::bnet.protocol.storage.TableId.DefaultInstance) return this; + PrepareBuilder(); if (other.HasHash) { Hash = other.Hash; } @@ -358,20 +415,31 @@ public override Builder MergeFrom(TableId 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(_tableIdFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _tableIdFieldTags[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)) { @@ -383,20 +451,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: { - Hash = input.ReadBytes(); + result.hasHash = input.ReadBytes(ref result.hash_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasHash { - get { return result.HasHash; } + get { return result.hasHash; } } public pb::ByteString Hash { get { return result.Hash; } @@ -404,11 +477,13 @@ 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; @@ -419,14 +494,20 @@ static TableId() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ColumnId : pb::GeneratedMessage { - private static readonly ColumnId defaultInstance = new Builder().BuildPartial(); + private ColumnId() { } + private static readonly ColumnId defaultInstance = new ColumnId().MakeReadOnly(); + private static readonly string[] _columnIdFieldNames = new string[] { "hash" }; + private static readonly uint[] _columnIdFieldTags = new uint[] { 10 }; public static ColumnId DefaultInstance { get { return defaultInstance; } } public override ColumnId DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ColumnId ThisMessage { @@ -458,10 +539,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasHash) { - output.WriteBytes(1, Hash); + string[] field_names = _columnIdFieldNames; + if (hasHash) { + output.WriteBytes(1, field_names[0], Hash); } UnknownFields.WriteTo(output); } @@ -473,7 +555,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasHash) { + if (hasHash) { size += pb::CodedOutputStream.ComputeBytesSize(1, Hash); } size += UnknownFields.SerializedSize; @@ -506,38 +588,72 @@ public static ColumnId ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static ColumnId ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ColumnId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ColumnId ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ColumnId MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(ColumnId cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ColumnId result; + + private ColumnId PrepareBuilder() { + if (resultIsReadOnly) { + ColumnId original = result; + result = new ColumnId(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - ColumnId result = new ColumnId(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ColumnId MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ColumnId(); + 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 { @@ -549,12 +665,11 @@ public override ColumnId DefaultInstanceForType { } public override ColumnId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ColumnId returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -568,6 +683,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ColumnId other) { if (other == global::bnet.protocol.storage.ColumnId.DefaultInstance) return this; + PrepareBuilder(); if (other.HasHash) { Hash = other.Hash; } @@ -575,20 +691,31 @@ public override Builder MergeFrom(ColumnId 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(_columnIdFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _columnIdFieldTags[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)) { @@ -600,20 +727,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: { - Hash = input.ReadBytes(); + result.hasHash = input.ReadBytes(ref result.hash_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasHash { - get { return result.HasHash; } + get { return result.hasHash; } } public pb::ByteString Hash { get { return result.Hash; } @@ -621,11 +753,13 @@ 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; @@ -636,14 +770,20 @@ static ColumnId() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class RowId : pb::GeneratedMessage { - private static readonly RowId defaultInstance = new Builder().BuildPartial(); + private RowId() { } + private static readonly RowId defaultInstance = new RowId().MakeReadOnly(); + private static readonly string[] _rowIdFieldNames = new string[] { "hash" }; + private static readonly uint[] _rowIdFieldTags = new uint[] { 10 }; public static RowId DefaultInstance { get { return defaultInstance; } } public override RowId DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override RowId ThisMessage { @@ -675,10 +815,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasHash) { - output.WriteBytes(1, Hash); + string[] field_names = _rowIdFieldNames; + if (hasHash) { + output.WriteBytes(1, field_names[0], Hash); } UnknownFields.WriteTo(output); } @@ -690,7 +831,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasHash) { + if (hasHash) { size += pb::CodedOutputStream.ComputeBytesSize(1, Hash); } size += UnknownFields.SerializedSize; @@ -723,38 +864,72 @@ public static RowId ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static RowId ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static RowId ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static RowId ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private RowId MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(RowId cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RowId result; + + private RowId PrepareBuilder() { + if (resultIsReadOnly) { + RowId original = result; + result = new RowId(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - RowId result = new RowId(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override RowId MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new RowId(); + 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 { @@ -766,12 +941,11 @@ public override RowId DefaultInstanceForType { } public override RowId BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - RowId returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -785,6 +959,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(RowId other) { if (other == global::bnet.protocol.storage.RowId.DefaultInstance) return this; + PrepareBuilder(); if (other.HasHash) { Hash = other.Hash; } @@ -792,20 +967,31 @@ public override Builder MergeFrom(RowId 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(_rowIdFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _rowIdFieldTags[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)) { @@ -817,20 +1003,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: { - Hash = input.ReadBytes(); + result.hasHash = input.ReadBytes(ref result.hash_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasHash { - get { return result.HasHash; } + get { return result.hasHash; } } public pb::ByteString Hash { get { return result.Hash; } @@ -838,11 +1029,13 @@ 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; @@ -853,14 +1046,20 @@ static RowId() { } } + [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 static readonly Privilege defaultInstance = new Builder().BuildPartial(); + private Privilege() { } + private static readonly Privilege defaultInstance = new Privilege().MakeReadOnly(); + private static readonly string[] _privilegeFieldNames = new string[] { "bits", "program" }; + private static readonly uint[] _privilegeFieldTags = new uint[] { 9, 21 }; public static Privilege DefaultInstance { get { return defaultInstance; } } public override Privilege DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Privilege ThisMessage { @@ -876,7 +1075,12 @@ protected override Privilege 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 Permission { OWNER = 1, FRIEND = 2, @@ -890,7 +1094,7 @@ public enum Permission { public const int BitsFieldNumber = 1; private bool hasBits; - private ulong bits_ = 0; + private ulong bits_; public bool HasBits { get { return hasBits; } } @@ -900,7 +1104,7 @@ public ulong Bits { public const int ProgramFieldNumber = 2; private bool hasProgram; - private uint program_ = 0; + private uint program_; public bool HasProgram { get { return hasProgram; } } @@ -914,13 +1118,14 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasBits) { - output.WriteFixed64(1, Bits); + string[] field_names = _privilegeFieldNames; + if (hasBits) { + output.WriteFixed64(1, field_names[0], Bits); } - if (HasProgram) { - output.WriteFixed32(2, Program); + if (hasProgram) { + output.WriteFixed32(2, field_names[1], Program); } UnknownFields.WriteTo(output); } @@ -932,10 +1137,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasBits) { + if (hasBits) { size += pb::CodedOutputStream.ComputeFixed64Size(1, Bits); } - if (HasProgram) { + if (hasProgram) { size += pb::CodedOutputStream.ComputeFixed32Size(2, Program); } size += UnknownFields.SerializedSize; @@ -968,38 +1173,72 @@ public static Privilege ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Privilege ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Privilege ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + 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 (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(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; + } - Privilege result = new Privilege(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Privilege MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Privilege(); + 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 { @@ -1011,12 +1250,11 @@ public override Privilege DefaultInstanceForType { } public override Privilege BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Privilege returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1030,6 +1268,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Privilege other) { if (other == global::bnet.protocol.storage.Privilege.DefaultInstance) return this; + PrepareBuilder(); if (other.HasBits) { Bits = other.Bits; } @@ -1040,20 +1279,31 @@ public override Builder MergeFrom(Privilege 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(_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: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; + throw pb::InvalidProtocolBufferException.InvalidTag(); } default: { if (pb::WireFormat.IsEndGroupTag(tag)) { @@ -1065,53 +1315,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: { - Bits = input.ReadFixed64(); + result.hasBits = input.ReadFixed64(ref result.bits_); break; } case 21: { - Program = input.ReadFixed32(); + result.hasProgram = input.ReadFixed32(ref result.program_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasBits { - get { return result.HasBits; } + get { return result.hasBits; } } public ulong Bits { get { return result.Bits; } set { SetBits(value); } } public Builder SetBits(ulong value) { + PrepareBuilder(); result.hasBits = true; result.bits_ = value; return this; } public Builder ClearBits() { + PrepareBuilder(); result.hasBits = false; result.bits_ = 0; 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; @@ -1122,30 +1381,41 @@ static Privilege() { } } - public sealed partial class ScanOperation : pb::GeneratedMessage { - private static readonly ScanOperation defaultInstance = new Builder().BuildPartial(); - public static ScanOperation DefaultInstance { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Predicate : pb::GeneratedMessage { + private Predicate() { } + private static readonly Predicate defaultInstance = new Predicate().MakeReadOnly(); + private static readonly string[] _predicateFieldNames = new string[] { "bytes_data", "double_data", "field", "float_data", "op", "sint_data", "uint_data" }; + private static readonly uint[] _predicateFieldTags = new uint[] { 58, 50, 18, 42, 8, 26, 34 }; + public static Predicate DefaultInstance { get { return defaultInstance; } } - public override ScanOperation DefaultInstanceForType { - get { return defaultInstance; } + public override Predicate DefaultInstanceForType { + get { return DefaultInstance; } } - protected override ScanOperation ThisMessage { + protected override Predicate ThisMessage { get { return this; } } public static pbd::MessageDescriptor Descriptor { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_ScanOperation__Descriptor; } + get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_Predicate__Descriptor; } } - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_ScanOperation__FieldAccessorTable; } + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.storage.Storage.internal__static_bnet_protocol_storage_Predicate__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 Op { IS_CLEAR = 1, NOT_CLEAR = 2, @@ -1155,6 +1425,8 @@ public enum Op { NOT_GREATER_THAN = 6, IS_LESS_THAN = 7, NOT_LESS_THAN = 8, + IS_BETWEEN = 9, + NOT_BETWEEN = 10, } } @@ -1162,22 +1434,86 @@ public enum Op { 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; + private global::bnet.protocol.storage.Predicate.Types.Op op_ = global::bnet.protocol.storage.Predicate.Types.Op.IS_CLEAR; public bool HasOp { get { return hasOp; } } - public global::bnet.protocol.storage.ScanOperation.Types.Op Op { + public global::bnet.protocol.storage.Predicate.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; + private global::bnet.protocol.Path field_; public bool HasField { get { return hasField; } } public global::bnet.protocol.Path Field { - get { return field_; } + get { return field_ ?? global::bnet.protocol.Path.DefaultInstance; } + } + + public const int SintDataFieldNumber = 3; + private int sintDataMemoizedSerializedSize; + private pbc::PopsicleList sintData_ = new pbc::PopsicleList(); + public scg::IList SintDataList { + get { return pbc::Lists.AsReadOnly(sintData_); } + } + public int SintDataCount { + get { return sintData_.Count; } + } + public long GetSintData(int index) { + return sintData_[index]; + } + + public const int UintDataFieldNumber = 4; + private int uintDataMemoizedSerializedSize; + private pbc::PopsicleList uintData_ = new pbc::PopsicleList(); + public scg::IList UintDataList { + get { return pbc::Lists.AsReadOnly(uintData_); } + } + public int UintDataCount { + get { return uintData_.Count; } + } + public ulong GetUintData(int index) { + return uintData_[index]; + } + + public const int FloatDataFieldNumber = 5; + private int floatDataMemoizedSerializedSize; + private pbc::PopsicleList floatData_ = new pbc::PopsicleList(); + public scg::IList FloatDataList { + get { return pbc::Lists.AsReadOnly(floatData_); } + } + public int FloatDataCount { + get { return floatData_.Count; } + } + public float GetFloatData(int index) { + return floatData_[index]; + } + + public const int DoubleDataFieldNumber = 6; + private int doubleDataMemoizedSerializedSize; + private pbc::PopsicleList doubleData_ = new pbc::PopsicleList(); + public scg::IList DoubleDataList { + get { return pbc::Lists.AsReadOnly(doubleData_); } + } + public int DoubleDataCount { + get { return doubleData_.Count; } + } + public double GetDoubleData(int index) { + return doubleData_[index]; + } + + public const int BytesDataFieldNumber = 7; + private pbc::PopsicleList bytesData_ = new pbc::PopsicleList(); + public scg::IList BytesDataList { + get { return pbc::Lists.AsReadOnly(bytesData_); } + } + public int BytesDataCount { + get { return bytesData_.Count; } + } + public pb::ByteString GetBytesData(int index) { + return bytesData_[index]; } public override bool IsInitialized { @@ -1188,13 +1524,29 @@ 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 = _predicateFieldNames; + if (hasOp) { + output.WriteEnum(1, field_names[4], (int) Op, Op); + } + if (hasField) { + output.WriteMessage(2, field_names[2], Field); + } + if (sintData_.Count > 0) { + output.WritePackedSInt64Array(3, field_names[5], sintDataMemoizedSerializedSize, sintData_); + } + if (uintData_.Count > 0) { + output.WritePackedUInt64Array(4, field_names[6], uintDataMemoizedSerializedSize, uintData_); } - if (HasField) { - output.WriteMessage(2, Field); + if (floatData_.Count > 0) { + output.WritePackedFloatArray(5, field_names[3], floatDataMemoizedSerializedSize, floatData_); + } + if (doubleData_.Count > 0) { + output.WritePackedDoubleArray(6, field_names[1], doubleDataMemoizedSerializedSize, doubleData_); + } + if (bytesData_.Count > 0) { + output.WriteBytesArray(7, field_names[0], bytesData_); } UnknownFields.WriteTo(output); } @@ -1206,128 +1558,241 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOp) { + if (hasOp) { size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Op); } - if (HasField) { + if (hasField) { size += pb::CodedOutputStream.ComputeMessageSize(2, Field); } + { + int dataSize = 0; + foreach (long element in SintDataList) { + dataSize += pb::CodedOutputStream.ComputeSInt64SizeNoTag(element); + } + size += dataSize; + if (sintData_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + sintDataMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + foreach (ulong element in UintDataList) { + dataSize += pb::CodedOutputStream.ComputeUInt64SizeNoTag(element); + } + size += dataSize; + if (uintData_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + uintDataMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 4 * floatData_.Count; + size += dataSize; + if (floatData_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + floatDataMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + dataSize = 8 * doubleData_.Count; + size += dataSize; + if (doubleData_.Count != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); + } + doubleDataMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + foreach (pb::ByteString element in BytesDataList) { + dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); + } + size += dataSize; + size += 1 * bytesData_.Count; + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; } } - public static ScanOperation ParseFrom(pb::ByteString data) { + public static Predicate ParseFrom(pb::ByteString data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static ScanOperation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + public static Predicate ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static ScanOperation ParseFrom(byte[] data) { + public static Predicate ParseFrom(byte[] data) { return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); } - public static ScanOperation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + public static Predicate ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); } - public static ScanOperation ParseFrom(global::System.IO.Stream input) { + public static Predicate ParseFrom(global::System.IO.Stream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ScanOperation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static Predicate 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) { + public static Predicate ParseDelimitedFrom(global::System.IO.Stream input) { return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); } - public static ScanOperation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + public static Predicate ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); } - public static ScanOperation ParseFrom(pb::CodedInputStream input) { + public static Predicate ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ScanOperation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Predicate ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Predicate MakeReadOnly() { + sintData_.MakeReadOnly(); + uintData_.MakeReadOnly(); + floatData_.MakeReadOnly(); + doubleData_.MakeReadOnly(); + bytesData_.MakeReadOnly(); + return this; + } + public 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 static Builder CreateBuilder(Predicate 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(Predicate cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ScanOperation result = new ScanOperation(); + private bool resultIsReadOnly; + private Predicate result; + + private Predicate PrepareBuilder() { + if (resultIsReadOnly) { + Predicate original = result; + result = new Predicate(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - protected override ScanOperation MessageBeingBuilt { - get { return result; } + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Predicate MessageBeingBuilt { + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ScanOperation(); + 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.storage.ScanOperation.Descriptor; } + get { return global::bnet.protocol.storage.Predicate.Descriptor; } } - public override ScanOperation DefaultInstanceForType { - get { return global::bnet.protocol.storage.ScanOperation.DefaultInstance; } + public override Predicate DefaultInstanceForType { + get { return global::bnet.protocol.storage.Predicate.DefaultInstance; } } - public override ScanOperation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + public override Predicate BuildPartial() { + if (resultIsReadOnly) { + return result; } - ScanOperation returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { - if (other is ScanOperation) { - return MergeFrom((ScanOperation) other); + if (other is Predicate) { + return MergeFrom((Predicate) other); } else { base.MergeFrom(other); return this; } } - public override Builder MergeFrom(ScanOperation other) { - if (other == global::bnet.protocol.storage.ScanOperation.DefaultInstance) return this; + public override Builder MergeFrom(Predicate other) { + if (other == global::bnet.protocol.storage.Predicate.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOp) { Op = other.Op; } if (other.HasField) { MergeField(other.Field); } + if (other.sintData_.Count != 0) { + result.sintData_.Add(other.sintData_); + } + if (other.uintData_.Count != 0) { + result.uintData_.Add(other.uintData_); + } + if (other.floatData_.Count != 0) { + result.floatData_.Add(other.floatData_); + } + if (other.doubleData_.Count != 0) { + result.doubleData_.Add(other.doubleData_); + } + if (other.bytesData_.Count != 0) { + result.bytesData_.Add(other.bytesData_); + } 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(_predicateFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _predicateFieldTags[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)) { @@ -1339,55 +1804,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: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::bnet.protocol.storage.ScanOperation.Types.Op), 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.storage.ScanOperation.Types.Op) rawValue; + unknownFields.MergeVarintField(1, (ulong)(int)unknown); } break; } case 18: { global::bnet.protocol.Path.Builder subBuilder = global::bnet.protocol.Path.CreateBuilder(); - if (HasField) { + if (result.hasField) { subBuilder.MergeFrom(Field); } input.ReadMessage(subBuilder, extensionRegistry); Field = subBuilder.BuildPartial(); break; } + case 26: + case 24: { + input.ReadSInt64Array(tag, field_name, result.sintData_); + break; + } + case 34: + case 32: { + input.ReadUInt64Array(tag, field_name, result.uintData_); + break; + } + case 42: + case 45: { + input.ReadFloatArray(tag, field_name, result.floatData_); + break; + } + case 50: + case 49: { + input.ReadDoubleArray(tag, field_name, result.doubleData_); + break; + } + case 58: { + input.ReadBytesArray(tag, field_name, result.bytesData_); + 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.storage.ScanOperation.Types.Op Op { + public global::bnet.protocol.storage.Predicate.Types.Op Op { get { return result.Op; } set { SetOp(value); } } - public Builder SetOp(global::bnet.protocol.storage.ScanOperation.Types.Op value) { + public Builder SetOp(global::bnet.protocol.storage.Predicate.Types.Op value) { + PrepareBuilder(); result.hasOp = true; result.op_ = value; return this; } public Builder ClearOp() { + PrepareBuilder(); result.hasOp = false; - result.op_ = global::bnet.protocol.storage.ScanOperation.Types.Op.IS_CLEAR; + result.op_ = global::bnet.protocol.storage.Predicate.Types.Op.IS_CLEAR; return this; } public bool HasField { - get { return result.HasField; } + get { return result.hasField; } } public global::bnet.protocol.Path Field { get { return result.Field; } @@ -1395,19 +1891,22 @@ public bool HasField { } public Builder SetField(global::bnet.protocol.Path value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasField = true; result.field_ = value; return this; } public Builder SetField(global::bnet.protocol.Path.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasField && result.field_ != global::bnet.protocol.Path.DefaultInstance) { result.field_ = global::bnet.protocol.Path.CreateBuilder(result.field_).MergeFrom(value).BuildPartial(); } else { @@ -1417,24 +1916,183 @@ public Builder MergeField(global::bnet.protocol.Path value) { return this; } public Builder ClearField() { + PrepareBuilder(); result.hasField = false; - result.field_ = global::bnet.protocol.Path.DefaultInstance; + result.field_ = null; + return this; + } + + public pbc::IPopsicleList SintDataList { + get { return PrepareBuilder().sintData_; } + } + public int SintDataCount { + get { return result.SintDataCount; } + } + public long GetSintData(int index) { + return result.GetSintData(index); + } + public Builder SetSintData(int index, long value) { + PrepareBuilder(); + result.sintData_[index] = value; + return this; + } + public Builder AddSintData(long value) { + PrepareBuilder(); + result.sintData_.Add(value); + return this; + } + public Builder AddRangeSintData(scg::IEnumerable values) { + PrepareBuilder(); + result.sintData_.Add(values); + return this; + } + public Builder ClearSintData() { + PrepareBuilder(); + result.sintData_.Clear(); + return this; + } + + public pbc::IPopsicleList UintDataList { + get { return PrepareBuilder().uintData_; } + } + public int UintDataCount { + get { return result.UintDataCount; } + } + public ulong GetUintData(int index) { + return result.GetUintData(index); + } + public Builder SetUintData(int index, ulong value) { + PrepareBuilder(); + result.uintData_[index] = value; + return this; + } + public Builder AddUintData(ulong value) { + PrepareBuilder(); + result.uintData_.Add(value); + return this; + } + public Builder AddRangeUintData(scg::IEnumerable values) { + PrepareBuilder(); + result.uintData_.Add(values); + return this; + } + public Builder ClearUintData() { + PrepareBuilder(); + result.uintData_.Clear(); + return this; + } + + public pbc::IPopsicleList FloatDataList { + get { return PrepareBuilder().floatData_; } + } + public int FloatDataCount { + get { return result.FloatDataCount; } + } + public float GetFloatData(int index) { + return result.GetFloatData(index); + } + public Builder SetFloatData(int index, float value) { + PrepareBuilder(); + result.floatData_[index] = value; + return this; + } + public Builder AddFloatData(float value) { + PrepareBuilder(); + result.floatData_.Add(value); + return this; + } + public Builder AddRangeFloatData(scg::IEnumerable values) { + PrepareBuilder(); + result.floatData_.Add(values); + return this; + } + public Builder ClearFloatData() { + PrepareBuilder(); + result.floatData_.Clear(); + return this; + } + + public pbc::IPopsicleList DoubleDataList { + get { return PrepareBuilder().doubleData_; } + } + public int DoubleDataCount { + get { return result.DoubleDataCount; } + } + public double GetDoubleData(int index) { + return result.GetDoubleData(index); + } + public Builder SetDoubleData(int index, double value) { + PrepareBuilder(); + result.doubleData_[index] = value; + return this; + } + public Builder AddDoubleData(double value) { + PrepareBuilder(); + result.doubleData_.Add(value); + return this; + } + public Builder AddRangeDoubleData(scg::IEnumerable values) { + PrepareBuilder(); + result.doubleData_.Add(values); + return this; + } + public Builder ClearDoubleData() { + PrepareBuilder(); + result.doubleData_.Clear(); + return this; + } + + public pbc::IPopsicleList BytesDataList { + get { return PrepareBuilder().bytesData_; } + } + public int BytesDataCount { + get { return result.BytesDataCount; } + } + public pb::ByteString GetBytesData(int index) { + return result.GetBytesData(index); + } + public Builder SetBytesData(int index, pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.bytesData_[index] = value; + return this; + } + public Builder AddBytesData(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.bytesData_.Add(value); + return this; + } + public Builder AddRangeBytesData(scg::IEnumerable values) { + PrepareBuilder(); + result.bytesData_.Add(values); + return this; + } + public Builder ClearBytesData() { + PrepareBuilder(); + result.bytesData_.Clear(); return this; } } - static ScanOperation() { + static Predicate() { object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Command : pb::GeneratedMessage { - private static readonly Command defaultInstance = new Builder().BuildPartial(); + private Command() { } + private static readonly Command defaultInstance = new Command().MakeReadOnly(); + private static readonly string[] _commandFieldNames = new string[] { "condition", "data", "fields", "input_version", "limit", "max_version", "message", "min_version", "no_data", "op", "predicate", "using_index" }; + private static readonly uint[] _commandFieldTags = new uint[] { 64, 18, 26, 113, 56, 41, 90, 33, 96, 8, 50, 106 }; public static Command DefaultInstance { get { return defaultInstance; } } public override Command DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Command ThisMessage { @@ -1450,7 +2108,12 @@ protected override Command 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 Op { ROW_DELETE = 1, ROW_FETCH = 2, @@ -1472,8 +2135,11 @@ public enum Op { FLD_COND = 18, COND_POP = 19, LOG_DEBUG = 20, + COL_COPY = 21, } + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public enum Cond { COND_ALWAYS = 0, COND_NOT_EXISTS = 1, @@ -1523,7 +2189,7 @@ public int FieldsCount { public const int MinVersionFieldNumber = 4; private bool hasMinVersion; - private ulong minVersion_ = 0; + private ulong minVersion_; public bool HasMinVersion { get { return hasMinVersion; } } @@ -1533,7 +2199,7 @@ public ulong MinVersion { public const int MaxVersionFieldNumber = 5; private bool hasMaxVersion; - private ulong maxVersion_ = 0; + private ulong maxVersion_; public bool HasMaxVersion { get { return hasMaxVersion; } } @@ -1541,19 +2207,21 @@ 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 const int PredicateFieldNumber = 6; + private pbc::PopsicleList predicate_ = new pbc::PopsicleList(); + public scg::IList PredicateList { + get { return predicate_; } + } + public int PredicateCount { + get { return predicate_.Count; } } - public global::bnet.protocol.storage.ScanOperation Scan { - get { return scan_; } + public global::bnet.protocol.storage.Predicate GetPredicate(int index) { + return predicate_[index]; } public const int LimitFieldNumber = 7; private bool hasLimit; - private uint limit_ = 0; + private uint limit_; public bool HasLimit { get { return hasLimit; } } @@ -1581,44 +2249,84 @@ public string Message { get { return message_; } } + public const int NoDataFieldNumber = 12; + private bool hasNoData; + private bool noData_; + public bool HasNoData { + get { return hasNoData; } + } + public bool NoData { + get { return noData_; } + } + + public const int UsingIndexFieldNumber = 13; + private bool hasUsingIndex; + private string usingIndex_ = ""; + public bool HasUsingIndex { + get { return hasUsingIndex; } + } + public string UsingIndex { + get { return usingIndex_; } + } + + public const int InputVersionFieldNumber = 14; + private bool hasInputVersion; + private ulong inputVersion_; + public bool HasInputVersion { + get { return hasInputVersion; } + } + public ulong InputVersion { + get { return inputVersion_; } + } + public override bool IsInitialized { get { if (!hasOp) return false; - if (HasScan) { - if (!Scan.IsInitialized) return false; + foreach (global::bnet.protocol.storage.Predicate element in PredicateList) { + 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 (HasOp) { - output.WriteEnum(1, (int) Op); + string[] field_names = _commandFieldNames; + if (hasOp) { + output.WriteEnum(1, field_names[9], (int) Op, Op); + } + if (hasData) { + output.WriteBytes(2, field_names[1], Data); + } + if (fields_.Count > 0) { + output.WriteMessageArray(3, field_names[2], fields_); } - if (HasData) { - output.WriteBytes(2, Data); + if (hasMinVersion) { + output.WriteFixed64(4, field_names[7], MinVersion); } - foreach (global::bnet.protocol.Path element in FieldsList) { - output.WriteMessage(3, element); + if (hasMaxVersion) { + output.WriteFixed64(5, field_names[5], MaxVersion); } - if (HasMinVersion) { - output.WriteFixed64(4, MinVersion); + if (predicate_.Count > 0) { + output.WriteMessageArray(6, field_names[10], predicate_); } - if (HasMaxVersion) { - output.WriteFixed64(5, MaxVersion); + if (hasLimit) { + output.WriteUInt32(7, field_names[4], Limit); } - if (HasScan) { - output.WriteMessage(6, Scan); + if (hasCondition) { + output.WriteEnum(8, field_names[0], (int) Condition, Condition); } - if (HasLimit) { - output.WriteUInt32(7, Limit); + if (hasMessage) { + output.WriteString(11, field_names[6], Message); } - if (HasCondition) { - output.WriteEnum(8, (int) Condition); + if (hasNoData) { + output.WriteBool(12, field_names[8], NoData); } - if (HasMessage) { - output.WriteString(11, Message); + if (hasUsingIndex) { + output.WriteString(13, field_names[11], UsingIndex); + } + if (hasInputVersion) { + output.WriteFixed64(14, field_names[3], InputVersion); } UnknownFields.WriteTo(output); } @@ -1630,33 +2338,42 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasOp) { + if (hasOp) { size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Op); } - if (HasData) { + if (hasData) { size += pb::CodedOutputStream.ComputeBytesSize(2, Data); } foreach (global::bnet.protocol.Path element in FieldsList) { size += pb::CodedOutputStream.ComputeMessageSize(3, element); } - if (HasMinVersion) { + if (hasMinVersion) { size += pb::CodedOutputStream.ComputeFixed64Size(4, MinVersion); } - if (HasMaxVersion) { + if (hasMaxVersion) { size += pb::CodedOutputStream.ComputeFixed64Size(5, MaxVersion); } - if (HasScan) { - size += pb::CodedOutputStream.ComputeMessageSize(6, Scan); + foreach (global::bnet.protocol.storage.Predicate element in PredicateList) { + size += pb::CodedOutputStream.ComputeMessageSize(6, element); } - if (HasLimit) { + if (hasLimit) { size += pb::CodedOutputStream.ComputeUInt32Size(7, Limit); } - if (HasCondition) { + if (hasCondition) { size += pb::CodedOutputStream.ComputeEnumSize(8, (int) Condition); } - if (HasMessage) { + if (hasMessage) { size += pb::CodedOutputStream.ComputeStringSize(11, Message); } + if (hasNoData) { + size += pb::CodedOutputStream.ComputeBoolSize(12, NoData); + } + if (hasUsingIndex) { + size += pb::CodedOutputStream.ComputeStringSize(13, UsingIndex); + } + if (hasInputVersion) { + size += pb::CodedOutputStream.ComputeFixed64Size(14, InputVersion); + } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; return size; @@ -1687,38 +2404,74 @@ public static Command ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Command ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Command ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Command ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Command MakeReadOnly() { + fields_.MakeReadOnly(); + predicate_.MakeReadOnly(); + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(Command cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Command result; - Command result = new Command(); + private Command PrepareBuilder() { + if (resultIsReadOnly) { + Command original = result; + result = new Command(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Command MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Command(); + 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 { @@ -1730,13 +2483,11 @@ public override Command DefaultInstanceForType { } public override Command BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.fields_.MakeReadOnly(); - Command returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1750,6 +2501,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Command other) { if (other == global::bnet.protocol.storage.Command.DefaultInstance) return this; + PrepareBuilder(); if (other.HasOp) { Op = other.Op; } @@ -1757,7 +2509,7 @@ public override Builder MergeFrom(Command other) { Data = other.Data; } if (other.fields_.Count != 0) { - base.AddRange(other.fields_, result.fields_); + result.fields_.Add(other.fields_); } if (other.HasMinVersion) { MinVersion = other.MinVersion; @@ -1765,8 +2517,8 @@ public override Builder MergeFrom(Command other) { if (other.HasMaxVersion) { MaxVersion = other.MaxVersion; } - if (other.HasScan) { - MergeScan(other.Scan); + if (other.predicate_.Count != 0) { + result.predicate_.Add(other.predicate_); } if (other.HasLimit) { Limit = other.Limit; @@ -1777,24 +2529,44 @@ public override Builder MergeFrom(Command other) { if (other.HasMessage) { Message = other.Message; } + if (other.HasNoData) { + NoData = other.NoData; + } + if (other.HasUsingIndex) { + UsingIndex = other.UsingIndex; + } + if (other.HasInputVersion) { + InputVersion = other.InputVersion; + } 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(_commandFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _commandFieldTags[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)) { @@ -1806,93 +2578,105 @@ 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.storage.Command.Types.Op), 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.storage.Command.Types.Op) rawValue; + unknownFields.MergeVarintField(1, (ulong)(int)unknown); } break; } case 18: { - Data = input.ReadBytes(); + result.hasData = input.ReadBytes(ref result.data_); break; } case 26: { - global::bnet.protocol.Path.Builder subBuilder = global::bnet.protocol.Path.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddFields(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.fields_, global::bnet.protocol.Path.DefaultInstance, extensionRegistry); break; } case 33: { - MinVersion = input.ReadFixed64(); + result.hasMinVersion = input.ReadFixed64(ref result.minVersion_); break; } case 41: { - MaxVersion = input.ReadFixed64(); + result.hasMaxVersion = input.ReadFixed64(ref result.maxVersion_); 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(); + input.ReadMessageArray(tag, field_name, result.predicate_, global::bnet.protocol.storage.Predicate.DefaultInstance, extensionRegistry); break; } case 56: { - Limit = input.ReadUInt32(); + result.hasLimit = input.ReadUInt32(ref result.limit_); break; } case 64: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::bnet.protocol.storage.Command.Types.Cond), rawValue)) { + object unknown; + if(input.ReadEnum(ref result.condition_, out unknown)) { + result.hasCondition = true; + } else if(unknown is int) { if (unknownFields == null) { unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); } - unknownFields.MergeVarintField(8, (ulong) rawValue); - } else { - Condition = (global::bnet.protocol.storage.Command.Types.Cond) rawValue; + unknownFields.MergeVarintField(8, (ulong)(int)unknown); } break; } case 90: { - Message = input.ReadString(); + result.hasMessage = input.ReadString(ref result.message_); + break; + } + case 96: { + result.hasNoData = input.ReadBool(ref result.noData_); + break; + } + case 106: { + result.hasUsingIndex = input.ReadString(ref result.usingIndex_); + break; + } + case 113: { + result.hasInputVersion = input.ReadFixed64(ref result.inputVersion_); 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.storage.Command.Types.Op Op { get { return result.Op; } set { SetOp(value); } } public Builder SetOp(global::bnet.protocol.storage.Command.Types.Op value) { + PrepareBuilder(); result.hasOp = true; result.op_ = value; return this; } public Builder ClearOp() { + PrepareBuilder(); result.hasOp = false; result.op_ = global::bnet.protocol.storage.Command.Types.Op.ROW_DELETE; return this; } public bool HasData { - get { return result.HasData; } + get { return result.hasData; } } public pb::ByteString Data { get { return result.Data; } @@ -1900,18 +2684,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 FieldsList { - get { return result.fields_; } + get { return PrepareBuilder().fields_; } } public int FieldsCount { get { return result.FieldsCount; } @@ -1921,143 +2707,165 @@ public int FieldsCount { } public Builder SetFields(int index, global::bnet.protocol.Path value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.fields_[index] = value; return this; } public Builder SetFields(int index, global::bnet.protocol.Path.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.fields_[index] = builderForValue.Build(); return this; } public Builder AddFields(global::bnet.protocol.Path value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.fields_.Add(value); return this; } public Builder AddFields(global::bnet.protocol.Path.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.fields_.Add(builderForValue.Build()); return this; } public Builder AddRangeFields(scg::IEnumerable values) { - base.AddRange(values, result.fields_); + PrepareBuilder(); + result.fields_.Add(values); return this; } public Builder ClearFields() { + PrepareBuilder(); result.fields_.Clear(); return this; } public bool HasMinVersion { - get { return result.HasMinVersion; } + get { return result.hasMinVersion; } } public ulong MinVersion { get { return result.MinVersion; } set { SetMinVersion(value); } } public Builder SetMinVersion(ulong value) { + PrepareBuilder(); result.hasMinVersion = true; result.minVersion_ = value; return this; } public Builder ClearMinVersion() { + PrepareBuilder(); result.hasMinVersion = false; result.minVersion_ = 0; return this; } public bool HasMaxVersion { - get { return result.HasMaxVersion; } + get { return result.hasMaxVersion; } } public ulong MaxVersion { get { return result.MaxVersion; } set { SetMaxVersion(value); } } public Builder SetMaxVersion(ulong value) { + PrepareBuilder(); result.hasMaxVersion = true; result.maxVersion_ = value; return this; } public Builder ClearMaxVersion() { + PrepareBuilder(); result.hasMaxVersion = false; result.maxVersion_ = 0; return this; } - public bool HasScan { - get { return result.HasScan; } + public pbc::IPopsicleList PredicateList { + get { return PrepareBuilder().predicate_; } } - public global::bnet.protocol.storage.ScanOperation Scan { - get { return result.Scan; } - set { SetScan(value); } + public int PredicateCount { + get { return result.PredicateCount; } } - public Builder SetScan(global::bnet.protocol.storage.ScanOperation value) { + public global::bnet.protocol.storage.Predicate GetPredicate(int index) { + return result.GetPredicate(index); + } + public Builder SetPredicate(int index, global::bnet.protocol.storage.Predicate value) { pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasScan = true; - result.scan_ = value; + PrepareBuilder(); + result.predicate_[index] = value; return this; } - public Builder SetScan(global::bnet.protocol.storage.ScanOperation.Builder builderForValue) { + public Builder SetPredicate(int index, global::bnet.protocol.storage.Predicate.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasScan = true; - result.scan_ = builderForValue.Build(); + PrepareBuilder(); + result.predicate_[index] = builderForValue.Build(); return this; } - public Builder MergeScan(global::bnet.protocol.storage.ScanOperation value) { + public Builder AddPredicate(global::bnet.protocol.storage.Predicate 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; + PrepareBuilder(); + result.predicate_.Add(value); + return this; + } + public Builder AddPredicate(global::bnet.protocol.storage.Predicate.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.predicate_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangePredicate(scg::IEnumerable values) { + PrepareBuilder(); + result.predicate_.Add(values); return this; } - public Builder ClearScan() { - result.hasScan = false; - result.scan_ = global::bnet.protocol.storage.ScanOperation.DefaultInstance; + public Builder ClearPredicate() { + PrepareBuilder(); + result.predicate_.Clear(); return this; } public bool HasLimit { - get { return result.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; } public bool HasCondition { - get { return result.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) { + PrepareBuilder(); result.hasCondition = true; result.condition_ = value; return this; } public Builder ClearCondition() { + PrepareBuilder(); result.hasCondition = false; result.condition_ = global::bnet.protocol.storage.Command.Types.Cond.COND_ALWAYS; return this; } public bool HasMessage { - get { return result.HasMessage; } + get { return result.hasMessage; } } public string Message { get { return result.Message; } @@ -2065,29 +2873,98 @@ public string Message { } public Builder SetMessage(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasMessage = true; result.message_ = value; return this; } public Builder ClearMessage() { + PrepareBuilder(); result.hasMessage = false; result.message_ = ""; return this; } + + public bool HasNoData { + get { return result.hasNoData; } + } + public bool NoData { + get { return result.NoData; } + set { SetNoData(value); } + } + public Builder SetNoData(bool value) { + PrepareBuilder(); + result.hasNoData = true; + result.noData_ = value; + return this; + } + public Builder ClearNoData() { + PrepareBuilder(); + result.hasNoData = false; + result.noData_ = false; + return this; + } + + public bool HasUsingIndex { + get { return result.hasUsingIndex; } + } + public string UsingIndex { + get { return result.UsingIndex; } + set { SetUsingIndex(value); } + } + public Builder SetUsingIndex(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasUsingIndex = true; + result.usingIndex_ = value; + return this; + } + public Builder ClearUsingIndex() { + PrepareBuilder(); + result.hasUsingIndex = false; + result.usingIndex_ = ""; + return this; + } + + public bool HasInputVersion { + get { return result.hasInputVersion; } + } + public ulong InputVersion { + get { return result.InputVersion; } + set { SetInputVersion(value); } + } + public Builder SetInputVersion(ulong value) { + PrepareBuilder(); + result.hasInputVersion = true; + result.inputVersion_ = value; + return this; + } + public Builder ClearInputVersion() { + PrepareBuilder(); + result.hasInputVersion = false; + result.inputVersion_ = 0; + return this; + } } static Command() { object.ReferenceEquals(global::bnet.protocol.storage.Storage.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Operation : pb::GeneratedMessage { - private static readonly Operation defaultInstance = new Builder().BuildPartial(); + private Operation() { } + private static readonly Operation defaultInstance = new Operation().MakeReadOnly(); + private static readonly string[] _operationFieldNames = new string[] { "column_id", "mutate_version", "privilege", "rops", "row_id", "row_key", "table_id", "version" }; + private static readonly uint[] _operationFieldTags = new uint[] { 18, 57, 66, 50, 26, 34, 10, 41 }; public static Operation DefaultInstance { get { return defaultInstance; } } public override Operation DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Operation ThisMessage { @@ -2104,32 +2981,32 @@ protected override Operation ThisMessage { public const int TableIdFieldNumber = 1; private bool hasTableId; - private global::bnet.protocol.storage.TableId tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; + private global::bnet.protocol.storage.TableId tableId_; public bool HasTableId { get { return hasTableId; } } public global::bnet.protocol.storage.TableId TableId { - get { return tableId_; } + get { return tableId_ ?? global::bnet.protocol.storage.TableId.DefaultInstance; } } public const int ColumnIdFieldNumber = 2; private bool hasColumnId; - private global::bnet.protocol.storage.ColumnId columnId_ = global::bnet.protocol.storage.ColumnId.DefaultInstance; + private global::bnet.protocol.storage.ColumnId columnId_; public bool HasColumnId { get { return hasColumnId; } } public global::bnet.protocol.storage.ColumnId ColumnId { - get { return columnId_; } + get { return columnId_ ?? global::bnet.protocol.storage.ColumnId.DefaultInstance; } } public const int RowIdFieldNumber = 3; private bool hasRowId; - private global::bnet.protocol.storage.RowId rowId_ = global::bnet.protocol.storage.RowId.DefaultInstance; + private global::bnet.protocol.storage.RowId rowId_; public bool HasRowId { get { return hasRowId; } } public global::bnet.protocol.storage.RowId RowId { - get { return rowId_; } + get { return rowId_ ?? global::bnet.protocol.storage.RowId.DefaultInstance; } } public const int RowKeyFieldNumber = 4; @@ -2144,7 +3021,7 @@ public bool HasRowKey { public const int VersionFieldNumber = 5; private bool hasVersion; - private ulong version_ = 0; + private ulong version_; public bool HasVersion { get { return hasVersion; } } @@ -2166,7 +3043,7 @@ public int RopsCount { public const int MutateVersionFieldNumber = 7; private bool hasMutateVersion; - private ulong mutateVersion_ = 0; + private ulong mutateVersion_; public bool HasMutateVersion { get { return hasMutateVersion; } } @@ -2176,12 +3053,12 @@ public ulong MutateVersion { public const int PrivilegeFieldNumber = 8; private bool hasPrivilege; - private global::bnet.protocol.storage.Privilege privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; + private global::bnet.protocol.storage.Privilege privilege_; public bool HasPrivilege { get { return hasPrivilege; } } public global::bnet.protocol.storage.Privilege Privilege { - get { return privilege_; } + get { return privilege_ ?? global::bnet.protocol.storage.Privilege.DefaultInstance; } } public override bool IsInitialized { @@ -2201,31 +3078,32 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasTableId) { - output.WriteMessage(1, TableId); + string[] field_names = _operationFieldNames; + if (hasTableId) { + output.WriteMessage(1, field_names[6], TableId); } - if (HasColumnId) { - output.WriteMessage(2, ColumnId); + if (hasColumnId) { + output.WriteMessage(2, field_names[0], ColumnId); } - if (HasRowId) { - output.WriteMessage(3, RowId); + if (hasRowId) { + output.WriteMessage(3, field_names[4], RowId); } - if (HasRowKey) { - output.WriteBytes(4, RowKey); + if (hasRowKey) { + output.WriteBytes(4, field_names[5], RowKey); } - if (HasVersion) { - output.WriteFixed64(5, Version); + if (hasVersion) { + output.WriteFixed64(5, field_names[7], Version); } - foreach (global::bnet.protocol.storage.Command element in RopsList) { - output.WriteMessage(6, element); + if (rops_.Count > 0) { + output.WriteMessageArray(6, field_names[3], rops_); } - if (HasMutateVersion) { - output.WriteFixed64(7, MutateVersion); + if (hasMutateVersion) { + output.WriteFixed64(7, field_names[1], MutateVersion); } - if (HasPrivilege) { - output.WriteMessage(8, Privilege); + if (hasPrivilege) { + output.WriteMessage(8, field_names[2], Privilege); } UnknownFields.WriteTo(output); } @@ -2237,28 +3115,28 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasTableId) { + if (hasTableId) { size += pb::CodedOutputStream.ComputeMessageSize(1, TableId); } - if (HasColumnId) { + if (hasColumnId) { size += pb::CodedOutputStream.ComputeMessageSize(2, ColumnId); } - if (HasRowId) { + if (hasRowId) { size += pb::CodedOutputStream.ComputeMessageSize(3, RowId); } - if (HasRowKey) { + if (hasRowKey) { size += pb::CodedOutputStream.ComputeBytesSize(4, RowKey); } - if (HasVersion) { + 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) { + if (hasMutateVersion) { size += pb::CodedOutputStream.ComputeFixed64Size(7, MutateVersion); } - if (HasPrivilege) { + if (hasPrivilege) { size += pb::CodedOutputStream.ComputeMessageSize(8, Privilege); } size += UnknownFields.SerializedSize; @@ -2291,38 +3169,73 @@ public static Operation ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Operation ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Operation ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Operation ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Operation MakeReadOnly() { + rops_.MakeReadOnly(); + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(Operation cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Operation result; - Operation result = new Operation(); + private Operation PrepareBuilder() { + if (resultIsReadOnly) { + Operation original = result; + result = new Operation(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Operation MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Operation(); + 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 { @@ -2334,13 +3247,11 @@ public override Operation DefaultInstanceForType { } public override Operation BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.rops_.MakeReadOnly(); - Operation returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2354,6 +3265,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Operation other) { if (other == global::bnet.protocol.storage.Operation.DefaultInstance) return this; + PrepareBuilder(); if (other.HasTableId) { MergeTableId(other.TableId); } @@ -2370,7 +3282,7 @@ public override Builder MergeFrom(Operation other) { Version = other.Version; } if (other.rops_.Count != 0) { - base.AddRange(other.rops_, result.rops_); + result.rops_.Add(other.rops_); } if (other.HasMutateVersion) { MutateVersion = other.MutateVersion; @@ -2382,20 +3294,31 @@ public override Builder MergeFrom(Operation 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(_operationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _operationFieldTags[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)) { @@ -2407,12 +3330,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.storage.TableId.Builder subBuilder = global::bnet.protocol.storage.TableId.CreateBuilder(); - if (HasTableId) { + if (result.hasTableId) { subBuilder.MergeFrom(TableId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2421,7 +3344,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.storage.ColumnId.Builder subBuilder = global::bnet.protocol.storage.ColumnId.CreateBuilder(); - if (HasColumnId) { + if (result.hasColumnId) { subBuilder.MergeFrom(ColumnId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2430,7 +3353,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.storage.RowId.Builder subBuilder = global::bnet.protocol.storage.RowId.CreateBuilder(); - if (HasRowId) { + if (result.hasRowId) { subBuilder.MergeFrom(RowId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2438,26 +3361,24 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 34: { - RowKey = input.ReadBytes(); + result.hasRowKey = input.ReadBytes(ref result.rowKey_); break; } case 41: { - Version = input.ReadFixed64(); + result.hasVersion = input.ReadFixed64(ref result.version_); break; } case 50: { - global::bnet.protocol.storage.Command.Builder subBuilder = global::bnet.protocol.storage.Command.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddRops(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.rops_, global::bnet.protocol.storage.Command.DefaultInstance, extensionRegistry); break; } case 57: { - MutateVersion = input.ReadFixed64(); + result.hasMutateVersion = input.ReadFixed64(ref result.mutateVersion_); break; } case 66: { global::bnet.protocol.storage.Privilege.Builder subBuilder = global::bnet.protocol.storage.Privilege.CreateBuilder(); - if (HasPrivilege) { + if (result.hasPrivilege) { subBuilder.MergeFrom(Privilege); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2466,11 +3387,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasTableId { - get { return result.HasTableId; } + get { return result.hasTableId; } } public global::bnet.protocol.storage.TableId TableId { get { return result.TableId; } @@ -2478,19 +3404,22 @@ public bool HasTableId { } public Builder SetTableId(global::bnet.protocol.storage.TableId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasTableId = true; result.tableId_ = value; return this; } public Builder SetTableId(global::bnet.protocol.storage.TableId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -2500,13 +3429,14 @@ public Builder MergeTableId(global::bnet.protocol.storage.TableId value) { return this; } public Builder ClearTableId() { + PrepareBuilder(); result.hasTableId = false; - result.tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; + result.tableId_ = null; return this; } public bool HasColumnId { - get { return result.HasColumnId; } + get { return result.hasColumnId; } } public global::bnet.protocol.storage.ColumnId ColumnId { get { return result.ColumnId; } @@ -2514,19 +3444,22 @@ public bool HasColumnId { } public Builder SetColumnId(global::bnet.protocol.storage.ColumnId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasColumnId = true; result.columnId_ = value; return this; } public Builder SetColumnId(global::bnet.protocol.storage.ColumnId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -2536,13 +3469,14 @@ public Builder MergeColumnId(global::bnet.protocol.storage.ColumnId value) { return this; } public Builder ClearColumnId() { + PrepareBuilder(); result.hasColumnId = false; - result.columnId_ = global::bnet.protocol.storage.ColumnId.DefaultInstance; + result.columnId_ = null; return this; } public bool HasRowId { - get { return result.HasRowId; } + get { return result.hasRowId; } } public global::bnet.protocol.storage.RowId RowId { get { return result.RowId; } @@ -2550,19 +3484,22 @@ public bool HasRowId { } public Builder SetRowId(global::bnet.protocol.storage.RowId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasRowId = true; result.rowId_ = value; return this; } public Builder SetRowId(global::bnet.protocol.storage.RowId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -2572,13 +3509,14 @@ public Builder MergeRowId(global::bnet.protocol.storage.RowId value) { return this; } public Builder ClearRowId() { + PrepareBuilder(); result.hasRowId = false; - result.rowId_ = global::bnet.protocol.storage.RowId.DefaultInstance; + result.rowId_ = null; return this; } public bool HasRowKey { - get { return result.HasRowKey; } + get { return result.hasRowKey; } } public pb::ByteString RowKey { get { return result.RowKey; } @@ -2586,36 +3524,40 @@ public bool HasRowKey { } public Builder SetRowKey(pb::ByteString value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasRowKey = true; result.rowKey_ = value; return this; } public Builder ClearRowKey() { + PrepareBuilder(); result.hasRowKey = false; result.rowKey_ = pb::ByteString.Empty; return this; } public bool HasVersion { - get { return result.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_ = 0; return this; } public pbc::IPopsicleList RopsList { - get { return result.rops_; } + get { return PrepareBuilder().rops_; } } public int RopsCount { get { return result.RopsCount; } @@ -2625,53 +3567,61 @@ public int RopsCount { } public Builder SetRops(int index, global::bnet.protocol.storage.Command value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.rops_[index] = value; return this; } public Builder SetRops(int index, global::bnet.protocol.storage.Command.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.rops_[index] = builderForValue.Build(); return this; } public Builder AddRops(global::bnet.protocol.storage.Command value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.rops_.Add(value); return this; } public Builder AddRops(global::bnet.protocol.storage.Command.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.rops_.Add(builderForValue.Build()); return this; } public Builder AddRangeRops(scg::IEnumerable values) { - base.AddRange(values, result.rops_); + PrepareBuilder(); + result.rops_.Add(values); return this; } public Builder ClearRops() { + PrepareBuilder(); result.rops_.Clear(); return this; } public bool HasMutateVersion { - get { return result.HasMutateVersion; } + get { return result.hasMutateVersion; } } public ulong MutateVersion { get { return result.MutateVersion; } set { SetMutateVersion(value); } } public Builder SetMutateVersion(ulong value) { + PrepareBuilder(); result.hasMutateVersion = true; result.mutateVersion_ = value; return this; } public Builder ClearMutateVersion() { + PrepareBuilder(); result.hasMutateVersion = false; result.mutateVersion_ = 0; return this; } public bool HasPrivilege { - get { return result.HasPrivilege; } + get { return result.hasPrivilege; } } public global::bnet.protocol.storage.Privilege Privilege { get { return result.Privilege; } @@ -2679,19 +3629,22 @@ public bool HasPrivilege { } public Builder SetPrivilege(global::bnet.protocol.storage.Privilege value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasPrivilege = true; result.privilege_ = value; return this; } public Builder SetPrivilege(global::bnet.protocol.storage.Privilege.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -2701,8 +3654,9 @@ public Builder MergePrivilege(global::bnet.protocol.storage.Privilege value) { return this; } public Builder ClearPrivilege() { + PrepareBuilder(); result.hasPrivilege = false; - result.privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; + result.privilege_ = null; return this; } } @@ -2711,14 +3665,20 @@ static Operation() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class Cell : pb::GeneratedMessage { - private static readonly Cell defaultInstance = new Builder().BuildPartial(); + private Cell() { } + private static readonly Cell defaultInstance = new Cell().MakeReadOnly(); + private static readonly string[] _cellFieldNames = new string[] { "column_id", "data", "row_id", "row_key", "version" }; + private static readonly uint[] _cellFieldTags = new uint[] { 10, 42, 18, 26, 33 }; public static Cell DefaultInstance { get { return defaultInstance; } } public override Cell DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override Cell ThisMessage { @@ -2735,22 +3695,22 @@ protected override Cell ThisMessage { public const int ColumnIdFieldNumber = 1; private bool hasColumnId; - private global::bnet.protocol.storage.ColumnId columnId_ = global::bnet.protocol.storage.ColumnId.DefaultInstance; + private global::bnet.protocol.storage.ColumnId columnId_; public bool HasColumnId { get { return hasColumnId; } } public global::bnet.protocol.storage.ColumnId ColumnId { - get { return columnId_; } + get { return columnId_ ?? global::bnet.protocol.storage.ColumnId.DefaultInstance; } } public const int RowIdFieldNumber = 2; private bool hasRowId; - private global::bnet.protocol.storage.RowId rowId_ = global::bnet.protocol.storage.RowId.DefaultInstance; + private global::bnet.protocol.storage.RowId rowId_; public bool HasRowId { get { return hasRowId; } } public global::bnet.protocol.storage.RowId RowId { - get { return rowId_; } + get { return rowId_ ?? global::bnet.protocol.storage.RowId.DefaultInstance; } } public const int RowKeyFieldNumber = 3; @@ -2765,7 +3725,7 @@ public bool HasRowKey { public const int VersionFieldNumber = 4; private bool hasVersion; - private ulong version_ = 0; + private ulong version_; public bool HasVersion { get { return hasVersion; } } @@ -2793,22 +3753,23 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasColumnId) { - output.WriteMessage(1, ColumnId); + string[] field_names = _cellFieldNames; + if (hasColumnId) { + output.WriteMessage(1, field_names[0], ColumnId); } - if (HasRowId) { - output.WriteMessage(2, RowId); + if (hasRowId) { + output.WriteMessage(2, field_names[2], RowId); } - if (HasRowKey) { - output.WriteBytes(3, RowKey); + if (hasRowKey) { + output.WriteBytes(3, field_names[3], RowKey); } - if (HasVersion) { - output.WriteFixed64(4, Version); + if (hasVersion) { + output.WriteFixed64(4, field_names[4], Version); } - if (HasData) { - output.WriteBytes(5, Data); + if (hasData) { + output.WriteBytes(5, field_names[1], Data); } UnknownFields.WriteTo(output); } @@ -2820,19 +3781,19 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasColumnId) { + if (hasColumnId) { size += pb::CodedOutputStream.ComputeMessageSize(1, ColumnId); } - if (HasRowId) { + if (hasRowId) { size += pb::CodedOutputStream.ComputeMessageSize(2, RowId); } - if (HasRowKey) { + if (hasRowKey) { size += pb::CodedOutputStream.ComputeBytesSize(3, RowKey); } - if (HasVersion) { + if (hasVersion) { size += pb::CodedOutputStream.ComputeFixed64Size(4, Version); } - if (HasData) { + if (hasData) { size += pb::CodedOutputStream.ComputeBytesSize(5, Data); } size += UnknownFields.SerializedSize; @@ -2865,38 +3826,72 @@ public static Cell ParseDelimitedFrom(global::System.IO.Stream input) { 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) { + public static Cell ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static Cell ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static Cell ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private Cell MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(Cell cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Cell result; + + private Cell PrepareBuilder() { + if (resultIsReadOnly) { + Cell original = result; + result = new Cell(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - Cell result = new Cell(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override Cell MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new Cell(); + 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 { @@ -2908,12 +3903,11 @@ public override Cell DefaultInstanceForType { } public override Cell BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - Cell returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -2927,6 +3921,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(Cell other) { if (other == global::bnet.protocol.storage.Cell.DefaultInstance) return this; + PrepareBuilder(); if (other.HasColumnId) { MergeColumnId(other.ColumnId); } @@ -2946,20 +3941,31 @@ public override Builder MergeFrom(Cell 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(_cellFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _cellFieldTags[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)) { @@ -2971,12 +3977,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.storage.ColumnId.Builder subBuilder = global::bnet.protocol.storage.ColumnId.CreateBuilder(); - if (HasColumnId) { + if (result.hasColumnId) { subBuilder.MergeFrom(ColumnId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2985,7 +3991,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 18: { global::bnet.protocol.storage.RowId.Builder subBuilder = global::bnet.protocol.storage.RowId.CreateBuilder(); - if (HasRowId) { + if (result.hasRowId) { subBuilder.MergeFrom(RowId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -2993,24 +3999,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 26: { - RowKey = input.ReadBytes(); + result.hasRowKey = input.ReadBytes(ref result.rowKey_); break; } case 33: { - Version = input.ReadFixed64(); + result.hasVersion = input.ReadFixed64(ref result.version_); break; } case 42: { - Data = input.ReadBytes(); + result.hasData = input.ReadBytes(ref result.data_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasColumnId { - get { return result.HasColumnId; } + get { return result.hasColumnId; } } public global::bnet.protocol.storage.ColumnId ColumnId { get { return result.ColumnId; } @@ -3018,19 +4029,22 @@ public bool HasColumnId { } public Builder SetColumnId(global::bnet.protocol.storage.ColumnId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasColumnId = true; result.columnId_ = value; return this; } public Builder SetColumnId(global::bnet.protocol.storage.ColumnId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -3040,13 +4054,14 @@ public Builder MergeColumnId(global::bnet.protocol.storage.ColumnId value) { return this; } public Builder ClearColumnId() { + PrepareBuilder(); result.hasColumnId = false; - result.columnId_ = global::bnet.protocol.storage.ColumnId.DefaultInstance; + result.columnId_ = null; return this; } public bool HasRowId { - get { return result.HasRowId; } + get { return result.hasRowId; } } public global::bnet.protocol.storage.RowId RowId { get { return result.RowId; } @@ -3054,19 +4069,22 @@ public bool HasRowId { } public Builder SetRowId(global::bnet.protocol.storage.RowId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasRowId = true; result.rowId_ = value; return this; } public Builder SetRowId(global::bnet.protocol.storage.RowId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -3076,13 +4094,14 @@ public Builder MergeRowId(global::bnet.protocol.storage.RowId value) { return this; } public Builder ClearRowId() { + PrepareBuilder(); result.hasRowId = false; - result.rowId_ = global::bnet.protocol.storage.RowId.DefaultInstance; + result.rowId_ = null; return this; } public bool HasRowKey { - get { return result.HasRowKey; } + get { return result.hasRowKey; } } public pb::ByteString RowKey { get { return result.RowKey; } @@ -3090,36 +4109,40 @@ public bool HasRowKey { } public Builder SetRowKey(pb::ByteString value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasRowKey = true; result.rowKey_ = value; return this; } public Builder ClearRowKey() { + PrepareBuilder(); result.hasRowKey = false; result.rowKey_ = pb::ByteString.Empty; return this; } public bool HasVersion { - get { return result.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_ = 0; return this; } public bool HasData { - get { return result.HasData; } + get { return result.hasData; } } public pb::ByteString Data { get { return result.Data; } @@ -3127,11 +4150,13 @@ 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; @@ -3142,14 +4167,20 @@ static Cell() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class OperationResult : pb::GeneratedMessage { - private static readonly OperationResult defaultInstance = new Builder().BuildPartial(); + private OperationResult() { } + private static readonly OperationResult defaultInstance = new OperationResult().MakeReadOnly(); + private static readonly string[] _operationResultFieldNames = new string[] { "data", "error_code", "table_id" }; + private static readonly uint[] _operationResultFieldTags = new uint[] { 26, 8, 18 }; public static OperationResult DefaultInstance { get { return defaultInstance; } } public override OperationResult DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override OperationResult ThisMessage { @@ -3166,7 +4197,7 @@ protected override OperationResult ThisMessage { public const int ErrorCodeFieldNumber = 1; private bool hasErrorCode; - private uint errorCode_ = 0; + private uint errorCode_; public bool HasErrorCode { get { return hasErrorCode; } } @@ -3176,12 +4207,12 @@ public uint ErrorCode { public const int TableIdFieldNumber = 2; private bool hasTableId; - private global::bnet.protocol.storage.TableId tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; + private global::bnet.protocol.storage.TableId tableId_; public bool HasTableId { get { return hasTableId; } } public global::bnet.protocol.storage.TableId TableId { - get { return tableId_; } + get { return tableId_ ?? global::bnet.protocol.storage.TableId.DefaultInstance; } } public const int DataFieldNumber = 3; @@ -3207,16 +4238,17 @@ 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 = _operationResultFieldNames; + if (hasErrorCode) { + output.WriteUInt32(1, field_names[1], ErrorCode); } - if (HasTableId) { - output.WriteMessage(2, TableId); + if (hasTableId) { + output.WriteMessage(2, field_names[2], TableId); } - foreach (global::bnet.protocol.storage.Cell element in DataList) { - output.WriteMessage(3, element); + if (data_.Count > 0) { + output.WriteMessageArray(3, field_names[0], data_); } UnknownFields.WriteTo(output); } @@ -3228,10 +4260,10 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasErrorCode) { + if (hasErrorCode) { size += pb::CodedOutputStream.ComputeUInt32Size(1, ErrorCode); } - if (HasTableId) { + if (hasTableId) { size += pb::CodedOutputStream.ComputeMessageSize(2, TableId); } foreach (global::bnet.protocol.storage.Cell element in DataList) { @@ -3267,38 +4299,73 @@ public static OperationResult ParseDelimitedFrom(global::System.IO.Stream input) 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) { + public static OperationResult ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OperationResult ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static OperationResult ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private OperationResult MakeReadOnly() { + data_.MakeReadOnly(); + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(OperationResult cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OperationResult result; + + private OperationResult PrepareBuilder() { + if (resultIsReadOnly) { + OperationResult original = result; + result = new OperationResult(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - OperationResult result = new OperationResult(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override OperationResult MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new OperationResult(); + 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 { @@ -3310,13 +4377,11 @@ public override OperationResult DefaultInstanceForType { } public override OperationResult BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.data_.MakeReadOnly(); - OperationResult returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3330,6 +4395,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(OperationResult other) { if (other == global::bnet.protocol.storage.OperationResult.DefaultInstance) return this; + PrepareBuilder(); if (other.HasErrorCode) { ErrorCode = other.ErrorCode; } @@ -3337,26 +4403,37 @@ public override Builder MergeFrom(OperationResult other) { MergeTableId(other.TableId); } if (other.data_.Count != 0) { - base.AddRange(other.data_, result.data_); + result.data_.Add(other.data_); } 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(_operationResultFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _operationResultFieldTags[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)) { @@ -3368,16 +4445,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: { - ErrorCode = input.ReadUInt32(); + result.hasErrorCode = input.ReadUInt32(ref result.errorCode_); break; } case 18: { global::bnet.protocol.storage.TableId.Builder subBuilder = global::bnet.protocol.storage.TableId.CreateBuilder(); - if (HasTableId) { + if (result.hasTableId) { subBuilder.MergeFrom(TableId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3385,36 +4462,41 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 26: { - global::bnet.protocol.storage.Cell.Builder subBuilder = global::bnet.protocol.storage.Cell.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddData(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.data_, global::bnet.protocol.storage.Cell.DefaultInstance, extensionRegistry); 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 HasTableId { - get { return result.HasTableId; } + get { return result.hasTableId; } } public global::bnet.protocol.storage.TableId TableId { get { return result.TableId; } @@ -3422,19 +4504,22 @@ public bool HasTableId { } public Builder SetTableId(global::bnet.protocol.storage.TableId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasTableId = true; result.tableId_ = value; return this; } public Builder SetTableId(global::bnet.protocol.storage.TableId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -3444,13 +4529,14 @@ public Builder MergeTableId(global::bnet.protocol.storage.TableId value) { return this; } public Builder ClearTableId() { + PrepareBuilder(); result.hasTableId = false; - result.tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; + result.tableId_ = null; return this; } public pbc::IPopsicleList DataList { - get { return result.data_; } + get { return PrepareBuilder().data_; } } public int DataCount { get { return result.DataCount; } @@ -3460,29 +4546,35 @@ public int DataCount { } public Builder SetData(int index, global::bnet.protocol.storage.Cell value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.data_[index] = value; return this; } public Builder SetData(int index, global::bnet.protocol.storage.Cell.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.data_[index] = builderForValue.Build(); return this; } public Builder AddData(global::bnet.protocol.storage.Cell value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.data_.Add(value); return this; } public Builder AddData(global::bnet.protocol.storage.Cell.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.data_.Add(builderForValue.Build()); return this; } public Builder AddRangeData(scg::IEnumerable values) { - base.AddRange(values, result.data_); + PrepareBuilder(); + result.data_.Add(values); return this; } public Builder ClearData() { + PrepareBuilder(); result.data_.Clear(); return this; } @@ -3492,14 +4584,20 @@ static OperationResult() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class OpenTableRequest : pb::GeneratedMessage { - private static readonly OpenTableRequest defaultInstance = new Builder().BuildPartial(); + private OpenTableRequest() { } + private static readonly OpenTableRequest defaultInstance = new OpenTableRequest().MakeReadOnly(); + private static readonly string[] _openTableRequestFieldNames = new string[] { "agent_id", "privilege", "process_name", "schema", "table_id" }; + private static readonly uint[] _openTableRequestFieldTags = new uint[] { 34, 18, 42, 10, 26 }; public static OpenTableRequest DefaultInstance { get { return defaultInstance; } } public override OpenTableRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override OpenTableRequest ThisMessage { @@ -3526,32 +4624,32 @@ public string Schema { public const int PrivilegeFieldNumber = 2; private bool hasPrivilege; - private global::bnet.protocol.storage.Privilege privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; + private global::bnet.protocol.storage.Privilege privilege_; public bool HasPrivilege { get { return hasPrivilege; } } public global::bnet.protocol.storage.Privilege Privilege { - get { return privilege_; } + get { return privilege_ ?? global::bnet.protocol.storage.Privilege.DefaultInstance; } } public const int TableIdFieldNumber = 3; private bool hasTableId; - private global::bnet.protocol.storage.TableId tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; + private global::bnet.protocol.storage.TableId tableId_; public bool HasTableId { get { return hasTableId; } } public global::bnet.protocol.storage.TableId TableId { - get { return tableId_; } + get { return tableId_ ?? global::bnet.protocol.storage.TableId.DefaultInstance; } } public const int AgentIdFieldNumber = 4; 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 ProcessNameFieldNumber = 5; @@ -3575,22 +4673,23 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSchema) { - output.WriteString(1, Schema); + string[] field_names = _openTableRequestFieldNames; + if (hasSchema) { + output.WriteString(1, field_names[3], Schema); } - if (HasPrivilege) { - output.WriteMessage(2, Privilege); + if (hasPrivilege) { + output.WriteMessage(2, field_names[1], Privilege); } - if (HasTableId) { - output.WriteMessage(3, TableId); + if (hasTableId) { + output.WriteMessage(3, field_names[4], TableId); } - if (HasAgentId) { - output.WriteMessage(4, AgentId); + if (hasAgentId) { + output.WriteMessage(4, field_names[0], AgentId); } - if (HasProcessName) { - output.WriteString(5, ProcessName); + if (hasProcessName) { + output.WriteString(5, field_names[2], ProcessName); } UnknownFields.WriteTo(output); } @@ -3602,19 +4701,19 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSchema) { + if (hasSchema) { size += pb::CodedOutputStream.ComputeStringSize(1, Schema); } - if (HasPrivilege) { + if (hasPrivilege) { size += pb::CodedOutputStream.ComputeMessageSize(2, Privilege); } - if (HasTableId) { + if (hasTableId) { size += pb::CodedOutputStream.ComputeMessageSize(3, TableId); } - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(4, AgentId); } - if (HasProcessName) { + if (hasProcessName) { size += pb::CodedOutputStream.ComputeStringSize(5, ProcessName); } size += UnknownFields.SerializedSize; @@ -3647,38 +4746,72 @@ public static OpenTableRequest ParseDelimitedFrom(global::System.IO.Stream input 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) { + public static OpenTableRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OpenTableRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static OpenTableRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private OpenTableRequest MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(OpenTableRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OpenTableRequest result; + + private OpenTableRequest PrepareBuilder() { + if (resultIsReadOnly) { + OpenTableRequest original = result; + result = new OpenTableRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - OpenTableRequest result = new OpenTableRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override OpenTableRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new OpenTableRequest(); + 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 { @@ -3690,12 +4823,11 @@ public override OpenTableRequest DefaultInstanceForType { } public override OpenTableRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - OpenTableRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -3709,6 +4841,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(OpenTableRequest other) { if (other == global::bnet.protocol.storage.OpenTableRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSchema) { Schema = other.Schema; } @@ -3728,20 +4861,31 @@ public override Builder MergeFrom(OpenTableRequest 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(_openTableRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _openTableRequestFieldTags[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)) { @@ -3753,16 +4897,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: { - Schema = input.ReadString(); + result.hasSchema = input.ReadString(ref result.schema_); break; } case 18: { global::bnet.protocol.storage.Privilege.Builder subBuilder = global::bnet.protocol.storage.Privilege.CreateBuilder(); - if (HasPrivilege) { + if (result.hasPrivilege) { subBuilder.MergeFrom(Privilege); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3771,7 +4915,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 26: { global::bnet.protocol.storage.TableId.Builder subBuilder = global::bnet.protocol.storage.TableId.CreateBuilder(); - if (HasTableId) { + if (result.hasTableId) { subBuilder.MergeFrom(TableId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3780,7 +4924,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 34: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -3788,16 +4932,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 42: { - ProcessName = input.ReadString(); + result.hasProcessName = input.ReadString(ref result.processName_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSchema { - get { return result.HasSchema; } + get { return result.hasSchema; } } public string Schema { get { return result.Schema; } @@ -3805,18 +4954,20 @@ public string Schema { } public Builder SetSchema(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasSchema = true; result.schema_ = value; return this; } public Builder ClearSchema() { + PrepareBuilder(); result.hasSchema = false; result.schema_ = "DEFAULT"; return this; } public bool HasPrivilege { - get { return result.HasPrivilege; } + get { return result.hasPrivilege; } } public global::bnet.protocol.storage.Privilege Privilege { get { return result.Privilege; } @@ -3824,19 +4975,22 @@ public bool HasPrivilege { } public Builder SetPrivilege(global::bnet.protocol.storage.Privilege value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasPrivilege = true; result.privilege_ = value; return this; } public Builder SetPrivilege(global::bnet.protocol.storage.Privilege.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -3846,13 +5000,14 @@ public Builder MergePrivilege(global::bnet.protocol.storage.Privilege value) { return this; } public Builder ClearPrivilege() { + PrepareBuilder(); result.hasPrivilege = false; - result.privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; + result.privilege_ = null; return this; } public bool HasTableId { - get { return result.HasTableId; } + get { return result.hasTableId; } } public global::bnet.protocol.storage.TableId TableId { get { return result.TableId; } @@ -3860,19 +5015,22 @@ public bool HasTableId { } public Builder SetTableId(global::bnet.protocol.storage.TableId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasTableId = true; result.tableId_ = value; return this; } public Builder SetTableId(global::bnet.protocol.storage.TableId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -3882,13 +5040,14 @@ public Builder MergeTableId(global::bnet.protocol.storage.TableId value) { return this; } public Builder ClearTableId() { + PrepareBuilder(); result.hasTableId = false; - result.tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; + result.tableId_ = null; return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -3896,19 +5055,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 { @@ -3918,13 +5080,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 HasProcessName { - get { return result.HasProcessName; } + get { return result.hasProcessName; } } public string ProcessName { get { return result.ProcessName; } @@ -3932,11 +5095,13 @@ public string ProcessName { } public Builder SetProcessName(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasProcessName = true; result.processName_ = value; return this; } public Builder ClearProcessName() { + PrepareBuilder(); result.hasProcessName = false; result.processName_ = ""; return this; @@ -3947,14 +5112,20 @@ static OpenTableRequest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class OpenTableResponse : pb::GeneratedMessage { - private static readonly OpenTableResponse defaultInstance = new Builder().BuildPartial(); + private OpenTableResponse() { } + private static readonly OpenTableResponse defaultInstance = new OpenTableResponse().MakeReadOnly(); + private static readonly string[] _openTableResponseFieldNames = new string[] { }; + private static readonly uint[] _openTableResponseFieldTags = new uint[] { }; public static OpenTableResponse DefaultInstance { get { return defaultInstance; } } public override OpenTableResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override OpenTableResponse ThisMessage { @@ -3975,8 +5146,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 = _openTableResponseFieldNames; UnknownFields.WriteTo(output); } @@ -4017,38 +5189,72 @@ public static OpenTableResponse ParseDelimitedFrom(global::System.IO.Stream inpu 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) { + public static OpenTableResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OpenTableResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static OpenTableResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private OpenTableResponse MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(OpenTableResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OpenTableResponse result; + + private OpenTableResponse PrepareBuilder() { + if (resultIsReadOnly) { + OpenTableResponse original = result; + result = new OpenTableResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - OpenTableResponse result = new OpenTableResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override OpenTableResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new OpenTableResponse(); + 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 { @@ -4060,12 +5266,11 @@ public override OpenTableResponse DefaultInstanceForType { } public override OpenTableResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - OpenTableResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4079,24 +5284,36 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(OpenTableResponse other) { if (other == global::bnet.protocol.storage.OpenTableResponse.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(_openTableResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _openTableResponseFieldTags[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)) { @@ -4108,11 +5325,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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } @@ -4121,14 +5343,20 @@ static OpenTableResponse() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class OpenColumnRequest : pb::GeneratedMessage { - private static readonly OpenColumnRequest defaultInstance = new Builder().BuildPartial(); + private OpenColumnRequest() { } + private static readonly OpenColumnRequest defaultInstance = new OpenColumnRequest().MakeReadOnly(); + private static readonly string[] _openColumnRequestFieldNames = new string[] { "agent_id", "column_id", "privilege", "process_name", "proto_type", "schema", "table_id" }; + private static readonly uint[] _openColumnRequestFieldTags = new uint[] { 58, 42, 18, 66, 50, 10, 34 }; public static OpenColumnRequest DefaultInstance { get { return defaultInstance; } } public override OpenColumnRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override OpenColumnRequest ThisMessage { @@ -4155,32 +5383,32 @@ public string Schema { public const int PrivilegeFieldNumber = 2; private bool hasPrivilege; - private global::bnet.protocol.storage.Privilege privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; + private global::bnet.protocol.storage.Privilege privilege_; public bool HasPrivilege { get { return hasPrivilege; } } public global::bnet.protocol.storage.Privilege Privilege { - get { return privilege_; } + get { return privilege_ ?? global::bnet.protocol.storage.Privilege.DefaultInstance; } } public const int TableIdFieldNumber = 4; private bool hasTableId; - private global::bnet.protocol.storage.TableId tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; + private global::bnet.protocol.storage.TableId tableId_; public bool HasTableId { get { return hasTableId; } } public global::bnet.protocol.storage.TableId TableId { - get { return tableId_; } + get { return tableId_ ?? global::bnet.protocol.storage.TableId.DefaultInstance; } } public const int ColumnIdFieldNumber = 5; private bool hasColumnId; - private global::bnet.protocol.storage.ColumnId columnId_ = global::bnet.protocol.storage.ColumnId.DefaultInstance; + private global::bnet.protocol.storage.ColumnId columnId_; public bool HasColumnId { get { return hasColumnId; } } public global::bnet.protocol.storage.ColumnId ColumnId { - get { return columnId_; } + get { return columnId_ ?? global::bnet.protocol.storage.ColumnId.DefaultInstance; } } public const int ProtoTypeFieldNumber = 6; @@ -4195,12 +5423,12 @@ public string ProtoType { public const int AgentIdFieldNumber = 7; 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 ProcessNameFieldNumber = 8; @@ -4226,28 +5454,29 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSchema) { - output.WriteString(1, Schema); + string[] field_names = _openColumnRequestFieldNames; + if (hasSchema) { + output.WriteString(1, field_names[5], Schema); } - if (HasPrivilege) { - output.WriteMessage(2, Privilege); + if (hasPrivilege) { + output.WriteMessage(2, field_names[2], Privilege); } - if (HasTableId) { - output.WriteMessage(4, TableId); + if (hasTableId) { + output.WriteMessage(4, field_names[6], TableId); } - if (HasColumnId) { - output.WriteMessage(5, ColumnId); + if (hasColumnId) { + output.WriteMessage(5, field_names[1], ColumnId); } - if (HasProtoType) { - output.WriteString(6, ProtoType); + if (hasProtoType) { + output.WriteString(6, field_names[4], ProtoType); } - if (HasAgentId) { - output.WriteMessage(7, AgentId); + if (hasAgentId) { + output.WriteMessage(7, field_names[0], AgentId); } - if (HasProcessName) { - output.WriteString(8, ProcessName); + if (hasProcessName) { + output.WriteString(8, field_names[3], ProcessName); } UnknownFields.WriteTo(output); } @@ -4259,25 +5488,25 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSchema) { + if (hasSchema) { size += pb::CodedOutputStream.ComputeStringSize(1, Schema); } - if (HasPrivilege) { + if (hasPrivilege) { size += pb::CodedOutputStream.ComputeMessageSize(2, Privilege); } - if (HasTableId) { + if (hasTableId) { size += pb::CodedOutputStream.ComputeMessageSize(4, TableId); } - if (HasColumnId) { + if (hasColumnId) { size += pb::CodedOutputStream.ComputeMessageSize(5, ColumnId); } - if (HasProtoType) { + if (hasProtoType) { size += pb::CodedOutputStream.ComputeStringSize(6, ProtoType); } - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(7, AgentId); } - if (HasProcessName) { + if (hasProcessName) { size += pb::CodedOutputStream.ComputeStringSize(8, ProcessName); } size += UnknownFields.SerializedSize; @@ -4310,38 +5539,72 @@ public static OpenColumnRequest ParseDelimitedFrom(global::System.IO.Stream inpu 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) { + public static OpenColumnRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OpenColumnRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static OpenColumnRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private OpenColumnRequest MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(OpenColumnRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OpenColumnRequest result; + + private OpenColumnRequest PrepareBuilder() { + if (resultIsReadOnly) { + OpenColumnRequest original = result; + result = new OpenColumnRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - OpenColumnRequest result = new OpenColumnRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override OpenColumnRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new OpenColumnRequest(); + 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 { @@ -4353,12 +5616,11 @@ public override OpenColumnRequest DefaultInstanceForType { } public override OpenColumnRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - OpenColumnRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4372,6 +5634,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(OpenColumnRequest other) { if (other == global::bnet.protocol.storage.OpenColumnRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSchema) { Schema = other.Schema; } @@ -4397,20 +5660,31 @@ public override Builder MergeFrom(OpenColumnRequest 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(_openColumnRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _openColumnRequestFieldTags[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)) { @@ -4422,16 +5696,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: { - Schema = input.ReadString(); + result.hasSchema = input.ReadString(ref result.schema_); break; } case 18: { global::bnet.protocol.storage.Privilege.Builder subBuilder = global::bnet.protocol.storage.Privilege.CreateBuilder(); - if (HasPrivilege) { + if (result.hasPrivilege) { subBuilder.MergeFrom(Privilege); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4440,7 +5714,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 34: { global::bnet.protocol.storage.TableId.Builder subBuilder = global::bnet.protocol.storage.TableId.CreateBuilder(); - if (HasTableId) { + if (result.hasTableId) { subBuilder.MergeFrom(TableId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4449,7 +5723,7 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } case 42: { global::bnet.protocol.storage.ColumnId.Builder subBuilder = global::bnet.protocol.storage.ColumnId.CreateBuilder(); - if (HasColumnId) { + if (result.hasColumnId) { subBuilder.MergeFrom(ColumnId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4457,12 +5731,12 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 50: { - ProtoType = input.ReadString(); + result.hasProtoType = input.ReadString(ref result.protoType_); break; } case 58: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -4470,16 +5744,21 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 66: { - ProcessName = input.ReadString(); + result.hasProcessName = input.ReadString(ref result.processName_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSchema { - get { return result.HasSchema; } + get { return result.hasSchema; } } public string Schema { get { return result.Schema; } @@ -4487,18 +5766,20 @@ public string Schema { } public Builder SetSchema(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasSchema = true; result.schema_ = value; return this; } public Builder ClearSchema() { + PrepareBuilder(); result.hasSchema = false; result.schema_ = "DEFAULT"; return this; } public bool HasPrivilege { - get { return result.HasPrivilege; } + get { return result.hasPrivilege; } } public global::bnet.protocol.storage.Privilege Privilege { get { return result.Privilege; } @@ -4506,19 +5787,22 @@ public bool HasPrivilege { } public Builder SetPrivilege(global::bnet.protocol.storage.Privilege value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasPrivilege = true; result.privilege_ = value; return this; } public Builder SetPrivilege(global::bnet.protocol.storage.Privilege.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -4528,13 +5812,14 @@ public Builder MergePrivilege(global::bnet.protocol.storage.Privilege value) { return this; } public Builder ClearPrivilege() { + PrepareBuilder(); result.hasPrivilege = false; - result.privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; + result.privilege_ = null; return this; } public bool HasTableId { - get { return result.HasTableId; } + get { return result.hasTableId; } } public global::bnet.protocol.storage.TableId TableId { get { return result.TableId; } @@ -4542,19 +5827,22 @@ public bool HasTableId { } public Builder SetTableId(global::bnet.protocol.storage.TableId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasTableId = true; result.tableId_ = value; return this; } public Builder SetTableId(global::bnet.protocol.storage.TableId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -4564,13 +5852,14 @@ public Builder MergeTableId(global::bnet.protocol.storage.TableId value) { return this; } public Builder ClearTableId() { + PrepareBuilder(); result.hasTableId = false; - result.tableId_ = global::bnet.protocol.storage.TableId.DefaultInstance; + result.tableId_ = null; return this; } public bool HasColumnId { - get { return result.HasColumnId; } + get { return result.hasColumnId; } } public global::bnet.protocol.storage.ColumnId ColumnId { get { return result.ColumnId; } @@ -4578,19 +5867,22 @@ public bool HasColumnId { } public Builder SetColumnId(global::bnet.protocol.storage.ColumnId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasColumnId = true; result.columnId_ = value; return this; } public Builder SetColumnId(global::bnet.protocol.storage.ColumnId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -4600,13 +5892,14 @@ public Builder MergeColumnId(global::bnet.protocol.storage.ColumnId value) { return this; } public Builder ClearColumnId() { + PrepareBuilder(); result.hasColumnId = false; - result.columnId_ = global::bnet.protocol.storage.ColumnId.DefaultInstance; + result.columnId_ = null; return this; } public bool HasProtoType { - get { return result.HasProtoType; } + get { return result.hasProtoType; } } public string ProtoType { get { return result.ProtoType; } @@ -4614,18 +5907,20 @@ public string ProtoType { } public Builder SetProtoType(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasProtoType = true; result.protoType_ = value; return this; } public Builder ClearProtoType() { + PrepareBuilder(); result.hasProtoType = false; result.protoType_ = ""; return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -4633,19 +5928,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 { @@ -4655,13 +5953,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 HasProcessName { - get { return result.HasProcessName; } + get { return result.hasProcessName; } } public string ProcessName { get { return result.ProcessName; } @@ -4669,11 +5968,13 @@ public string ProcessName { } public Builder SetProcessName(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasProcessName = true; result.processName_ = value; return this; } public Builder ClearProcessName() { + PrepareBuilder(); result.hasProcessName = false; result.processName_ = ""; return this; @@ -4684,14 +5985,20 @@ static OpenColumnRequest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class OpenColumnResponse : pb::GeneratedMessage { - private static readonly OpenColumnResponse defaultInstance = new Builder().BuildPartial(); + private OpenColumnResponse() { } + private static readonly OpenColumnResponse defaultInstance = new OpenColumnResponse().MakeReadOnly(); + private static readonly string[] _openColumnResponseFieldNames = new string[] { "server_field_ops" }; + private static readonly uint[] _openColumnResponseFieldTags = new uint[] { 16 }; public static OpenColumnResponse DefaultInstance { get { return defaultInstance; } } public override OpenColumnResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override OpenColumnResponse ThisMessage { @@ -4708,7 +6015,7 @@ protected override OpenColumnResponse ThisMessage { public const int ServerFieldOpsFieldNumber = 2; private bool hasServerFieldOps; - private bool serverFieldOps_ = false; + private bool serverFieldOps_; public bool HasServerFieldOps { get { return hasServerFieldOps; } } @@ -4722,10 +6029,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasServerFieldOps) { - output.WriteBool(2, ServerFieldOps); + string[] field_names = _openColumnResponseFieldNames; + if (hasServerFieldOps) { + output.WriteBool(2, field_names[0], ServerFieldOps); } UnknownFields.WriteTo(output); } @@ -4737,7 +6045,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasServerFieldOps) { + if (hasServerFieldOps) { size += pb::CodedOutputStream.ComputeBoolSize(2, ServerFieldOps); } size += UnknownFields.SerializedSize; @@ -4770,38 +6078,72 @@ public static OpenColumnResponse ParseDelimitedFrom(global::System.IO.Stream inp 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) { + public static OpenColumnResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static OpenColumnResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static OpenColumnResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private OpenColumnResponse MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(OpenColumnResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private OpenColumnResponse result; + + private OpenColumnResponse PrepareBuilder() { + if (resultIsReadOnly) { + OpenColumnResponse original = result; + result = new OpenColumnResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - OpenColumnResponse result = new OpenColumnResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override OpenColumnResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new OpenColumnResponse(); + 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 { @@ -4813,12 +6155,11 @@ public override OpenColumnResponse DefaultInstanceForType { } public override OpenColumnResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - OpenColumnResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -4832,6 +6173,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(OpenColumnResponse other) { if (other == global::bnet.protocol.storage.OpenColumnResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasServerFieldOps) { ServerFieldOps = other.ServerFieldOps; } @@ -4839,20 +6181,31 @@ public override Builder MergeFrom(OpenColumnResponse 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(_openColumnResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _openColumnResponseFieldTags[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)) { @@ -4864,31 +6217,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; } case 16: { - ServerFieldOps = input.ReadBool(); + result.hasServerFieldOps = input.ReadBool(ref result.serverFieldOps_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasServerFieldOps { - get { return result.HasServerFieldOps; } + get { return result.hasServerFieldOps; } } public bool ServerFieldOps { get { return result.ServerFieldOps; } set { SetServerFieldOps(value); } } public Builder SetServerFieldOps(bool value) { + PrepareBuilder(); result.hasServerFieldOps = true; result.serverFieldOps_ = value; return this; } public Builder ClearServerFieldOps() { + PrepareBuilder(); result.hasServerFieldOps = false; result.serverFieldOps_ = false; return this; @@ -4899,14 +6259,20 @@ static OpenColumnResponse() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ExecuteRequest : pb::GeneratedMessage { - private static readonly ExecuteRequest defaultInstance = new Builder().BuildPartial(); + private ExecuteRequest() { } + private static readonly ExecuteRequest defaultInstance = new ExecuteRequest().MakeReadOnly(); + private static readonly string[] _executeRequestFieldNames = new string[] { "agent_id", "max_data_size", "operations", "privilege", "process_name", "query_name", "read_only", "schema", "timeout", "wants_column_name", "wants_row_key" }; + private static readonly uint[] _executeRequestFieldTags = new uint[] { 74, 48, 58, 18, 90, 82, 24, 10, 96, 40, 32 }; public static ExecuteRequest DefaultInstance { get { return defaultInstance; } } public override ExecuteRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ExecuteRequest ThisMessage { @@ -4933,17 +6299,17 @@ public string Schema { public const int PrivilegeFieldNumber = 2; private bool hasPrivilege; - private global::bnet.protocol.storage.Privilege privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; + private global::bnet.protocol.storage.Privilege privilege_; public bool HasPrivilege { get { return hasPrivilege; } } public global::bnet.protocol.storage.Privilege Privilege { - get { return privilege_; } + get { return privilege_ ?? global::bnet.protocol.storage.Privilege.DefaultInstance; } } public const int ReadOnlyFieldNumber = 3; private bool hasReadOnly; - private bool readOnly_ = false; + private bool readOnly_; public bool HasReadOnly { get { return hasReadOnly; } } @@ -4953,7 +6319,7 @@ public bool ReadOnly { public const int WantsRowKeyFieldNumber = 4; private bool hasWantsRowKey; - private bool wantsRowKey_ = false; + private bool wantsRowKey_; public bool HasWantsRowKey { get { return hasWantsRowKey; } } @@ -4963,7 +6329,7 @@ public bool WantsRowKey { public const int WantsColumnNameFieldNumber = 5; private bool hasWantsColumnName; - private bool wantsColumnName_ = false; + private bool wantsColumnName_; public bool HasWantsColumnName { get { return hasWantsColumnName; } } @@ -4995,7 +6361,7 @@ public int OperationsCount { public const int TimeoutFieldNumber = 12; private bool hasTimeout; - private uint timeout_ = 0; + private uint timeout_; public bool HasTimeout { get { return hasTimeout; } } @@ -5005,12 +6371,12 @@ public uint Timeout { public const int AgentIdFieldNumber = 9; 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 QueryNameFieldNumber = 10; @@ -5045,40 +6411,41 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasSchema) { - output.WriteString(1, Schema); + string[] field_names = _executeRequestFieldNames; + if (hasSchema) { + output.WriteString(1, field_names[7], Schema); } - if (HasPrivilege) { - output.WriteMessage(2, Privilege); + if (hasPrivilege) { + output.WriteMessage(2, field_names[3], Privilege); } - if (HasReadOnly) { - output.WriteBool(3, ReadOnly); + if (hasReadOnly) { + output.WriteBool(3, field_names[6], ReadOnly); } - if (HasWantsRowKey) { - output.WriteBool(4, WantsRowKey); + if (hasWantsRowKey) { + output.WriteBool(4, field_names[10], WantsRowKey); } - if (HasWantsColumnName) { - output.WriteBool(5, WantsColumnName); + if (hasWantsColumnName) { + output.WriteBool(5, field_names[9], WantsColumnName); } - if (HasMaxDataSize) { - output.WriteUInt32(6, MaxDataSize); + if (hasMaxDataSize) { + output.WriteUInt32(6, field_names[1], MaxDataSize); } - foreach (global::bnet.protocol.storage.Operation element in OperationsList) { - output.WriteMessage(7, element); + if (operations_.Count > 0) { + output.WriteMessageArray(7, field_names[2], operations_); } - if (HasAgentId) { - output.WriteMessage(9, AgentId); + if (hasAgentId) { + output.WriteMessage(9, field_names[0], AgentId); } - if (HasQueryName) { - output.WriteString(10, QueryName); + if (hasQueryName) { + output.WriteString(10, field_names[5], QueryName); } - if (HasProcessName) { - output.WriteString(11, ProcessName); + if (hasProcessName) { + output.WriteString(11, field_names[4], ProcessName); } - if (HasTimeout) { - output.WriteUInt32(12, Timeout); + if (hasTimeout) { + output.WriteUInt32(12, field_names[8], Timeout); } UnknownFields.WriteTo(output); } @@ -5090,37 +6457,37 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasSchema) { + if (hasSchema) { size += pb::CodedOutputStream.ComputeStringSize(1, Schema); } - if (HasPrivilege) { + if (hasPrivilege) { size += pb::CodedOutputStream.ComputeMessageSize(2, Privilege); } - if (HasReadOnly) { + if (hasReadOnly) { size += pb::CodedOutputStream.ComputeBoolSize(3, ReadOnly); } - if (HasWantsRowKey) { + if (hasWantsRowKey) { size += pb::CodedOutputStream.ComputeBoolSize(4, WantsRowKey); } - if (HasWantsColumnName) { + if (hasWantsColumnName) { size += pb::CodedOutputStream.ComputeBoolSize(5, WantsColumnName); } - if (HasMaxDataSize) { + 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) { + if (hasTimeout) { size += pb::CodedOutputStream.ComputeUInt32Size(12, Timeout); } - if (HasAgentId) { + if (hasAgentId) { size += pb::CodedOutputStream.ComputeMessageSize(9, AgentId); } - if (HasQueryName) { + if (hasQueryName) { size += pb::CodedOutputStream.ComputeStringSize(10, QueryName); } - if (HasProcessName) { + if (hasProcessName) { size += pb::CodedOutputStream.ComputeStringSize(11, ProcessName); } size += UnknownFields.SerializedSize; @@ -5153,38 +6520,73 @@ public static ExecuteRequest ParseDelimitedFrom(global::System.IO.Stream input) 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) { + public static ExecuteRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ExecuteRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ExecuteRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ExecuteRequest 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(ExecuteRequest 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(ExecuteRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ExecuteRequest result; + + private ExecuteRequest PrepareBuilder() { + if (resultIsReadOnly) { + ExecuteRequest original = result; + result = new ExecuteRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - ExecuteRequest result = new ExecuteRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ExecuteRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ExecuteRequest(); + 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 { @@ -5196,13 +6598,11 @@ public override ExecuteRequest DefaultInstanceForType { } public override ExecuteRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.operations_.MakeReadOnly(); - ExecuteRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -5216,6 +6616,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ExecuteRequest other) { if (other == global::bnet.protocol.storage.ExecuteRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasSchema) { Schema = other.Schema; } @@ -5235,7 +6636,7 @@ public override Builder MergeFrom(ExecuteRequest other) { MaxDataSize = other.MaxDataSize; } if (other.operations_.Count != 0) { - base.AddRange(other.operations_, result.operations_); + result.operations_.Add(other.operations_); } if (other.HasTimeout) { Timeout = other.Timeout; @@ -5253,20 +6654,31 @@ public override Builder MergeFrom(ExecuteRequest 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(_executeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _executeRequestFieldTags[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)) { @@ -5278,16 +6690,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: { - Schema = input.ReadString(); + result.hasSchema = input.ReadString(ref result.schema_); break; } case 18: { global::bnet.protocol.storage.Privilege.Builder subBuilder = global::bnet.protocol.storage.Privilege.CreateBuilder(); - if (HasPrivilege) { + if (result.hasPrivilege) { subBuilder.MergeFrom(Privilege); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5295,30 +6707,28 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 24: { - ReadOnly = input.ReadBool(); + result.hasReadOnly = input.ReadBool(ref result.readOnly_); break; } case 32: { - WantsRowKey = input.ReadBool(); + result.hasWantsRowKey = input.ReadBool(ref result.wantsRowKey_); break; } case 40: { - WantsColumnName = input.ReadBool(); + result.hasWantsColumnName = input.ReadBool(ref result.wantsColumnName_); break; } case 48: { - MaxDataSize = input.ReadUInt32(); + result.hasMaxDataSize = input.ReadUInt32(ref result.maxDataSize_); break; } case 58: { - global::bnet.protocol.storage.Operation.Builder subBuilder = global::bnet.protocol.storage.Operation.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddOperations(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.operations_, global::bnet.protocol.storage.Operation.DefaultInstance, extensionRegistry); break; } case 74: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasAgentId) { + if (result.hasAgentId) { subBuilder.MergeFrom(AgentId); } input.ReadMessage(subBuilder, extensionRegistry); @@ -5326,24 +6736,29 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis break; } case 82: { - QueryName = input.ReadString(); + result.hasQueryName = input.ReadString(ref result.queryName_); break; } case 90: { - ProcessName = input.ReadString(); + result.hasProcessName = input.ReadString(ref result.processName_); break; } case 96: { - Timeout = input.ReadUInt32(); + result.hasTimeout = input.ReadUInt32(ref result.timeout_); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasSchema { - get { return result.HasSchema; } + get { return result.hasSchema; } } public string Schema { get { return result.Schema; } @@ -5351,18 +6766,20 @@ public string Schema { } public Builder SetSchema(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasSchema = true; result.schema_ = value; return this; } public Builder ClearSchema() { + PrepareBuilder(); result.hasSchema = false; result.schema_ = "DEFAULT"; return this; } public bool HasPrivilege { - get { return result.HasPrivilege; } + get { return result.hasPrivilege; } } public global::bnet.protocol.storage.Privilege Privilege { get { return result.Privilege; } @@ -5370,19 +6787,22 @@ public bool HasPrivilege { } public Builder SetPrivilege(global::bnet.protocol.storage.Privilege value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasPrivilege = true; result.privilege_ = value; return this; } public Builder SetPrivilege(global::bnet.protocol.storage.Privilege.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + 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 { @@ -5392,85 +6812,94 @@ public Builder MergePrivilege(global::bnet.protocol.storage.Privilege value) { return this; } public Builder ClearPrivilege() { + PrepareBuilder(); result.hasPrivilege = false; - result.privilege_ = global::bnet.protocol.storage.Privilege.DefaultInstance; + result.privilege_ = null; return this; } public bool HasReadOnly { - get { return result.HasReadOnly; } + get { return result.hasReadOnly; } } public bool ReadOnly { get { return result.ReadOnly; } set { SetReadOnly(value); } } public Builder SetReadOnly(bool value) { + PrepareBuilder(); result.hasReadOnly = true; result.readOnly_ = value; return this; } public Builder ClearReadOnly() { + PrepareBuilder(); result.hasReadOnly = false; result.readOnly_ = false; return this; } public bool HasWantsRowKey { - get { return result.HasWantsRowKey; } + get { return result.hasWantsRowKey; } } public bool WantsRowKey { get { return result.WantsRowKey; } set { SetWantsRowKey(value); } } public Builder SetWantsRowKey(bool value) { + PrepareBuilder(); result.hasWantsRowKey = true; result.wantsRowKey_ = value; return this; } public Builder ClearWantsRowKey() { + PrepareBuilder(); result.hasWantsRowKey = false; result.wantsRowKey_ = false; return this; } public bool HasWantsColumnName { - get { return result.HasWantsColumnName; } + get { return result.hasWantsColumnName; } } public bool WantsColumnName { get { return result.WantsColumnName; } set { SetWantsColumnName(value); } } public Builder SetWantsColumnName(bool value) { + PrepareBuilder(); result.hasWantsColumnName = true; result.wantsColumnName_ = value; return this; } public Builder ClearWantsColumnName() { + PrepareBuilder(); result.hasWantsColumnName = false; result.wantsColumnName_ = false; return this; } public bool HasMaxDataSize { - get { return result.HasMaxDataSize; } + get { return result.hasMaxDataSize; } } public uint MaxDataSize { get { return result.MaxDataSize; } set { SetMaxDataSize(value); } } public Builder SetMaxDataSize(uint value) { + PrepareBuilder(); result.hasMaxDataSize = true; result.maxDataSize_ = value; return this; } public Builder ClearMaxDataSize() { + PrepareBuilder(); result.hasMaxDataSize = false; result.maxDataSize_ = 16777215; return this; } public pbc::IPopsicleList OperationsList { - get { return result.operations_; } + get { return PrepareBuilder().operations_; } } public int OperationsCount { get { return result.OperationsCount; } @@ -5480,53 +6909,61 @@ public int OperationsCount { } public Builder SetOperations(int index, global::bnet.protocol.storage.Operation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.operations_[index] = value; return this; } public Builder SetOperations(int index, global::bnet.protocol.storage.Operation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.operations_[index] = builderForValue.Build(); return this; } public Builder AddOperations(global::bnet.protocol.storage.Operation value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.operations_.Add(value); return this; } public Builder AddOperations(global::bnet.protocol.storage.Operation.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.operations_.Add(builderForValue.Build()); return this; } public Builder AddRangeOperations(scg::IEnumerable values) { - base.AddRange(values, result.operations_); + PrepareBuilder(); + result.operations_.Add(values); return this; } public Builder ClearOperations() { + PrepareBuilder(); result.operations_.Clear(); return this; } public bool HasTimeout { - get { return result.HasTimeout; } + get { return result.hasTimeout; } } public uint Timeout { get { return result.Timeout; } set { SetTimeout(value); } } public Builder SetTimeout(uint value) { + PrepareBuilder(); result.hasTimeout = true; result.timeout_ = value; return this; } public Builder ClearTimeout() { + PrepareBuilder(); result.hasTimeout = false; result.timeout_ = 0; return this; } public bool HasAgentId { - get { return result.HasAgentId; } + get { return result.hasAgentId; } } public global::bnet.protocol.EntityId AgentId { get { return result.AgentId; } @@ -5534,19 +6971,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 { @@ -5556,13 +6996,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 HasQueryName { - get { return result.HasQueryName; } + get { return result.hasQueryName; } } public string QueryName { get { return result.QueryName; } @@ -5570,18 +7011,20 @@ public string QueryName { } public Builder SetQueryName(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasQueryName = true; result.queryName_ = value; return this; } public Builder ClearQueryName() { + PrepareBuilder(); result.hasQueryName = false; result.queryName_ = "NoName"; return this; } public bool HasProcessName { - get { return result.HasProcessName; } + get { return result.hasProcessName; } } public string ProcessName { get { return result.ProcessName; } @@ -5589,11 +7032,13 @@ public string ProcessName { } public Builder SetProcessName(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasProcessName = true; result.processName_ = value; return this; } public Builder ClearProcessName() { + PrepareBuilder(); result.hasProcessName = false; result.processName_ = ""; return this; @@ -5604,14 +7049,20 @@ static ExecuteRequest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ExecuteResponse : pb::GeneratedMessage { - private static readonly ExecuteResponse defaultInstance = new Builder().BuildPartial(); + private ExecuteResponse() { } + private static readonly ExecuteResponse defaultInstance = new ExecuteResponse().MakeReadOnly(); + private static readonly string[] _executeResponseFieldNames = new string[] { "error_code", "error_message", "results" }; + private static readonly uint[] _executeResponseFieldTags = new uint[] { 8, 26, 18 }; public static ExecuteResponse DefaultInstance { get { return defaultInstance; } } public override ExecuteResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ExecuteResponse ThisMessage { @@ -5628,7 +7079,7 @@ protected override ExecuteResponse ThisMessage { public const int ErrorCodeFieldNumber = 1; private bool hasErrorCode; - private uint errorCode_ = 0; + private uint errorCode_; public bool HasErrorCode { get { return hasErrorCode; } } @@ -5667,16 +7118,17 @@ 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 = _executeResponseFieldNames; + if (hasErrorCode) { + output.WriteUInt32(1, field_names[0], ErrorCode); } - foreach (global::bnet.protocol.storage.OperationResult element in ResultsList) { - output.WriteMessage(2, element); + if (results_.Count > 0) { + output.WriteMessageArray(2, field_names[2], results_); } - if (HasErrorMessage) { - output.WriteString(3, ErrorMessage); + if (hasErrorMessage) { + output.WriteString(3, field_names[1], ErrorMessage); } UnknownFields.WriteTo(output); } @@ -5688,13 +7140,13 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasErrorCode) { + 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) { + if (hasErrorMessage) { size += pb::CodedOutputStream.ComputeStringSize(3, ErrorMessage); } size += UnknownFields.SerializedSize; @@ -5727,38 +7179,73 @@ public static ExecuteResponse ParseDelimitedFrom(global::System.IO.Stream input) 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) { + public static ExecuteResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ExecuteResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ExecuteResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ExecuteResponse MakeReadOnly() { + results_.MakeReadOnly(); + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(ExecuteResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ExecuteResponse result; - ExecuteResponse result = new ExecuteResponse(); + private ExecuteResponse PrepareBuilder() { + if (resultIsReadOnly) { + ExecuteResponse original = result; + result = new ExecuteResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ExecuteResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ExecuteResponse(); + 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 { @@ -5770,13 +7257,11 @@ public override ExecuteResponse DefaultInstanceForType { } public override ExecuteResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.results_.MakeReadOnly(); - ExecuteResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -5790,11 +7275,12 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ExecuteResponse other) { if (other == global::bnet.protocol.storage.ExecuteResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.HasErrorCode) { ErrorCode = other.ErrorCode; } if (other.results_.Count != 0) { - base.AddRange(other.results_, result.results_); + result.results_.Add(other.results_); } if (other.HasErrorMessage) { ErrorMessage = other.ErrorMessage; @@ -5803,20 +7289,31 @@ public override Builder MergeFrom(ExecuteResponse 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(_executeResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _executeResponseFieldTags[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)) { @@ -5828,48 +7325,53 @@ 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: { - global::bnet.protocol.storage.OperationResult.Builder subBuilder = global::bnet.protocol.storage.OperationResult.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddResults(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.results_, global::bnet.protocol.storage.OperationResult.DefaultInstance, extensionRegistry); break; } case 26: { - ErrorMessage = input.ReadString(); + result.hasErrorMessage = input.ReadString(ref result.errorMessage_); 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 pbc::IPopsicleList ResultsList { - get { return result.results_; } + get { return PrepareBuilder().results_; } } public int ResultsCount { get { return result.ResultsCount; } @@ -5879,35 +7381,41 @@ public int ResultsCount { } public Builder SetResults(int index, global::bnet.protocol.storage.OperationResult value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.results_[index] = value; return this; } public Builder SetResults(int index, global::bnet.protocol.storage.OperationResult.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.results_[index] = builderForValue.Build(); return this; } public Builder AddResults(global::bnet.protocol.storage.OperationResult value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.results_.Add(value); return this; } public Builder AddResults(global::bnet.protocol.storage.OperationResult.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.results_.Add(builderForValue.Build()); return this; } public Builder AddRangeResults(scg::IEnumerable values) { - base.AddRange(values, result.results_); + PrepareBuilder(); + result.results_.Add(values); return this; } public Builder ClearResults() { + PrepareBuilder(); result.results_.Clear(); return this; } public bool HasErrorMessage { - get { return result.HasErrorMessage; } + get { return result.hasErrorMessage; } } public string ErrorMessage { get { return result.ErrorMessage; } @@ -5915,11 +7423,13 @@ public string ErrorMessage { } public Builder SetErrorMessage(string value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasErrorMessage = true; result.errorMessage_ = value; return this; } public Builder ClearErrorMessage() { + PrepareBuilder(); result.hasErrorMessage = false; result.errorMessage_ = ""; return this; @@ -5933,6 +7443,9 @@ static ExecuteResponse() { #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 StorageService : pb::IService { public abstract void Execute( pb::IRpcController controller, @@ -6022,6 +7535,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.storage.StorageService { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -6064,3 +7580,5 @@ public override void OpenColumn( #endregion } + +#endregion Designer generated code diff --git a/src/LibMooNet/bnet/protocol/toon/Toon.cs b/src/LibMooNet/bnet/protocol/toon/Toon.cs new file mode 100644 index 00000000..02b9cfdf --- /dev/null +++ b/src/LibMooNet/bnet/protocol/toon/Toon.cs @@ -0,0 +1,2374 @@ +// 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.toon { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + 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; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_toon_CreateToonEntityRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_CreateToonEntityRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_toon_CreateToonEntityResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_CreateToonEntityResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_toon_FinalizeToonCreationRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_FinalizeToonCreationRequest__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( + "CiJzZXJ2aWNlL3Rvb24vZGVmaW5pdGlvbi90b29uLnByb3RvEhJibmV0LnBy" + + "b3RvY29sLnRvb24aEWxpYi9ycGMvcnBjLnByb3RvGhlsaWIvcHJvdG9jb2wv" + + "ZW50aXR5LnByb3RvIkgKClRvb25IYW5kbGUSCgoCaWQYASACKAYSDwoHcHJv" + + "Z3JhbRgCIAIoBxIOCgZyZWdpb24YAyACKA0SDQoFcmVhbG0YBCACKA0iHQoI" + + "VG9vbk5hbWUSEQoJZnVsbF9uYW1lGAEgAigJIjYKCFRvb25JbmZvEioKBG5h" + + "bWUYASACKAsyHC5ibmV0LnByb3RvY29sLnRvb24uVG9vbk5hbWUinAEKF0Ny" + + "ZWF0ZVRvb25FbnRpdHlSZXF1ZXN0Eg0KBXJlYWxtGAEgAigNEjAKD2dhbWVf" + + "YWNjb3VudF9pZBgCIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQSDQoF" + + "dG9rZW4YAyACKA0SMQoPb3JpZ2luYWxfc2VuZGVyGAQgAigLMhguYm5ldC5w" + + "cm90b2NvbC5Qcm9jZXNzSWQiRAoYQ3JlYXRlVG9vbkVudGl0eVJlc3BvbnNl" + + "EigKB3Rvb25faWQYASACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkIskB" + + "ChtGaW5hbGl6ZVRvb25DcmVhdGlvblJlcXVlc3QSDAoEbmFtZRgBIAIoCRIw" + + "Cg9nYW1lX2FjY291bnRfaWQYAiACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0" + + "eUlkEigKB3Rvb25faWQYAyACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlk" + + "Eg0KBXRva2VuGAQgAigNEjEKD29yaWdpbmFsX3NlbmRlchgFIAIoCzIYLmJu" + + "ZXQucHJvdG9jb2wuUHJvY2Vzc0lkQgOAAQA="); + 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", }); + internal__static_bnet_protocol_toon_CreateToonEntityRequest__Descriptor = Descriptor.MessageTypes[3]; + internal__static_bnet_protocol_toon_CreateToonEntityRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_CreateToonEntityRequest__Descriptor, + new string[] { "Realm", "GameAccountId", "Token", "OriginalSender", }); + internal__static_bnet_protocol_toon_CreateToonEntityResponse__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_toon_CreateToonEntityResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_CreateToonEntityResponse__Descriptor, + new string[] { "ToonId", }); + internal__static_bnet_protocol_toon_FinalizeToonCreationRequest__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_toon_FinalizeToonCreationRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_FinalizeToonCreationRequest__Descriptor, + new string[] { "Name", "GameAccountId", "ToonId", "Token", "OriginalSender", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + 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 ToonHandle : pb::GeneratedMessage { + private ToonHandle() { } + private static readonly ToonHandle defaultInstance = new ToonHandle().MakeReadOnly(); + private static readonly string[] _toonHandleFieldNames = new string[] { "id", "program", "realm", "region" }; + private static readonly uint[] _toonHandleFieldTags = new uint[] { 9, 21, 32, 24 }; + 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_; + public bool HasId { + get { return hasId; } + } + public ulong 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 const int RealmFieldNumber = 4; + private bool hasRealm; + private uint realm_; + 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::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _toonHandleFieldNames; + if (hasId) { + output.WriteFixed64(1, field_names[0], Id); + } + if (hasProgram) { + output.WriteFixed32(2, field_names[1], Program); + } + if (hasRegion) { + output.WriteUInt32(3, field_names[3], Region); + } + if (hasRealm) { + output.WriteUInt32(4, field_names[2], 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::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ToonHandle ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ToonHandle MakeReadOnly() { + return this; + } + + public 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 new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ToonHandle cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ToonHandle result; + + private ToonHandle PrepareBuilder() { + if (resultIsReadOnly) { + ToonHandle original = result; + result = new ToonHandle(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ToonHandle MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.toon.ToonHandle.Descriptor; } + } + + public override ToonHandle DefaultInstanceForType { + get { return global::bnet.protocol.toon.ToonHandle.DefaultInstance; } + } + + public override ToonHandle BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + 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; + PrepareBuilder(); + 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::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_toonHandleFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _toonHandleFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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 21: { + result.hasProgram = input.ReadFixed32(ref result.program_); + break; + } + case 24: { + result.hasRegion = input.ReadUInt32(ref result.region_); + break; + } + case 32: { + result.hasRealm = input.ReadUInt32(ref result.realm_); + 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 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; + } + + public bool HasRealm { + get { return result.hasRealm; } + } + public uint Realm { + get { return result.Realm; } + set { SetRealm(value); } + } + public Builder SetRealm(uint value) { + PrepareBuilder(); + result.hasRealm = true; + result.realm_ = value; + return this; + } + public Builder ClearRealm() { + PrepareBuilder(); + result.hasRealm = false; + result.realm_ = 0; + return this; + } + } + static ToonHandle() { + object.ReferenceEquals(global::bnet.protocol.toon.Toon.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ToonName : pb::GeneratedMessage { + private ToonName() { } + private static readonly ToonName defaultInstance = new ToonName().MakeReadOnly(); + private static readonly string[] _toonNameFieldNames = new string[] { "full_name" }; + private static readonly uint[] _toonNameFieldTags = new uint[] { 10 }; + 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::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _toonNameFieldNames; + if (hasFullName) { + output.WriteString(1, field_names[0], 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::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ToonName ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ToonName MakeReadOnly() { + return this; + } + + public 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 new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ToonName cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ToonName result; + + private ToonName PrepareBuilder() { + if (resultIsReadOnly) { + ToonName original = result; + result = new ToonName(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ToonName MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.toon.ToonName.Descriptor; } + } + + public override ToonName DefaultInstanceForType { + get { return global::bnet.protocol.toon.ToonName.DefaultInstance; } + } + + public override ToonName BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + 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; + PrepareBuilder(); + if (other.HasFullName) { + FullName = other.FullName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_toonNameFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _toonNameFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.hasFullName = input.ReadString(ref result.fullName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + 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; + } + } + static ToonName() { + object.ReferenceEquals(global::bnet.protocol.toon.Toon.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ToonInfo : pb::GeneratedMessage { + private ToonInfo() { } + private static readonly ToonInfo defaultInstance = new ToonInfo().MakeReadOnly(); + private static readonly string[] _toonInfoFieldNames = new string[] { "name" }; + private static readonly uint[] _toonInfoFieldTags = new uint[] { 10 }; + 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_; + public bool HasName { + get { return hasName; } + } + public global::bnet.protocol.toon.ToonName Name { + get { return name_ ?? global::bnet.protocol.toon.ToonName.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasName) return false; + if (!Name.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _toonInfoFieldNames; + if (hasName) { + output.WriteMessage(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.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::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ToonInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ToonInfo MakeReadOnly() { + return this; + } + + public 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 new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ToonInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ToonInfo result; + + private ToonInfo PrepareBuilder() { + if (resultIsReadOnly) { + ToonInfo original = result; + result = new ToonInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ToonInfo MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.toon.ToonInfo.Descriptor; } + } + + public override ToonInfo DefaultInstanceForType { + get { return global::bnet.protocol.toon.ToonInfo.DefaultInstance; } + } + + public override ToonInfo BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + 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; + PrepareBuilder(); + if (other.HasName) { + MergeName(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(_toonInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _toonInfoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.toon.ToonName.Builder subBuilder = global::bnet.protocol.toon.ToonName.CreateBuilder(); + if (result.hasName) { + subBuilder.MergeFrom(Name); + } + input.ReadMessage(subBuilder, extensionRegistry); + Name = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + 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"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder SetName(global::bnet.protocol.toon.ToonName.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasName = true; + result.name_ = builderForValue.Build(); + return this; + } + public Builder MergeName(global::bnet.protocol.toon.ToonName value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + 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() { + PrepareBuilder(); + result.hasName = false; + result.name_ = null; + return this; + } + } + static ToonInfo() { + object.ReferenceEquals(global::bnet.protocol.toon.Toon.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CreateToonEntityRequest : pb::GeneratedMessage { + private CreateToonEntityRequest() { } + private static readonly CreateToonEntityRequest defaultInstance = new CreateToonEntityRequest().MakeReadOnly(); + private static readonly string[] _createToonEntityRequestFieldNames = new string[] { "game_account_id", "original_sender", "realm", "token" }; + private static readonly uint[] _createToonEntityRequestFieldTags = new uint[] { 18, 34, 8, 24 }; + public static CreateToonEntityRequest DefaultInstance { + get { return defaultInstance; } + } + + public override CreateToonEntityRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateToonEntityRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.toon.Toon.internal__static_bnet_protocol_toon_CreateToonEntityRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.toon.Toon.internal__static_bnet_protocol_toon_CreateToonEntityRequest__FieldAccessorTable; } + } + + public const int RealmFieldNumber = 1; + private bool hasRealm; + private uint realm_; + public bool HasRealm { + get { return hasRealm; } + } + public uint Realm { + get { return realm_; } + } + + 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 TokenFieldNumber = 3; + private bool hasToken; + private uint token_; + public bool HasToken { + get { return hasToken; } + } + public uint Token { + get { return token_; } + } + + public const int OriginalSenderFieldNumber = 4; + private bool hasOriginalSender; + private global::bnet.protocol.ProcessId originalSender_; + public bool HasOriginalSender { + get { return hasOriginalSender; } + } + public global::bnet.protocol.ProcessId OriginalSender { + get { return originalSender_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasRealm) return false; + if (!hasGameAccountId) return false; + if (!hasToken) return false; + if (!hasOriginalSender) return false; + if (!GameAccountId.IsInitialized) return false; + if (!OriginalSender.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _createToonEntityRequestFieldNames; + if (hasRealm) { + output.WriteUInt32(1, field_names[2], Realm); + } + if (hasGameAccountId) { + output.WriteMessage(2, field_names[0], GameAccountId); + } + if (hasToken) { + output.WriteUInt32(3, field_names[3], Token); + } + if (hasOriginalSender) { + output.WriteMessage(4, field_names[1], OriginalSender); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasRealm) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Realm); + } + if (hasGameAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); + } + if (hasToken) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, Token); + } + if (hasOriginalSender) { + size += pb::CodedOutputStream.ComputeMessageSize(4, OriginalSender); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CreateToonEntityRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateToonEntityRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateToonEntityRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateToonEntityRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateToonEntityRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateToonEntityRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateToonEntityRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateToonEntityRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateToonEntityRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateToonEntityRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateToonEntityRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateToonEntityRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateToonEntityRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateToonEntityRequest result; + + private CreateToonEntityRequest PrepareBuilder() { + if (resultIsReadOnly) { + CreateToonEntityRequest original = result; + result = new CreateToonEntityRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateToonEntityRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.toon.CreateToonEntityRequest.Descriptor; } + } + + public override CreateToonEntityRequest DefaultInstanceForType { + get { return global::bnet.protocol.toon.CreateToonEntityRequest.DefaultInstance; } + } + + public override CreateToonEntityRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateToonEntityRequest) { + return MergeFrom((CreateToonEntityRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateToonEntityRequest other) { + if (other == global::bnet.protocol.toon.CreateToonEntityRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasRealm) { + Realm = other.Realm; + } + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); + } + if (other.HasToken) { + Token = other.Token; + } + if (other.HasOriginalSender) { + MergeOriginalSender(other.OriginalSender); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createToonEntityRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createToonEntityRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.hasRealm = input.ReadUInt32(ref result.realm_); + 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 24: { + result.hasToken = input.ReadUInt32(ref result.token_); + break; + } + case 34: { + global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); + if (result.hasOriginalSender) { + subBuilder.MergeFrom(OriginalSender); + } + input.ReadMessage(subBuilder, extensionRegistry); + OriginalSender = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasRealm { + get { return result.hasRealm; } + } + public uint Realm { + get { return result.Realm; } + set { SetRealm(value); } + } + public Builder SetRealm(uint value) { + PrepareBuilder(); + result.hasRealm = true; + result.realm_ = value; + return this; + } + public Builder ClearRealm() { + PrepareBuilder(); + result.hasRealm = false; + result.realm_ = 0; + 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 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 HasOriginalSender { + get { return result.hasOriginalSender; } + } + public global::bnet.protocol.ProcessId OriginalSender { + get { return result.OriginalSender; } + set { SetOriginalSender(value); } + } + public Builder SetOriginalSender(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOriginalSender = true; + result.originalSender_ = value; + return this; + } + public Builder SetOriginalSender(global::bnet.protocol.ProcessId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOriginalSender = true; + result.originalSender_ = builderForValue.Build(); + return this; + } + public Builder MergeOriginalSender(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOriginalSender && + result.originalSender_ != global::bnet.protocol.ProcessId.DefaultInstance) { + result.originalSender_ = global::bnet.protocol.ProcessId.CreateBuilder(result.originalSender_).MergeFrom(value).BuildPartial(); + } else { + result.originalSender_ = value; + } + result.hasOriginalSender = true; + return this; + } + public Builder ClearOriginalSender() { + PrepareBuilder(); + result.hasOriginalSender = false; + result.originalSender_ = null; + return this; + } + } + static CreateToonEntityRequest() { + object.ReferenceEquals(global::bnet.protocol.toon.Toon.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class CreateToonEntityResponse : pb::GeneratedMessage { + private CreateToonEntityResponse() { } + private static readonly CreateToonEntityResponse defaultInstance = new CreateToonEntityResponse().MakeReadOnly(); + private static readonly string[] _createToonEntityResponseFieldNames = new string[] { "toon_id" }; + private static readonly uint[] _createToonEntityResponseFieldTags = new uint[] { 10 }; + public static CreateToonEntityResponse DefaultInstance { + get { return defaultInstance; } + } + + public override CreateToonEntityResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateToonEntityResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.toon.Toon.internal__static_bnet_protocol_toon_CreateToonEntityResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.toon.Toon.internal__static_bnet_protocol_toon_CreateToonEntityResponse__FieldAccessorTable; } + } + + public const int ToonIdFieldNumber = 1; + private bool hasToonId; + private global::bnet.protocol.EntityId toonId_; + public bool HasToonId { + get { return hasToonId; } + } + public global::bnet.protocol.EntityId ToonId { + get { return toonId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasToonId) return false; + if (!ToonId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _createToonEntityResponseFieldNames; + if (hasToonId) { + output.WriteMessage(1, field_names[0], ToonId); + } + 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); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static CreateToonEntityResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateToonEntityResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateToonEntityResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateToonEntityResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateToonEntityResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateToonEntityResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateToonEntityResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateToonEntityResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateToonEntityResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateToonEntityResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateToonEntityResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateToonEntityResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateToonEntityResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateToonEntityResponse result; + + private CreateToonEntityResponse PrepareBuilder() { + if (resultIsReadOnly) { + CreateToonEntityResponse original = result; + result = new CreateToonEntityResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateToonEntityResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.toon.CreateToonEntityResponse.Descriptor; } + } + + public override CreateToonEntityResponse DefaultInstanceForType { + get { return global::bnet.protocol.toon.CreateToonEntityResponse.DefaultInstance; } + } + + public override CreateToonEntityResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateToonEntityResponse) { + return MergeFrom((CreateToonEntityResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateToonEntityResponse other) { + if (other == global::bnet.protocol.toon.CreateToonEntityResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasToonId) { + MergeToonId(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(_createToonEntityResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createToonEntityResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.hasToonId) { + subBuilder.MergeFrom(ToonId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ToonId = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + 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"); + PrepareBuilder(); + result.hasToonId = true; + result.toonId_ = value; + return this; + } + public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasToonId = true; + result.toonId_ = builderForValue.Build(); + return this; + } + public Builder MergeToonId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + 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() { + PrepareBuilder(); + result.hasToonId = false; + result.toonId_ = null; + return this; + } + } + static CreateToonEntityResponse() { + object.ReferenceEquals(global::bnet.protocol.toon.Toon.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class FinalizeToonCreationRequest : pb::GeneratedMessage { + private FinalizeToonCreationRequest() { } + private static readonly FinalizeToonCreationRequest defaultInstance = new FinalizeToonCreationRequest().MakeReadOnly(); + private static readonly string[] _finalizeToonCreationRequestFieldNames = new string[] { "game_account_id", "name", "original_sender", "token", "toon_id" }; + private static readonly uint[] _finalizeToonCreationRequestFieldTags = new uint[] { 18, 10, 42, 32, 26 }; + public static FinalizeToonCreationRequest DefaultInstance { + get { return defaultInstance; } + } + + public override FinalizeToonCreationRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FinalizeToonCreationRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.toon.Toon.internal__static_bnet_protocol_toon_FinalizeToonCreationRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.toon.Toon.internal__static_bnet_protocol_toon_FinalizeToonCreationRequest__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 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 ToonIdFieldNumber = 3; + private bool hasToonId; + private global::bnet.protocol.EntityId toonId_; + public bool HasToonId { + get { return hasToonId; } + } + public global::bnet.protocol.EntityId ToonId { + get { return toonId_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int TokenFieldNumber = 4; + private bool hasToken; + private uint token_; + public bool HasToken { + get { return hasToken; } + } + public uint Token { + get { return token_; } + } + + public const int OriginalSenderFieldNumber = 5; + private bool hasOriginalSender; + private global::bnet.protocol.ProcessId originalSender_; + public bool HasOriginalSender { + get { return hasOriginalSender; } + } + public global::bnet.protocol.ProcessId OriginalSender { + get { return originalSender_ ?? global::bnet.protocol.ProcessId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasName) return false; + if (!hasGameAccountId) return false; + if (!hasToonId) return false; + if (!hasToken) return false; + if (!hasOriginalSender) return false; + if (!GameAccountId.IsInitialized) return false; + if (!ToonId.IsInitialized) return false; + if (!OriginalSender.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _finalizeToonCreationRequestFieldNames; + if (hasName) { + output.WriteString(1, field_names[1], Name); + } + if (hasGameAccountId) { + output.WriteMessage(2, field_names[0], GameAccountId); + } + if (hasToonId) { + output.WriteMessage(3, field_names[4], ToonId); + } + if (hasToken) { + output.WriteUInt32(4, field_names[3], Token); + } + if (hasOriginalSender) { + output.WriteMessage(5, field_names[2], OriginalSender); + } + 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 (hasGameAccountId) { + size += pb::CodedOutputStream.ComputeMessageSize(2, GameAccountId); + } + if (hasToonId) { + size += pb::CodedOutputStream.ComputeMessageSize(3, ToonId); + } + if (hasToken) { + size += pb::CodedOutputStream.ComputeUInt32Size(4, Token); + } + if (hasOriginalSender) { + size += pb::CodedOutputStream.ComputeMessageSize(5, OriginalSender); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static FinalizeToonCreationRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FinalizeToonCreationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FinalizeToonCreationRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FinalizeToonCreationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FinalizeToonCreationRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FinalizeToonCreationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FinalizeToonCreationRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FinalizeToonCreationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FinalizeToonCreationRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FinalizeToonCreationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FinalizeToonCreationRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FinalizeToonCreationRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FinalizeToonCreationRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FinalizeToonCreationRequest result; + + private FinalizeToonCreationRequest PrepareBuilder() { + if (resultIsReadOnly) { + FinalizeToonCreationRequest original = result; + result = new FinalizeToonCreationRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FinalizeToonCreationRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.toon.FinalizeToonCreationRequest.Descriptor; } + } + + public override FinalizeToonCreationRequest DefaultInstanceForType { + get { return global::bnet.protocol.toon.FinalizeToonCreationRequest.DefaultInstance; } + } + + public override FinalizeToonCreationRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FinalizeToonCreationRequest) { + return MergeFrom((FinalizeToonCreationRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FinalizeToonCreationRequest other) { + if (other == global::bnet.protocol.toon.FinalizeToonCreationRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + if (other.HasGameAccountId) { + MergeGameAccountId(other.GameAccountId); + } + if (other.HasToonId) { + MergeToonId(other.ToonId); + } + if (other.HasToken) { + Token = other.Token; + } + if (other.HasOriginalSender) { + MergeOriginalSender(other.OriginalSender); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_finalizeToonCreationRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _finalizeToonCreationRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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 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: { + global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); + if (result.hasToonId) { + subBuilder.MergeFrom(ToonId); + } + input.ReadMessage(subBuilder, extensionRegistry); + ToonId = subBuilder.BuildPartial(); + break; + } + case 32: { + result.hasToken = input.ReadUInt32(ref result.token_); + break; + } + case 42: { + global::bnet.protocol.ProcessId.Builder subBuilder = global::bnet.protocol.ProcessId.CreateBuilder(); + if (result.hasOriginalSender) { + subBuilder.MergeFrom(OriginalSender); + } + input.ReadMessage(subBuilder, extensionRegistry); + OriginalSender = subBuilder.BuildPartial(); + 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 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 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"); + PrepareBuilder(); + result.hasToonId = true; + result.toonId_ = value; + return this; + } + public Builder SetToonId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasToonId = true; + result.toonId_ = builderForValue.Build(); + return this; + } + public Builder MergeToonId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + 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() { + PrepareBuilder(); + result.hasToonId = false; + result.toonId_ = null; + 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 HasOriginalSender { + get { return result.hasOriginalSender; } + } + public global::bnet.protocol.ProcessId OriginalSender { + get { return result.OriginalSender; } + set { SetOriginalSender(value); } + } + public Builder SetOriginalSender(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasOriginalSender = true; + result.originalSender_ = value; + return this; + } + public Builder SetOriginalSender(global::bnet.protocol.ProcessId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasOriginalSender = true; + result.originalSender_ = builderForValue.Build(); + return this; + } + public Builder MergeOriginalSender(global::bnet.protocol.ProcessId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasOriginalSender && + result.originalSender_ != global::bnet.protocol.ProcessId.DefaultInstance) { + result.originalSender_ = global::bnet.protocol.ProcessId.CreateBuilder(result.originalSender_).MergeFrom(value).BuildPartial(); + } else { + result.originalSender_ = value; + } + result.hasOriginalSender = true; + return this; + } + public Builder ClearOriginalSender() { + PrepareBuilder(); + result.hasOriginalSender = false; + result.originalSender_ = null; + return this; + } + } + static FinalizeToonCreationRequest() { + object.ReferenceEquals(global::bnet.protocol.toon.Toon.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/source/D3Proto/bnet/protocol/toon/external/ToonExternal.cs b/src/LibMooNet/bnet/protocol/toon/external/ToonExternal.cs similarity index 58% rename from source/D3Proto/bnet/protocol/toon/external/ToonExternal.cs rename to src/LibMooNet/bnet/protocol/toon/external/ToonExternal.cs index ebe46e41..25b133bf 100644 --- a/source/D3Proto/bnet/protocol/toon/external/ToonExternal.cs +++ b/src/LibMooNet/bnet/protocol/toon/external/ToonExternal.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.toon.external { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public static partial class ToonExternal { #region Extension registration @@ -25,6 +30,8 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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_ToonCreatedNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_toon_external_ToonCreatedNotification__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; @@ -38,29 +45,35 @@ public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { 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="); + "CitzZXJ2aWNlL3Rvb24vZGVmaW5pdGlvbi90b29uX2V4dGVybmFsLnByb3Rv" + + "EhtibmV0LnByb3RvY29sLnRvb24uZXh0ZXJuYWwaEWxpYi9ycGMvcnBjLnBy" + + "b3RvGhlsaWIvcHJvdG9jb2wvZW50aXR5LnByb3RvGhxsaWIvcHJvdG9jb2wv" + + "YXR0cmlidXRlLnByb3RvGiJzZXJ2aWNlL3Rvb24vZGVmaW5pdGlvbi90b29u" + + "LnByb3RvIhEKD1Rvb25MaXN0UmVxdWVzdCI6ChBUb29uTGlzdFJlc3BvbnNl" + + "EiYKBXRvb25zGAIgAygLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCI6ChFT" + + "ZWxlY3RUb29uUmVxdWVzdBIlCgR0b29uGAEgAigLMhcuYm5ldC5wcm90b2Nv" + + "bC5FbnRpdHlJZCIUChJTZWxlY3RUb29uUmVzcG9uc2UiWAoRQ3JlYXRlVG9v" + + "blJlcXVlc3QSDAoEbmFtZRgBIAEoCRI1CglhdHRyaWJ1dGUYAiADKAsyIi5i" + + "bmV0LnByb3RvY29sLmF0dHJpYnV0ZS5BdHRyaWJ1dGUiIwoSQ3JlYXRlVG9v" + + "blJlc3BvbnNlEg0KBXRva2VuGAEgAigNImMKF1Rvb25DcmVhdGVkTm90aWZp" + + "Y2F0aW9uEiUKBHRvb24YASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlk" + + "Eg0KBXRva2VuGAIgAigNEhIKCmVycm9yX2NvZGUYAyACKA0iOgoRRGVsZXRl" + + "VG9vblJlcXVlc3QSJQoEdG9vbhgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50" + + "aXR5SWQiFAoSRGVsZXRlVG9vblJlc3BvbnNlMuMDChNUb29uU2VydmljZUV4" + + "dGVybmFsEm0KCFRvb25MaXN0EiwuYm5ldC5wcm90b2NvbC50b29uLmV4dGVy" + + "bmFsLlRvb25MaXN0UmVxdWVzdBotLmJuZXQucHJvdG9jb2wudG9vbi5leHRl" + + "cm5hbC5Ub29uTGlzdFJlc3BvbnNlIgSAtRgBEnMKClNlbGVjdFRvb24SLi5i" + + "bmV0LnByb3RvY29sLnRvb24uZXh0ZXJuYWwuU2VsZWN0VG9vblJlcXVlc3Qa" + + "Ly5ibmV0LnByb3RvY29sLnRvb24uZXh0ZXJuYWwuU2VsZWN0VG9vblJlc3Bv" + + "bnNlIgSAtRgCEnMKCkNyZWF0ZVRvb24SLi5ibmV0LnByb3RvY29sLnRvb24u" + + "ZXh0ZXJuYWwuQ3JlYXRlVG9vblJlcXVlc3QaLy5ibmV0LnByb3RvY29sLnRv" + + "b24uZXh0ZXJuYWwuQ3JlYXRlVG9vblJlc3BvbnNlIgSAtRgDEnMKCkRlbGV0" + + "ZVRvb24SLi5ibmV0LnByb3RvY29sLnRvb24uZXh0ZXJuYWwuRGVsZXRlVG9v" + + "blJlcXVlc3QaLy5ibmV0LnByb3RvY29sLnRvb24uZXh0ZXJuYWwuRGVsZXRl" + + "VG9vblJlc3BvbnNlIgSAtRgEMoEBChJUb29uTm90aWZ5RXh0ZXJuYWwSawoR" + + "Tm90aWZ5VG9vbkNyZWF0ZWQSNC5ibmV0LnByb3RvY29sLnRvb24uZXh0ZXJu" + + "YWwuVG9vbkNyZWF0ZWROb3RpZmljYXRpb24aGi5ibmV0LnByb3RvY29sLk5P" + + "X1JFU1BPTlNFIgSAtRgBQgOAAQA="); pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { descriptor = root; internal__static_bnet_protocol_toon_external_ToonListRequest__Descriptor = Descriptor.MessageTypes[0]; @@ -86,16 +99,26 @@ static ToonExternal() { 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]; + new string[] { "Token", }); + internal__static_bnet_protocol_toon_external_ToonCreatedNotification__Descriptor = Descriptor.MessageTypes[6]; + internal__static_bnet_protocol_toon_external_ToonCreatedNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_external_ToonCreatedNotification__Descriptor, + new string[] { "Toon", "Token", "ErrorCode", }); + internal__static_bnet_protocol_toon_external_DeleteToonRequest__Descriptor = Descriptor.MessageTypes[7]; 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__Descriptor = Descriptor.MessageTypes[8]; internal__static_bnet_protocol_toon_external_DeleteToonResponse__FieldAccessorTable = new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_toon_external_DeleteToonResponse__Descriptor, new string[] { }); - return null; + pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance(); + RegisterAllExtensions(registry); + global::bnet.protocol.Rpc.RegisterAllExtensions(registry); + global::bnet.protocol.Entity.RegisterAllExtensions(registry); + global::bnet.protocol.attribute.Proto.Attribute.RegisterAllExtensions(registry); + global::bnet.protocol.toon.Toon.RegisterAllExtensions(registry); + return registry; }; pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { @@ -109,14 +132,20 @@ static ToonExternal() { } #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 ToonListRequest : pb::GeneratedMessage { - private static readonly ToonListRequest defaultInstance = new Builder().BuildPartial(); + private ToonListRequest() { } + private static readonly ToonListRequest defaultInstance = new ToonListRequest().MakeReadOnly(); + private static readonly string[] _toonListRequestFieldNames = new string[] { }; + private static readonly uint[] _toonListRequestFieldTags = new uint[] { }; public static ToonListRequest DefaultInstance { get { return defaultInstance; } } public override ToonListRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ToonListRequest ThisMessage { @@ -137,8 +166,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 = _toonListRequestFieldNames; UnknownFields.WriteTo(output); } @@ -179,38 +209,72 @@ public static ToonListRequest ParseDelimitedFrom(global::System.IO.Stream input) 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) { + public static ToonListRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ToonListRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ToonListRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ToonListRequest MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(ToonListRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ToonListRequest result = new ToonListRequest(); + private bool resultIsReadOnly; + private ToonListRequest result; + + private ToonListRequest PrepareBuilder() { + if (resultIsReadOnly) { + ToonListRequest original = result; + result = new ToonListRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ToonListRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ToonListRequest(); + 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 { @@ -222,12 +286,11 @@ public override ToonListRequest DefaultInstanceForType { } public override ToonListRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - ToonListRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -241,24 +304,36 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ToonListRequest other) { if (other == global::bnet.protocol.toon.external.ToonListRequest.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(_toonListRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _toonListRequestFieldTags[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)) { @@ -270,11 +345,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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } @@ -283,14 +363,20 @@ static ToonListRequest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class ToonListResponse : pb::GeneratedMessage { - private static readonly ToonListResponse defaultInstance = new Builder().BuildPartial(); + private ToonListResponse() { } + private static readonly ToonListResponse defaultInstance = new ToonListResponse().MakeReadOnly(); + private static readonly string[] _toonListResponseFieldNames = new string[] { "toons" }; + private static readonly uint[] _toonListResponseFieldTags = new uint[] { 18 }; public static ToonListResponse DefaultInstance { get { return defaultInstance; } } public override ToonListResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override ToonListResponse ThisMessage { @@ -326,10 +412,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.EntityId element in ToonsList) { - output.WriteMessage(2, element); + string[] field_names = _toonListResponseFieldNames; + if (toons_.Count > 0) { + output.WriteMessageArray(2, field_names[0], toons_); } UnknownFields.WriteTo(output); } @@ -374,38 +461,73 @@ public static ToonListResponse ParseDelimitedFrom(global::System.IO.Stream input 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) { + public static ToonListResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static ToonListResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static ToonListResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private ToonListResponse MakeReadOnly() { + toons_.MakeReadOnly(); + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(ToonListResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - ToonListResponse result = new ToonListResponse(); + private bool resultIsReadOnly; + private ToonListResponse result; + + private ToonListResponse PrepareBuilder() { + if (resultIsReadOnly) { + ToonListResponse original = result; + result = new ToonListResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override ToonListResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new ToonListResponse(); + 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 { @@ -417,13 +539,11 @@ public override ToonListResponse DefaultInstanceForType { } public override ToonListResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.toons_.MakeReadOnly(); - ToonListResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -437,27 +557,39 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(ToonListResponse other) { if (other == global::bnet.protocol.toon.external.ToonListResponse.DefaultInstance) return this; + PrepareBuilder(); if (other.toons_.Count != 0) { - base.AddRange(other.toons_, result.toons_); + result.toons_.Add(other.toons_); } 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(_toonListResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _toonListResponseFieldTags[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)) { @@ -469,22 +601,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 18: { - global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddToons(subBuilder.BuildPartial()); + input.ReadMessageArray(tag, field_name, result.toons_, global::bnet.protocol.EntityId.DefaultInstance, extensionRegistry); break; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public pbc::IPopsicleList ToonsList { - get { return result.toons_; } + get { return PrepareBuilder().toons_; } } public int ToonsCount { get { return result.ToonsCount; } @@ -494,29 +629,35 @@ public int ToonsCount { } public Builder SetToons(int index, global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.toons_[index] = value; return this; } public Builder SetToons(int index, global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.toons_[index] = builderForValue.Build(); return this; } public Builder AddToons(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.toons_.Add(value); return this; } public Builder AddToons(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); result.toons_.Add(builderForValue.Build()); return this; } public Builder AddRangeToons(scg::IEnumerable values) { - base.AddRange(values, result.toons_); + PrepareBuilder(); + result.toons_.Add(values); return this; } public Builder ClearToons() { + PrepareBuilder(); result.toons_.Clear(); return this; } @@ -526,14 +667,20 @@ static ToonListResponse() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SelectToonRequest : pb::GeneratedMessage { - private static readonly SelectToonRequest defaultInstance = new Builder().BuildPartial(); + private SelectToonRequest() { } + private static readonly SelectToonRequest defaultInstance = new SelectToonRequest().MakeReadOnly(); + private static readonly string[] _selectToonRequestFieldNames = new string[] { "toon" }; + private static readonly uint[] _selectToonRequestFieldTags = new uint[] { 10 }; public static SelectToonRequest DefaultInstance { get { return defaultInstance; } } public override SelectToonRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SelectToonRequest ThisMessage { @@ -550,12 +697,12 @@ protected override SelectToonRequest ThisMessage { public const int ToonFieldNumber = 1; private bool hasToon; - private global::bnet.protocol.EntityId toon_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId toon_; public bool HasToon { get { return hasToon; } } public global::bnet.protocol.EntityId Toon { - get { return toon_; } + get { return toon_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -566,10 +713,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasToon) { - output.WriteMessage(1, Toon); + string[] field_names = _selectToonRequestFieldNames; + if (hasToon) { + output.WriteMessage(1, field_names[0], Toon); } UnknownFields.WriteTo(output); } @@ -581,7 +729,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasToon) { + if (hasToon) { size += pb::CodedOutputStream.ComputeMessageSize(1, Toon); } size += UnknownFields.SerializedSize; @@ -614,38 +762,72 @@ public static SelectToonRequest ParseDelimitedFrom(global::System.IO.Stream inpu 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) { + public static SelectToonRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SelectToonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SelectToonRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SelectToonRequest MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(SelectToonRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SelectToonRequest result; - SelectToonRequest result = new SelectToonRequest(); + private SelectToonRequest PrepareBuilder() { + if (resultIsReadOnly) { + SelectToonRequest original = result; + result = new SelectToonRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SelectToonRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SelectToonRequest(); + 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 { @@ -657,12 +839,11 @@ public override SelectToonRequest DefaultInstanceForType { } public override SelectToonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SelectToonRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -676,6 +857,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SelectToonRequest other) { if (other == global::bnet.protocol.toon.external.SelectToonRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasToon) { MergeToon(other.Toon); } @@ -683,20 +865,31 @@ public override Builder MergeFrom(SelectToonRequest 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(_selectToonRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _selectToonRequestFieldTags[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)) { @@ -708,12 +901,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 (HasToon) { + if (result.hasToon) { subBuilder.MergeFrom(Toon); } input.ReadMessage(subBuilder, extensionRegistry); @@ -722,11 +915,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasToon { - get { return result.HasToon; } + get { return result.hasToon; } } public global::bnet.protocol.EntityId Toon { get { return result.Toon; } @@ -734,19 +932,22 @@ public bool HasToon { } public Builder SetToon(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToon = true; result.toon_ = value; return this; } public Builder SetToon(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToon && result.toon_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toon_ = global::bnet.protocol.EntityId.CreateBuilder(result.toon_).MergeFrom(value).BuildPartial(); } else { @@ -756,8 +957,9 @@ public Builder MergeToon(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToon() { + PrepareBuilder(); result.hasToon = false; - result.toon_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toon_ = null; return this; } } @@ -766,14 +968,20 @@ static SelectToonRequest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class SelectToonResponse : pb::GeneratedMessage { - private static readonly SelectToonResponse defaultInstance = new Builder().BuildPartial(); + private SelectToonResponse() { } + private static readonly SelectToonResponse defaultInstance = new SelectToonResponse().MakeReadOnly(); + private static readonly string[] _selectToonResponseFieldNames = new string[] { }; + private static readonly uint[] _selectToonResponseFieldTags = new uint[] { }; public static SelectToonResponse DefaultInstance { get { return defaultInstance; } } public override SelectToonResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override SelectToonResponse ThisMessage { @@ -794,8 +1002,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 = _selectToonResponseFieldNames; UnknownFields.WriteTo(output); } @@ -836,38 +1045,72 @@ public static SelectToonResponse ParseDelimitedFrom(global::System.IO.Stream inp 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) { + public static SelectToonResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static SelectToonResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static SelectToonResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private SelectToonResponse MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(SelectToonResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SelectToonResponse result; - SelectToonResponse result = new SelectToonResponse(); + private SelectToonResponse PrepareBuilder() { + if (resultIsReadOnly) { + SelectToonResponse original = result; + result = new SelectToonResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override SelectToonResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new SelectToonResponse(); + 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 { @@ -879,12 +1122,11 @@ public override SelectToonResponse DefaultInstanceForType { } public override SelectToonResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - SelectToonResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -898,24 +1140,36 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(SelectToonResponse other) { if (other == global::bnet.protocol.toon.external.SelectToonResponse.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(_selectToonResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _selectToonResponseFieldTags[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)) { @@ -927,11 +1181,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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } @@ -940,14 +1199,20 @@ static SelectToonResponse() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class CreateToonRequest : pb::GeneratedMessage { - private static readonly CreateToonRequest defaultInstance = new Builder().BuildPartial(); + private CreateToonRequest() { } + private static readonly CreateToonRequest defaultInstance = new CreateToonRequest().MakeReadOnly(); + private static readonly string[] _createToonRequestFieldNames = new string[] { "attribute", "name" }; + private static readonly uint[] _createToonRequestFieldTags = new uint[] { 18, 10 }; public static CreateToonRequest DefaultInstance { get { return defaultInstance; } } public override CreateToonRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override CreateToonRequest ThisMessage { @@ -993,13 +1258,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 = _createToonRequestFieldNames; + if (hasName) { + output.WriteString(1, field_names[1], Name); } - 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); } @@ -1011,7 +1277,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasName) { + if (hasName) { size += pb::CodedOutputStream.ComputeStringSize(1, Name); } foreach (global::bnet.protocol.attribute.Attribute element in AttributeList) { @@ -1047,38 +1313,73 @@ public static CreateToonRequest ParseDelimitedFrom(global::System.IO.Stream inpu 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) { + public static CreateToonRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CreateToonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static CreateToonRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private CreateToonRequest 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(CreateToonRequest 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(CreateToonRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateToonRequest result; - CreateToonRequest result = new CreateToonRequest(); + private CreateToonRequest PrepareBuilder() { + if (resultIsReadOnly) { + CreateToonRequest original = result; + result = new CreateToonRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override CreateToonRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new CreateToonRequest(); + 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 { @@ -1090,13 +1391,11 @@ public override CreateToonRequest DefaultInstanceForType { } public override CreateToonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - result.attribute_.MakeReadOnly(); - CreateToonRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1110,30 +1409,42 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(CreateToonRequest other) { if (other == global::bnet.protocol.toon.external.CreateToonRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasName) { Name = other.Name; } 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(_createToonRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createToonRequestFieldTags[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)) { @@ -1145,26 +1456,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: { - 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 HasName { - get { return result.HasName; } + get { return result.hasName; } } public string Name { get { return result.Name; } @@ -1172,18 +1486,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; } @@ -1193,29 +1509,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; } @@ -1225,14 +1547,20 @@ static CreateToonRequest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class CreateToonResponse : pb::GeneratedMessage { - private static readonly CreateToonResponse defaultInstance = new Builder().BuildPartial(); + private CreateToonResponse() { } + private static readonly CreateToonResponse defaultInstance = new CreateToonResponse().MakeReadOnly(); + private static readonly string[] _createToonResponseFieldNames = new string[] { "token" }; + private static readonly uint[] _createToonResponseFieldTags = new uint[] { 8 }; public static CreateToonResponse DefaultInstance { get { return defaultInstance; } } public override CreateToonResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override CreateToonResponse ThisMessage { @@ -1247,29 +1575,28 @@ protected override CreateToonResponse ThisMessage { 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 const int TokenFieldNumber = 1; + private bool hasToken; + private uint token_; + public bool HasToken { + get { return hasToken; } } - public global::bnet.protocol.EntityId Toon { - get { return toon_; } + public uint Token { + get { return token_; } } public override bool IsInitialized { get { - if (HasToon) { - if (!Toon.IsInitialized) return false; - } + if (!hasToken) return false; return true; } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasToon) { - output.WriteMessage(2, Toon); + string[] field_names = _createToonResponseFieldNames; + if (hasToken) { + output.WriteUInt32(1, field_names[0], Token); } UnknownFields.WriteTo(output); } @@ -1281,8 +1608,8 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasToon) { - size += pb::CodedOutputStream.ComputeMessageSize(2, Toon); + if (hasToken) { + size += pb::CodedOutputStream.ComputeUInt32Size(1, Token); } size += UnknownFields.SerializedSize; memoizedSerializedSize = size; @@ -1314,38 +1641,72 @@ public static CreateToonResponse ParseDelimitedFrom(global::System.IO.Stream inp 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) { + public static CreateToonResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static CreateToonResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static CreateToonResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private CreateToonResponse MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(CreateToonResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } - CreateToonResponse result = new CreateToonResponse(); + private bool resultIsReadOnly; + private CreateToonResponse result; + + private CreateToonResponse PrepareBuilder() { + if (resultIsReadOnly) { + CreateToonResponse original = result; + result = new CreateToonResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override CreateToonResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new CreateToonResponse(); + 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 { @@ -1357,12 +1718,11 @@ public override CreateToonResponse DefaultInstanceForType { } public override CreateToonResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - CreateToonResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1376,27 +1736,356 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(CreateToonResponse other) { if (other == global::bnet.protocol.toon.external.CreateToonResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasToken) { + Token = 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(_createToonResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createToonResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.hasToken = input.ReadUInt32(ref result.token_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + 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; + } + } + static CreateToonResponse() { + object.ReferenceEquals(global::bnet.protocol.toon.external.ToonExternal.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ToonCreatedNotification : pb::GeneratedMessage { + private ToonCreatedNotification() { } + private static readonly ToonCreatedNotification defaultInstance = new ToonCreatedNotification().MakeReadOnly(); + private static readonly string[] _toonCreatedNotificationFieldNames = new string[] { "error_code", "token", "toon" }; + private static readonly uint[] _toonCreatedNotificationFieldTags = new uint[] { 24, 16, 10 }; + public static ToonCreatedNotification DefaultInstance { + get { return defaultInstance; } + } + + public override ToonCreatedNotification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ToonCreatedNotification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_ToonCreatedNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.toon.external.ToonExternal.internal__static_bnet_protocol_toon_external_ToonCreatedNotification__FieldAccessorTable; } + } + + public const int ToonFieldNumber = 1; + private bool hasToon; + private global::bnet.protocol.EntityId toon_; + public bool HasToon { + get { return hasToon; } + } + public global::bnet.protocol.EntityId Toon { + get { return toon_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int TokenFieldNumber = 2; + private bool hasToken; + private uint token_; + public bool HasToken { + get { return hasToken; } + } + public uint Token { + get { return token_; } + } + + public const int ErrorCodeFieldNumber = 3; + private bool hasErrorCode; + private uint errorCode_; + public bool HasErrorCode { + get { return hasErrorCode; } + } + public uint ErrorCode { + get { return errorCode_; } + } + + public override bool IsInitialized { + get { + if (!hasToken) return false; + if (!hasErrorCode) return false; + if (HasToon) { + if (!Toon.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _toonCreatedNotificationFieldNames; + if (hasToon) { + output.WriteMessage(1, field_names[2], Toon); + } + if (hasToken) { + output.WriteUInt32(2, field_names[1], Token); + } + if (hasErrorCode) { + output.WriteUInt32(3, 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 (hasToon) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Toon); + } + if (hasToken) { + size += pb::CodedOutputStream.ComputeUInt32Size(2, Token); + } + if (hasErrorCode) { + size += pb::CodedOutputStream.ComputeUInt32Size(3, ErrorCode); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ToonCreatedNotification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ToonCreatedNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ToonCreatedNotification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ToonCreatedNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ToonCreatedNotification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ToonCreatedNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ToonCreatedNotification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ToonCreatedNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ToonCreatedNotification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ToonCreatedNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ToonCreatedNotification MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ToonCreatedNotification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ToonCreatedNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ToonCreatedNotification result; + + private ToonCreatedNotification PrepareBuilder() { + if (resultIsReadOnly) { + ToonCreatedNotification original = result; + result = new ToonCreatedNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ToonCreatedNotification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.toon.external.ToonCreatedNotification.Descriptor; } + } + + public override ToonCreatedNotification DefaultInstanceForType { + get { return global::bnet.protocol.toon.external.ToonCreatedNotification.DefaultInstance; } + } + + public override ToonCreatedNotification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ToonCreatedNotification) { + return MergeFrom((ToonCreatedNotification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ToonCreatedNotification other) { + if (other == global::bnet.protocol.toon.external.ToonCreatedNotification.DefaultInstance) return this; + PrepareBuilder(); if (other.HasToon) { MergeToon(other.Toon); } + if (other.HasToken) { + Token = other.Token; + } + if (other.HasErrorCode) { + ErrorCode = other.ErrorCode; + } 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(_toonCreatedNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _toonCreatedNotificationFieldTags[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)) { @@ -1408,25 +2097,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; } - case 18: { + case 10: { global::bnet.protocol.EntityId.Builder subBuilder = global::bnet.protocol.EntityId.CreateBuilder(); - if (HasToon) { + if (result.hasToon) { subBuilder.MergeFrom(Toon); } input.ReadMessage(subBuilder, extensionRegistry); Toon = subBuilder.BuildPartial(); break; } + case 16: { + result.hasToken = input.ReadUInt32(ref result.token_); + break; + } + case 24: { + result.hasErrorCode = input.ReadUInt32(ref result.errorCode_); + break; + } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasToon { - get { return result.HasToon; } + get { return result.hasToon; } } public global::bnet.protocol.EntityId Toon { get { return result.Toon; } @@ -1434,19 +2136,22 @@ public bool HasToon { } public Builder SetToon(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToon = true; result.toon_ = value; return this; } public Builder SetToon(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToon && result.toon_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toon_ = global::bnet.protocol.EntityId.CreateBuilder(result.toon_).MergeFrom(value).BuildPartial(); } else { @@ -1456,24 +2161,71 @@ public Builder MergeToon(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToon() { + PrepareBuilder(); result.hasToon = false; - result.toon_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toon_ = null; + 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 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 CreateToonResponse() { + static ToonCreatedNotification() { object.ReferenceEquals(global::bnet.protocol.toon.external.ToonExternal.Descriptor, null); } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class DeleteToonRequest : pb::GeneratedMessage { - private static readonly DeleteToonRequest defaultInstance = new Builder().BuildPartial(); + private DeleteToonRequest() { } + private static readonly DeleteToonRequest defaultInstance = new DeleteToonRequest().MakeReadOnly(); + private static readonly string[] _deleteToonRequestFieldNames = new string[] { "toon" }; + private static readonly uint[] _deleteToonRequestFieldTags = new uint[] { 10 }; public static DeleteToonRequest DefaultInstance { get { return defaultInstance; } } public override DeleteToonRequest DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override DeleteToonRequest ThisMessage { @@ -1490,12 +2242,12 @@ protected override DeleteToonRequest ThisMessage { public const int ToonFieldNumber = 1; private bool hasToon; - private global::bnet.protocol.EntityId toon_ = global::bnet.protocol.EntityId.DefaultInstance; + private global::bnet.protocol.EntityId toon_; public bool HasToon { get { return hasToon; } } public global::bnet.protocol.EntityId Toon { - get { return toon_; } + get { return toon_ ?? global::bnet.protocol.EntityId.DefaultInstance; } } public override bool IsInitialized { @@ -1506,10 +2258,11 @@ public override bool IsInitialized { } } - public override void WriteTo(pb::CodedOutputStream output) { + public override void WriteTo(pb::ICodedOutputStream output) { int size = SerializedSize; - if (HasToon) { - output.WriteMessage(1, Toon); + string[] field_names = _deleteToonRequestFieldNames; + if (hasToon) { + output.WriteMessage(1, field_names[0], Toon); } UnknownFields.WriteTo(output); } @@ -1521,7 +2274,7 @@ public override int SerializedSize { if (size != -1) return size; size = 0; - if (HasToon) { + if (hasToon) { size += pb::CodedOutputStream.ComputeMessageSize(1, Toon); } size += UnknownFields.SerializedSize; @@ -1554,38 +2307,72 @@ public static DeleteToonRequest ParseDelimitedFrom(global::System.IO.Stream inpu 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) { + public static DeleteToonRequest ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static DeleteToonRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static DeleteToonRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private DeleteToonRequest MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(DeleteToonRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DeleteToonRequest result; + + private DeleteToonRequest PrepareBuilder() { + if (resultIsReadOnly) { + DeleteToonRequest original = result; + result = new DeleteToonRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - DeleteToonRequest result = new DeleteToonRequest(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override DeleteToonRequest MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new DeleteToonRequest(); + 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 { @@ -1597,12 +2384,11 @@ public override DeleteToonRequest DefaultInstanceForType { } public override DeleteToonRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - DeleteToonRequest returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1616,6 +2402,7 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(DeleteToonRequest other) { if (other == global::bnet.protocol.toon.external.DeleteToonRequest.DefaultInstance) return this; + PrepareBuilder(); if (other.HasToon) { MergeToon(other.Toon); } @@ -1623,20 +2410,31 @@ public override Builder MergeFrom(DeleteToonRequest 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(_deleteToonRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _deleteToonRequestFieldTags[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)) { @@ -1648,12 +2446,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 (HasToon) { + if (result.hasToon) { subBuilder.MergeFrom(Toon); } input.ReadMessage(subBuilder, extensionRegistry); @@ -1662,11 +2460,16 @@ public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegis } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } public bool HasToon { - get { return result.HasToon; } + get { return result.hasToon; } } public global::bnet.protocol.EntityId Toon { get { return result.Toon; } @@ -1674,19 +2477,22 @@ public bool HasToon { } public Builder SetToon(global::bnet.protocol.EntityId value) { pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); result.hasToon = true; result.toon_ = value; return this; } public Builder SetToon(global::bnet.protocol.EntityId.Builder builderForValue) { pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); 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 && + PrepareBuilder(); + if (result.hasToon && result.toon_ != global::bnet.protocol.EntityId.DefaultInstance) { result.toon_ = global::bnet.protocol.EntityId.CreateBuilder(result.toon_).MergeFrom(value).BuildPartial(); } else { @@ -1696,8 +2502,9 @@ public Builder MergeToon(global::bnet.protocol.EntityId value) { return this; } public Builder ClearToon() { + PrepareBuilder(); result.hasToon = false; - result.toon_ = global::bnet.protocol.EntityId.DefaultInstance; + result.toon_ = null; return this; } } @@ -1706,14 +2513,20 @@ static DeleteToonRequest() { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] public sealed partial class DeleteToonResponse : pb::GeneratedMessage { - private static readonly DeleteToonResponse defaultInstance = new Builder().BuildPartial(); + private DeleteToonResponse() { } + private static readonly DeleteToonResponse defaultInstance = new DeleteToonResponse().MakeReadOnly(); + private static readonly string[] _deleteToonResponseFieldNames = new string[] { }; + private static readonly uint[] _deleteToonResponseFieldTags = new uint[] { }; public static DeleteToonResponse DefaultInstance { get { return defaultInstance; } } public override DeleteToonResponse DefaultInstanceForType { - get { return defaultInstance; } + get { return DefaultInstance; } } protected override DeleteToonResponse ThisMessage { @@ -1734,8 +2547,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 = _deleteToonResponseFieldNames; UnknownFields.WriteTo(output); } @@ -1776,38 +2590,72 @@ public static DeleteToonResponse ParseDelimitedFrom(global::System.IO.Stream inp 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) { + public static DeleteToonResponse ParseFrom(pb::ICodedInputStream input) { return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); } - public static DeleteToonResponse ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + public static DeleteToonResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); } + private DeleteToonResponse MakeReadOnly() { + return this; + } + public 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); + return new Builder(prototype); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.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(DeleteToonResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DeleteToonResponse result; + + private DeleteToonResponse PrepareBuilder() { + if (resultIsReadOnly) { + DeleteToonResponse original = result; + result = new DeleteToonResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } - DeleteToonResponse result = new DeleteToonResponse(); + public override bool IsInitialized { + get { return result.IsInitialized; } + } protected override DeleteToonResponse MessageBeingBuilt { - get { return result; } + get { return PrepareBuilder(); } } public override Builder Clear() { - result = new DeleteToonResponse(); + 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 { @@ -1819,12 +2667,11 @@ public override DeleteToonResponse DefaultInstanceForType { } public override DeleteToonResponse BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); + if (resultIsReadOnly) { + return result; } - DeleteToonResponse returnMe = result; - result = null; - return returnMe; + resultIsReadOnly = true; + return result.MakeReadOnly(); } public override Builder MergeFrom(pb::IMessage other) { @@ -1838,24 +2685,36 @@ public override Builder MergeFrom(pb::IMessage other) { public override Builder MergeFrom(DeleteToonResponse other) { if (other == global::bnet.protocol.toon.external.DeleteToonResponse.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(_deleteToonResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _deleteToonResponseFieldTags[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)) { @@ -1867,11 +2726,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; } } } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; } } @@ -1883,6 +2747,9 @@ static DeleteToonResponse() { #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 ToonServiceExternal : pb::IService { public abstract void ToonList( pb::IRpcController controller, @@ -1985,6 +2852,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.toon.external.ToonServiceExternal { internal Stub(pb::IRpcChannel channel) { this.channel = channel; @@ -2033,6 +2903,98 @@ public override void DeleteToon( } } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public abstract class ToonNotifyExternal : pb::IService { + public abstract void NotifyToonCreated( + pb::IRpcController controller, + global::bnet.protocol.toon.external.ToonCreatedNotification request, + global::System.Action done); + + public static pbd::ServiceDescriptor Descriptor { + get { return ToonExternal.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.NotifyToonCreated(controller, (global::bnet.protocol.toon.external.ToonCreatedNotification) 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.ToonCreatedNotification.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.toon.external.ToonNotifyExternal { + internal Stub(pb::IRpcChannel channel) { + this.channel = channel; + } + + private readonly pb::IRpcChannel channel; + + public pb::IRpcChannel Channel { + get { return channel; } + } + + public override void NotifyToonCreated( + pb::IRpcController controller, + global::bnet.protocol.toon.external.ToonCreatedNotification 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/UserManager.cs b/src/LibMooNet/bnet/protocol/user_manager/UserManager.cs new file mode 100644 index 00000000..d93a28f5 --- /dev/null +++ b/src/LibMooNet/bnet/protocol/user_manager/UserManager.cs @@ -0,0 +1,6943 @@ +// 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 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_ReportToonRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_ReportToonRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_ReportToonResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_ReportToonResponse__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_ReportAccountRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_ReportAccountRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_ReportAccountResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_ReportAccountResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_IgnoreInviterRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_IgnoreInviterRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_UnignoreInvitersRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_UnignoreInvitersRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_BlockToonRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_BlockToonRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_UnblockToonsRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_UnblockToonsRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_UnblockToonsResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_UnblockToonsResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_UnignoreInvitersResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_UnignoreInvitersResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_bnet_protocol_user_manager_InviterIgnoredNotification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_bnet_protocol_user_manager_InviterIgnoredNotification__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( + "CjJzZXJ2aWNlL3VzZXJfbWFuYWdlci9kZWZpbml0aW9uL3VzZXJfbWFuYWdl" + + "ci5wcm90bxIaYm5ldC5wcm90b2NvbC51c2VyX21hbmFnZXIaHGxpYi9wcm90" + + "b2NvbC9hdHRyaWJ1dGUucHJvdG8aGWxpYi9wcm90b2NvbC9lbnRpdHkucHJv" + + "dG8aEWxpYi9ycGMvcnBjLnByb3RvIsgCCgxQbGF5ZXJSZXBvcnQSUgoOY29t" + + "cGxhaW50X2NvZGUYASACKA4yOi5ibmV0LnByb3RvY29sLnVzZXJfbWFuYWdl" + + "ci5QbGF5ZXJSZXBvcnQuVXNlckNvbXBsYWludENvZGUSFgoOY29tcGxhaW50" + + "X25vdGUYAiACKAkiywEKEVVzZXJDb21wbGFpbnRDb2RlEhcKE1VTRVJfQ09N" + + "UExBSU5UX1NQQU0QABIdChlVU0VSX0NPTVBMQUlOVF9IQVJBU1NNRU5UEAES" + + "IwofVVNFUl9DT01QTEFJTlRfUkVBTF9MSUZFX1RIUkVBVBACEiUKIVVTRVJf" + + "Q09NUExBSU5UX0lOQVBQUk9QUklBVEVfTkFNRRADEhoKFlVTRVJfQ09NUExB" + + "SU5UX0hBQ0tJTkcQBBIWChJVU0VSX0NPTVBMQUlOVF9BTlkQBSKJAQoMUmVj" + + "ZW50UGxheWVyEicKBnBsYXllchgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50" + + "aXR5SWQSGAoQdGltZXN0YW1wX3BsYXllZBgCIAEoBhI2CgphdHRyaWJ1dGVz" + + "GAMgAygLMiIuYm5ldC5wcm90b2NvbC5hdHRyaWJ1dGUuQXR0cmlidXRlIjIK" + + "HVN1YnNjcmliZVRvVXNlck1hbmFnZXJSZXF1ZXN0EhEKCW9iamVjdF9pZBgB" + + "IAIoBCLFAQoeU3Vic2NyaWJlVG9Vc2VyTWFuYWdlclJlc3BvbnNlEkAKDnJl" + + "Y2VudF9wbGF5ZXJzGAIgAygLMiguYm5ldC5wcm90b2NvbC51c2VyX21hbmFn" + + "ZXIuUmVjZW50UGxheWVyEi4KDWJsb2NrZWRfdG9vbnMYAyADKAsyFy5ibmV0" + + "LnByb3RvY29sLkVudGl0eUlkEjEKEGlnbm9yZWRfaW52aXRlcnMYBCADKAsy" + + "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkIvwBChFSZXBvcnRUb29uUmVxdWVz" + + "dBIqCgl0YXJnZXRfaWQYASACKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlk" + + "EjgKBnJlcG9ydBgCIAIoCzIoLmJuZXQucHJvdG9jb2wudXNlcl9tYW5hZ2Vy" + + "LlBsYXllclJlcG9ydBJSCg9ibG9ja2luZ19hY3Rpb24YAyABKA4yOS5ibmV0" + + "LnByb3RvY29sLnVzZXJfbWFuYWdlci5SZXBvcnRUb29uUmVxdWVzdC5CbG9j" + + "a0FjdGlvbiItCgtCbG9ja0FjdGlvbhIeChpTRVNTSU9OX0JMT0NLX0dBTUVf" + + "QUNDT1VOVBABIkQKElJlcG9ydFRvb25SZXNwb25zZRIuCg1yZXBvcnRlZF90" + + "b29uGAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJZCJUChdBZGRSZWNl" + + "bnRQbGF5ZXJzUmVxdWVzdBI5CgdwbGF5ZXJzGAEgAygLMiguYm5ldC5wcm90" + + "b2NvbC51c2VyX21hbmFnZXIuUmVjZW50UGxheWVyIp4BChhBZGRSZWNlbnRQ" + + "bGF5ZXJzUmVzcG9uc2USPwoNcGxheWVyc19hZGRlZBgBIAMoCzIoLmJuZXQu" + + "cHJvdG9jb2wudXNlcl9tYW5hZ2VyLlJlY2VudFBsYXllchJBCg9wbGF5ZXJz" + + "X3JlbW92ZWQYAyADKAsyKC5ibmV0LnByb3RvY29sLnVzZXJfbWFuYWdlci5S" + + "ZWNlbnRQbGF5ZXIiVwoaUmVtb3ZlUmVjZW50UGxheWVyc1JlcXVlc3QSOQoH" + + "cGxheWVycxgCIAMoCzIoLmJuZXQucHJvdG9jb2wudXNlcl9tYW5hZ2VyLlJl" + + "Y2VudFBsYXllciJgChtSZW1vdmVSZWNlbnRQbGF5ZXJzUmVzcG9uc2USQQoP" + + "cGxheWVyc19yZW1vdmVkGAEgAygLMiguYm5ldC5wcm90b2NvbC51c2VyX21h" + + "bmFnZXIuUmVjZW50UGxheWVyIoEBChRSZXBvcnRBY2NvdW50UmVxdWVzdBIv" + + "Cg50YXJnZXRfYWNjb3VudBgBIAIoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5" + + "SWQSOAoGcmVwb3J0GAIgAigLMiguYm5ldC5wcm90b2NvbC51c2VyX21hbmFn" + + "ZXIuUGxheWVyUmVwb3J0IkoKFVJlcG9ydEFjY291bnRSZXNwb25zZRIxChBy" + + "ZXBvcnRlZF9hY2NvdW50GAEgASgLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJ" + + "ZCJCChRJZ25vcmVJbnZpdGVyUmVxdWVzdBIqCgl0YXJnZXRfaWQYASACKAsy" + + "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkIkUKF1VuaWdub3JlSW52aXRlcnNS" + + "ZXF1ZXN0EioKCXRhcmdldF9pZBgBIAMoCzIXLmJuZXQucHJvdG9jb2wuRW50" + + "aXR5SWQiPgoQQmxvY2tUb29uUmVxdWVzdBIqCgl0YXJnZXRfaWQYASACKAsy" + + "Fy5ibmV0LnByb3RvY29sLkVudGl0eUlkIkEKE1VuYmxvY2tUb29uc1JlcXVl" + + "c3QSKgoJdGFyZ2V0X2lkGAEgAygLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJ" + + "ZCJHChRVbmJsb2NrVG9vbnNSZXNwb25zZRIvCg51bmJsb2NrZWRfdG9vbhgB" + + "IAMoCzIXLmJuZXQucHJvdG9jb2wuRW50aXR5SWQiTgoYVW5pZ25vcmVJbnZp" + + "dGVyc1Jlc3BvbnNlEjIKEXVuaWdub3JlZF9pbnZpdGVyGAEgAygLMhcuYm5l" + + "dC5wcm90b2NvbC5FbnRpdHlJZCJGChpJbnZpdGVySWdub3JlZE5vdGlmaWNh" + + "dGlvbhIoCgdwbGF5ZXJzGAEgAygLMhcuYm5ldC5wcm90b2NvbC5FbnRpdHlJ" + + "ZDLnCAoSVXNlck1hbmFnZXJTZXJ2aWNlEpUBChZTdWJzY3JpYmVUb1VzZXJN" + + "YW5hZ2VyEjkuYm5ldC5wcm90b2NvbC51c2VyX21hbmFnZXIuU3Vic2NyaWJl" + + "VG9Vc2VyTWFuYWdlclJlcXVlc3QaOi5ibmV0LnByb3RvY29sLnVzZXJfbWFu" + + "YWdlci5TdWJzY3JpYmVUb1VzZXJNYW5hZ2VyUmVzcG9uc2UiBIC1GAESgwEK" + + "EEFkZFJlY2VudFBsYXllcnMSMy5ibmV0LnByb3RvY29sLnVzZXJfbWFuYWdl" + + "ci5BZGRSZWNlbnRQbGF5ZXJzUmVxdWVzdBo0LmJuZXQucHJvdG9jb2wudXNl" + + "cl9tYW5hZ2VyLkFkZFJlY2VudFBsYXllcnNSZXNwb25zZSIEgLUYBRKMAQoT" + + "UmVtb3ZlUmVjZW50UGxheWVycxI2LmJuZXQucHJvdG9jb2wudXNlcl9tYW5h" + + "Z2VyLlJlbW92ZVJlY2VudFBsYXllcnNSZXF1ZXN0GjcuYm5ldC5wcm90b2Nv" + + "bC51c2VyX21hbmFnZXIuUmVtb3ZlUmVjZW50UGxheWVyc1Jlc3BvbnNlIgSA" + + "tRgGEnEKClJlcG9ydFRvb24SLS5ibmV0LnByb3RvY29sLnVzZXJfbWFuYWdl" + + "ci5SZXBvcnRUb29uUmVxdWVzdBouLmJuZXQucHJvdG9jb2wudXNlcl9tYW5h" + + "Z2VyLlJlcG9ydFRvb25SZXNwb25zZSIEgLUYBxJWCglCbG9ja1Rvb24SLC5i" + + "bmV0LnByb3RvY29sLnVzZXJfbWFuYWdlci5CbG9ja1Rvb25SZXF1ZXN0GhUu" + + "Ym5ldC5wcm90b2NvbC5Ob0RhdGEiBIC1GAgSdwoMVW5ibG9ja1Rvb25zEi8u" + + "Ym5ldC5wcm90b2NvbC51c2VyX21hbmFnZXIuVW5ibG9ja1Rvb25zUmVxdWVz" + + "dBowLmJuZXQucHJvdG9jb2wudXNlcl9tYW5hZ2VyLlVuYmxvY2tUb29uc1Jl" + + "c3BvbnNlIgSAtRgNEnoKDVJlcG9ydEFjY291bnQSMC5ibmV0LnByb3RvY29s" + + "LnVzZXJfbWFuYWdlci5SZXBvcnRBY2NvdW50UmVxdWVzdBoxLmJuZXQucHJv" + + "dG9jb2wudXNlcl9tYW5hZ2VyLlJlcG9ydEFjY291bnRSZXNwb25zZSIEgLUY" + + "ChJeCg1JZ25vcmVJbnZpdGVyEjAuYm5ldC5wcm90b2NvbC51c2VyX21hbmFn" + + "ZXIuSWdub3JlSW52aXRlclJlcXVlc3QaFS5ibmV0LnByb3RvY29sLk5vRGF0" + + "YSIEgLUYCxKDAQoQVW5pZ25vcmVJbnZpdGVycxIzLmJuZXQucHJvdG9jb2wu" + + "dXNlcl9tYW5hZ2VyLlVuaWdub3JlSW52aXRlcnNSZXF1ZXN0GjQuYm5ldC5w" + + "cm90b2NvbC51c2VyX21hbmFnZXIuVW5pZ25vcmVJbnZpdGVyc1Jlc3BvbnNl" + + "IgSAtRgOMvkBChFVc2VyTWFuYWdlck5vdGlmeRJwChROb3RpZnlJbnZpdGVy" + + "SWdub3JlZBI2LmJuZXQucHJvdG9jb2wudXNlcl9tYW5hZ2VyLkludml0ZXJJ" + + "Z25vcmVkTm90aWZpY2F0aW9uGhouYm5ldC5wcm90b2NvbC5OT19SRVNQT05T" + + "RSIEgLUYAxJyChZOb3RpZnlJbnZpdGVyVW5pZ25vcmVkEjYuYm5ldC5wcm90" + + "b2NvbC51c2VyX21hbmFnZXIuSW52aXRlcklnbm9yZWROb3RpZmljYXRpb24a" + + "Gi5ibmV0LnByb3RvY29sLk5PX1JFU1BPTlNFIgSAtRgEQgOAAQA="); + 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[] { "RecentPlayers", "BlockedToons", "IgnoredInviters", }); + internal__static_bnet_protocol_user_manager_ReportToonRequest__Descriptor = Descriptor.MessageTypes[4]; + internal__static_bnet_protocol_user_manager_ReportToonRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_ReportToonRequest__Descriptor, + new string[] { "TargetId", "Report", "BlockingAction", }); + internal__static_bnet_protocol_user_manager_ReportToonResponse__Descriptor = Descriptor.MessageTypes[5]; + internal__static_bnet_protocol_user_manager_ReportToonResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_ReportToonResponse__Descriptor, + new string[] { "ReportedToon", }); + internal__static_bnet_protocol_user_manager_AddRecentPlayersRequest__Descriptor = Descriptor.MessageTypes[6]; + 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[7]; + 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[8]; + 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[9]; + 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_ReportAccountRequest__Descriptor = Descriptor.MessageTypes[10]; + internal__static_bnet_protocol_user_manager_ReportAccountRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_ReportAccountRequest__Descriptor, + new string[] { "TargetAccount", "Report", }); + internal__static_bnet_protocol_user_manager_ReportAccountResponse__Descriptor = Descriptor.MessageTypes[11]; + internal__static_bnet_protocol_user_manager_ReportAccountResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_ReportAccountResponse__Descriptor, + new string[] { "ReportedAccount", }); + internal__static_bnet_protocol_user_manager_IgnoreInviterRequest__Descriptor = Descriptor.MessageTypes[12]; + internal__static_bnet_protocol_user_manager_IgnoreInviterRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_IgnoreInviterRequest__Descriptor, + new string[] { "TargetId", }); + internal__static_bnet_protocol_user_manager_UnignoreInvitersRequest__Descriptor = Descriptor.MessageTypes[13]; + internal__static_bnet_protocol_user_manager_UnignoreInvitersRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_UnignoreInvitersRequest__Descriptor, + new string[] { "TargetId", }); + internal__static_bnet_protocol_user_manager_BlockToonRequest__Descriptor = Descriptor.MessageTypes[14]; + internal__static_bnet_protocol_user_manager_BlockToonRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_BlockToonRequest__Descriptor, + new string[] { "TargetId", }); + internal__static_bnet_protocol_user_manager_UnblockToonsRequest__Descriptor = Descriptor.MessageTypes[15]; + internal__static_bnet_protocol_user_manager_UnblockToonsRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_UnblockToonsRequest__Descriptor, + new string[] { "TargetId", }); + internal__static_bnet_protocol_user_manager_UnblockToonsResponse__Descriptor = Descriptor.MessageTypes[16]; + internal__static_bnet_protocol_user_manager_UnblockToonsResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_UnblockToonsResponse__Descriptor, + new string[] { "UnblockedToon", }); + internal__static_bnet_protocol_user_manager_UnignoreInvitersResponse__Descriptor = Descriptor.MessageTypes[17]; + internal__static_bnet_protocol_user_manager_UnignoreInvitersResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_UnignoreInvitersResponse__Descriptor, + new string[] { "UnignoredInviter", }); + internal__static_bnet_protocol_user_manager_InviterIgnoredNotification__Descriptor = Descriptor.MessageTypes[18]; + internal__static_bnet_protocol_user_manager_InviterIgnoredNotification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_bnet_protocol_user_manager_InviterIgnoredNotification__Descriptor, + new string[] { "Players", }); + 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 PlayerReport : pb::GeneratedMessage { + private PlayerReport() { } + private static readonly PlayerReport defaultInstance = new PlayerReport().MakeReadOnly(); + private static readonly string[] _playerReportFieldNames = new string[] { "complaint_code", "complaint_note" }; + private static readonly uint[] _playerReportFieldTags = new uint[] { 8, 18 }; + 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 + [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 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::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _playerReportFieldNames; + if (hasComplaintCode) { + output.WriteEnum(1, field_names[0], (int) ComplaintCode, ComplaintCode); + } + if (hasComplaintNote) { + output.WriteString(2, field_names[1], 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::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PlayerReport ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PlayerReport MakeReadOnly() { + return this; + } + + public 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 new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PlayerReport cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PlayerReport result; + + private PlayerReport PrepareBuilder() { + if (resultIsReadOnly) { + PlayerReport original = result; + result = new PlayerReport(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PlayerReport MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.PlayerReport.Descriptor; } + } + + public override PlayerReport DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.PlayerReport.DefaultInstance; } + } + + public override PlayerReport BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + 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; + PrepareBuilder(); + if (other.HasComplaintCode) { + ComplaintCode = other.ComplaintCode; + } + if (other.HasComplaintNote) { + ComplaintNote = other.ComplaintNote; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_playerReportFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _playerReportFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.complaintCode_, out unknown)) { + result.hasComplaintCode = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + case 18: { + result.hasComplaintNote = input.ReadString(ref result.complaintNote_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + 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) { + PrepareBuilder(); + result.hasComplaintCode = true; + result.complaintCode_ = value; + return this; + } + public Builder ClearComplaintCode() { + PrepareBuilder(); + 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"); + PrepareBuilder(); + result.hasComplaintNote = true; + result.complaintNote_ = value; + return this; + } + public Builder ClearComplaintNote() { + PrepareBuilder(); + result.hasComplaintNote = false; + result.complaintNote_ = ""; + return this; + } + } + static PlayerReport() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); + } + } + + [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", "player", "timestamp_played" }; + private static readonly uint[] _recentPlayerFieldTags = new uint[] { 26, 10, 17 }; + 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_; + public bool HasPlayer { + get { return hasPlayer; } + } + public global::bnet.protocol.EntityId Player { + get { return player_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int TimestampPlayedFieldNumber = 2; + private bool hasTimestampPlayed; + private ulong timestampPlayed_; + 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::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _recentPlayerFieldNames; + if (hasPlayer) { + output.WriteMessage(1, field_names[1], Player); + } + if (hasTimestampPlayed) { + output.WriteFixed64(2, field_names[2], TimestampPlayed); + } + if (attributes_.Count > 0) { + output.WriteMessageArray(3, 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 (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::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.HasPlayer) { + MergePlayer(other.Player); + } + if (other.HasTimestampPlayed) { + TimestampPlayed = other.TimestampPlayed; + } + 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(_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.hasPlayer) { + subBuilder.MergeFrom(Player); + } + input.ReadMessage(subBuilder, extensionRegistry); + Player = subBuilder.BuildPartial(); + break; + } + case 17: { + result.hasTimestampPlayed = input.ReadFixed64(ref result.timestampPlayed_); + break; + } + case 26: { + input.ReadMessageArray(tag, field_name, result.attributes_, global::bnet.protocol.attribute.Attribute.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + 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"); + PrepareBuilder(); + result.hasPlayer = true; + result.player_ = value; + return this; + } + public Builder SetPlayer(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPlayer = true; + result.player_ = builderForValue.Build(); + return this; + } + public Builder MergePlayer(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + 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() { + PrepareBuilder(); + result.hasPlayer = false; + result.player_ = null; + 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; + } + } + static RecentPlayer() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); + } + } + + [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[] { "object_id" }; + private static readonly uint[] _subscribeToUserManagerRequestFieldTags = new uint[] { 8 }; + 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_; + 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 = _subscribeToUserManagerRequestFieldNames; + if (hasObjectId) { + output.WriteUInt64(1, 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 (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::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.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 8: { + result.hasObjectId = input.ReadUInt64(ref result.objectId_); + 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; + } + } + static SubscribeToUserManagerRequest() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, 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_toons", "ignored_inviters", "recent_players" }; + private static readonly uint[] _subscribeToUserManagerResponseFieldTags = new uint[] { 26, 34, 18 }; + 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 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 BlockedToonsFieldNumber = 3; + private pbc::PopsicleList blockedToons_ = new pbc::PopsicleList(); + public scg::IList BlockedToonsList { + get { return blockedToons_; } + } + public int BlockedToonsCount { + get { return blockedToons_.Count; } + } + public global::bnet.protocol.EntityId GetBlockedToons(int index) { + return blockedToons_[index]; + } + + public const int IgnoredInvitersFieldNumber = 4; + private pbc::PopsicleList ignoredInviters_ = new pbc::PopsicleList(); + public scg::IList IgnoredInvitersList { + get { return ignoredInviters_; } + } + public int IgnoredInvitersCount { + get { return ignoredInviters_.Count; } + } + public global::bnet.protocol.EntityId GetIgnoredInviters(int index) { + return ignoredInviters_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.user_manager.RecentPlayer element in RecentPlayersList) { + if (!element.IsInitialized) return false; + } + foreach (global::bnet.protocol.EntityId element in BlockedToonsList) { + if (!element.IsInitialized) return false; + } + foreach (global::bnet.protocol.EntityId element in IgnoredInvitersList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _subscribeToUserManagerResponseFieldNames; + if (recentPlayers_.Count > 0) { + output.WriteMessageArray(2, field_names[2], recentPlayers_); + } + if (blockedToons_.Count > 0) { + output.WriteMessageArray(3, field_names[0], blockedToons_); + } + if (ignoredInviters_.Count > 0) { + output.WriteMessageArray(4, field_names[1], ignoredInviters_); + } + 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 RecentPlayersList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + foreach (global::bnet.protocol.EntityId element in BlockedToonsList) { + size += pb::CodedOutputStream.ComputeMessageSize(3, element); + } + foreach (global::bnet.protocol.EntityId element in IgnoredInvitersList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, 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() { + recentPlayers_.MakeReadOnly(); + blockedToons_.MakeReadOnly(); + ignoredInviters_.MakeReadOnly(); + return this; + } + + public 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.recentPlayers_.Count != 0) { + result.recentPlayers_.Add(other.recentPlayers_); + } + if (other.blockedToons_.Count != 0) { + result.blockedToons_.Add(other.blockedToons_); + } + if (other.ignoredInviters_.Count != 0) { + result.ignoredInviters_.Add(other.ignoredInviters_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + 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 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.blockedToons_, global::bnet.protocol.EntityId.DefaultInstance, extensionRegistry); + break; + } + case 34: { + input.ReadMessageArray(tag, field_name, result.ignoredInviters_, global::bnet.protocol.EntityId.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + 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 BlockedToonsList { + get { return PrepareBuilder().blockedToons_; } + } + public int BlockedToonsCount { + get { return result.BlockedToonsCount; } + } + public global::bnet.protocol.EntityId GetBlockedToons(int index) { + return result.GetBlockedToons(index); + } + public Builder SetBlockedToons(int index, global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.blockedToons_[index] = value; + return this; + } + public Builder SetBlockedToons(int index, global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.blockedToons_[index] = builderForValue.Build(); + return this; + } + public Builder AddBlockedToons(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.blockedToons_.Add(value); + return this; + } + public Builder AddBlockedToons(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.blockedToons_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeBlockedToons(scg::IEnumerable values) { + PrepareBuilder(); + result.blockedToons_.Add(values); + return this; + } + public Builder ClearBlockedToons() { + PrepareBuilder(); + result.blockedToons_.Clear(); + return this; + } + + public pbc::IPopsicleList IgnoredInvitersList { + get { return PrepareBuilder().ignoredInviters_; } + } + public int IgnoredInvitersCount { + get { return result.IgnoredInvitersCount; } + } + public global::bnet.protocol.EntityId GetIgnoredInviters(int index) { + return result.GetIgnoredInviters(index); + } + public Builder SetIgnoredInviters(int index, global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.ignoredInviters_[index] = value; + return this; + } + public Builder SetIgnoredInviters(int index, global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.ignoredInviters_[index] = builderForValue.Build(); + return this; + } + public Builder AddIgnoredInviters(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.ignoredInviters_.Add(value); + return this; + } + public Builder AddIgnoredInviters(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.ignoredInviters_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeIgnoredInviters(scg::IEnumerable values) { + PrepareBuilder(); + result.ignoredInviters_.Add(values); + return this; + } + public Builder ClearIgnoredInviters() { + PrepareBuilder(); + result.ignoredInviters_.Clear(); + return this; + } + } + static SubscribeToUserManagerResponse() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ReportToonRequest : pb::GeneratedMessage { + private ReportToonRequest() { } + private static readonly ReportToonRequest defaultInstance = new ReportToonRequest().MakeReadOnly(); + private static readonly string[] _reportToonRequestFieldNames = new string[] { "blocking_action", "report", "target_id" }; + private static readonly uint[] _reportToonRequestFieldTags = new uint[] { 24, 18, 10 }; + public static ReportToonRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ReportToonRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ReportToonRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_ReportToonRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_ReportToonRequest__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 BlockAction { + SESSION_BLOCK_GAME_ACCOUNT = 1, + } + + } + #endregion + + 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 ReportFieldNumber = 2; + private bool hasReport; + private global::bnet.protocol.user_manager.PlayerReport report_; + public bool HasReport { + get { return hasReport; } + } + public global::bnet.protocol.user_manager.PlayerReport Report { + get { return report_ ?? global::bnet.protocol.user_manager.PlayerReport.DefaultInstance; } + } + + public const int BlockingActionFieldNumber = 3; + private bool hasBlockingAction; + private global::bnet.protocol.user_manager.ReportToonRequest.Types.BlockAction blockingAction_ = global::bnet.protocol.user_manager.ReportToonRequest.Types.BlockAction.SESSION_BLOCK_GAME_ACCOUNT; + public bool HasBlockingAction { + get { return hasBlockingAction; } + } + public global::bnet.protocol.user_manager.ReportToonRequest.Types.BlockAction BlockingAction { + get { return blockingAction_; } + } + + 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::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _reportToonRequestFieldNames; + if (hasTargetId) { + output.WriteMessage(1, field_names[2], TargetId); + } + if (hasReport) { + output.WriteMessage(2, field_names[1], Report); + } + if (hasBlockingAction) { + output.WriteEnum(3, field_names[0], (int) BlockingAction, BlockingAction); + } + 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); + } + if (hasBlockingAction) { + size += pb::CodedOutputStream.ComputeEnumSize(3, (int) BlockingAction); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ReportToonRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportToonRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportToonRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportToonRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportToonRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportToonRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ReportToonRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ReportToonRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ReportToonRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportToonRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ReportToonRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ReportToonRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ReportToonRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ReportToonRequest result; + + private ReportToonRequest PrepareBuilder() { + if (resultIsReadOnly) { + ReportToonRequest original = result; + result = new ReportToonRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ReportToonRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.ReportToonRequest.Descriptor; } + } + + public override ReportToonRequest DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.ReportToonRequest.DefaultInstance; } + } + + public override ReportToonRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ReportToonRequest) { + return MergeFrom((ReportToonRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ReportToonRequest other) { + if (other == global::bnet.protocol.user_manager.ReportToonRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTargetId) { + MergeTargetId(other.TargetId); + } + if (other.HasReport) { + MergeReport(other.Report); + } + if (other.HasBlockingAction) { + BlockingAction = other.BlockingAction; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_reportToonRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _reportToonRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.user_manager.PlayerReport.Builder subBuilder = global::bnet.protocol.user_manager.PlayerReport.CreateBuilder(); + if (result.hasReport) { + subBuilder.MergeFrom(Report); + } + input.ReadMessage(subBuilder, extensionRegistry); + Report = subBuilder.BuildPartial(); + break; + } + case 24: { + object unknown; + if(input.ReadEnum(ref result.blockingAction_, out unknown)) { + result.hasBlockingAction = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(3, (ulong)(int)unknown); + } + 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 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"); + PrepareBuilder(); + result.hasReport = true; + result.report_ = value; + return this; + } + public Builder SetReport(global::bnet.protocol.user_manager.PlayerReport.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReport = true; + result.report_ = builderForValue.Build(); + return this; + } + public Builder MergeReport(global::bnet.protocol.user_manager.PlayerReport value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + 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() { + PrepareBuilder(); + result.hasReport = false; + result.report_ = null; + return this; + } + + public bool HasBlockingAction { + get { return result.hasBlockingAction; } + } + public global::bnet.protocol.user_manager.ReportToonRequest.Types.BlockAction BlockingAction { + get { return result.BlockingAction; } + set { SetBlockingAction(value); } + } + public Builder SetBlockingAction(global::bnet.protocol.user_manager.ReportToonRequest.Types.BlockAction value) { + PrepareBuilder(); + result.hasBlockingAction = true; + result.blockingAction_ = value; + return this; + } + public Builder ClearBlockingAction() { + PrepareBuilder(); + result.hasBlockingAction = false; + result.blockingAction_ = global::bnet.protocol.user_manager.ReportToonRequest.Types.BlockAction.SESSION_BLOCK_GAME_ACCOUNT; + return this; + } + } + static ReportToonRequest() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ReportToonResponse : pb::GeneratedMessage { + private ReportToonResponse() { } + private static readonly ReportToonResponse defaultInstance = new ReportToonResponse().MakeReadOnly(); + private static readonly string[] _reportToonResponseFieldNames = new string[] { "reported_toon" }; + private static readonly uint[] _reportToonResponseFieldTags = new uint[] { 10 }; + public static ReportToonResponse DefaultInstance { + get { return defaultInstance; } + } + + public override ReportToonResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ReportToonResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_ReportToonResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_ReportToonResponse__FieldAccessorTable; } + } + + public const int ReportedToonFieldNumber = 1; + private bool hasReportedToon; + private global::bnet.protocol.EntityId reportedToon_; + public bool HasReportedToon { + get { return hasReportedToon; } + } + public global::bnet.protocol.EntityId ReportedToon { + get { return reportedToon_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (HasReportedToon) { + if (!ReportedToon.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _reportToonResponseFieldNames; + if (hasReportedToon) { + output.WriteMessage(1, field_names[0], ReportedToon); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasReportedToon) { + size += pb::CodedOutputStream.ComputeMessageSize(1, ReportedToon); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ReportToonResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportToonResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportToonResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportToonResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportToonResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportToonResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ReportToonResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ReportToonResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ReportToonResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportToonResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ReportToonResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ReportToonResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ReportToonResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ReportToonResponse result; + + private ReportToonResponse PrepareBuilder() { + if (resultIsReadOnly) { + ReportToonResponse original = result; + result = new ReportToonResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ReportToonResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.ReportToonResponse.Descriptor; } + } + + public override ReportToonResponse DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.ReportToonResponse.DefaultInstance; } + } + + public override ReportToonResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ReportToonResponse) { + return MergeFrom((ReportToonResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ReportToonResponse other) { + if (other == global::bnet.protocol.user_manager.ReportToonResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasReportedToon) { + MergeReportedToon(other.ReportedToon); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_reportToonResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _reportToonResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.hasReportedToon) { + subBuilder.MergeFrom(ReportedToon); + } + input.ReadMessage(subBuilder, extensionRegistry); + ReportedToon = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasReportedToon { + get { return result.hasReportedToon; } + } + public global::bnet.protocol.EntityId ReportedToon { + get { return result.ReportedToon; } + set { SetReportedToon(value); } + } + public Builder SetReportedToon(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReportedToon = true; + result.reportedToon_ = value; + return this; + } + public Builder SetReportedToon(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReportedToon = true; + result.reportedToon_ = builderForValue.Build(); + return this; + } + public Builder MergeReportedToon(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReportedToon && + result.reportedToon_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.reportedToon_ = global::bnet.protocol.EntityId.CreateBuilder(result.reportedToon_).MergeFrom(value).BuildPartial(); + } else { + result.reportedToon_ = value; + } + result.hasReportedToon = true; + return this; + } + public Builder ClearReportedToon() { + PrepareBuilder(); + result.hasReportedToon = false; + result.reportedToon_ = null; + return this; + } + } + static ReportToonResponse() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, 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.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::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.UserManager.Descriptor, 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, 26 }; + 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::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.WriteMessageArray(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); + } + 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::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: { + input.ReadMessageArray(tag, field_name, result.playersRemoved_, global::bnet.protocol.user_manager.RecentPlayer.DefaultInstance, extensionRegistry); + 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 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"); + PrepareBuilder(); + result.playersRemoved_[index] = value; + return this; + } + public Builder SetPlayersRemoved(int index, global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.playersRemoved_[index] = builderForValue.Build(); + return this; + } + public Builder AddPlayersRemoved(global::bnet.protocol.user_manager.RecentPlayer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.playersRemoved_.Add(value); + return this; + } + public Builder AddPlayersRemoved(global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.playersRemoved_.Add(builderForValue.Build()); + 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.UserManager.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RemoveRecentPlayersRequest : pb::GeneratedMessage { + private RemoveRecentPlayersRequest() { } + private static readonly RemoveRecentPlayersRequest defaultInstance = new RemoveRecentPlayersRequest().MakeReadOnly(); + private static readonly string[] _removeRecentPlayersRequestFieldNames = new string[] { "players" }; + private static readonly uint[] _removeRecentPlayersRequestFieldTags = new uint[] { 18 }; + 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::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _removeRecentPlayersRequestFieldNames; + if (players_.Count > 0) { + output.WriteMessageArray(2, 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(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::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RemoveRecentPlayersRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RemoveRecentPlayersRequest 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(RemoveRecentPlayersRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RemoveRecentPlayersRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RemoveRecentPlayersRequest result; + + private RemoveRecentPlayersRequest PrepareBuilder() { + if (resultIsReadOnly) { + RemoveRecentPlayersRequest original = result; + result = new RemoveRecentPlayersRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RemoveRecentPlayersRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.RemoveRecentPlayersRequest.Descriptor; } + } + + public override RemoveRecentPlayersRequest DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.RemoveRecentPlayersRequest.DefaultInstance; } + } + + public override RemoveRecentPlayersRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + 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; + 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(_removeRecentPlayersRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _removeRecentPlayersRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.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 RemoveRecentPlayersRequest() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class RemoveRecentPlayersResponse : pb::GeneratedMessage { + private RemoveRecentPlayersResponse() { } + private static readonly RemoveRecentPlayersResponse defaultInstance = new RemoveRecentPlayersResponse().MakeReadOnly(); + private static readonly string[] _removeRecentPlayersResponseFieldNames = new string[] { "players_removed" }; + private static readonly uint[] _removeRecentPlayersResponseFieldTags = new uint[] { 10 }; + 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::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _removeRecentPlayersResponseFieldNames; + if (playersRemoved_.Count > 0) { + output.WriteMessageArray(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; + 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::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RemoveRecentPlayersResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RemoveRecentPlayersResponse 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(RemoveRecentPlayersResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RemoveRecentPlayersResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RemoveRecentPlayersResponse result; + + private RemoveRecentPlayersResponse PrepareBuilder() { + if (resultIsReadOnly) { + RemoveRecentPlayersResponse original = result; + result = new RemoveRecentPlayersResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RemoveRecentPlayersResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.RemoveRecentPlayersResponse.Descriptor; } + } + + public override RemoveRecentPlayersResponse DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.RemoveRecentPlayersResponse.DefaultInstance; } + } + + public override RemoveRecentPlayersResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + 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; + 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(_removeRecentPlayersResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _removeRecentPlayersResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.playersRemoved_, global::bnet.protocol.user_manager.RecentPlayer.DefaultInstance, extensionRegistry); + 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 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"); + PrepareBuilder(); + result.playersRemoved_[index] = value; + return this; + } + public Builder SetPlayersRemoved(int index, global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.playersRemoved_[index] = builderForValue.Build(); + return this; + } + public Builder AddPlayersRemoved(global::bnet.protocol.user_manager.RecentPlayer value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.playersRemoved_.Add(value); + return this; + } + public Builder AddPlayersRemoved(global::bnet.protocol.user_manager.RecentPlayer.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.playersRemoved_.Add(builderForValue.Build()); + 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 RemoveRecentPlayersResponse() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ReportAccountRequest : pb::GeneratedMessage { + private ReportAccountRequest() { } + private static readonly ReportAccountRequest defaultInstance = new ReportAccountRequest().MakeReadOnly(); + private static readonly string[] _reportAccountRequestFieldNames = new string[] { "report", "target_account" }; + private static readonly uint[] _reportAccountRequestFieldTags = new uint[] { 18, 10 }; + public static ReportAccountRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ReportAccountRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ReportAccountRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_ReportAccountRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_ReportAccountRequest__FieldAccessorTable; } + } + + public const int TargetAccountFieldNumber = 1; + private bool hasTargetAccount; + private global::bnet.protocol.EntityId targetAccount_; + public bool HasTargetAccount { + get { return hasTargetAccount; } + } + public global::bnet.protocol.EntityId TargetAccount { + get { return targetAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public const int ReportFieldNumber = 2; + private bool hasReport; + private global::bnet.protocol.user_manager.PlayerReport report_; + public bool HasReport { + get { return hasReport; } + } + public global::bnet.protocol.user_manager.PlayerReport Report { + get { return report_ ?? global::bnet.protocol.user_manager.PlayerReport.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasTargetAccount) return false; + if (!hasReport) return false; + if (!TargetAccount.IsInitialized) return false; + if (!Report.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _reportAccountRequestFieldNames; + if (hasTargetAccount) { + output.WriteMessage(1, field_names[1], TargetAccount); + } + if (hasReport) { + output.WriteMessage(2, 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 (hasTargetAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(1, TargetAccount); + } + if (hasReport) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Report); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ReportAccountRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportAccountRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportAccountRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportAccountRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportAccountRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportAccountRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ReportAccountRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ReportAccountRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ReportAccountRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportAccountRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ReportAccountRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ReportAccountRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ReportAccountRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ReportAccountRequest result; + + private ReportAccountRequest PrepareBuilder() { + if (resultIsReadOnly) { + ReportAccountRequest original = result; + result = new ReportAccountRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ReportAccountRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.ReportAccountRequest.Descriptor; } + } + + public override ReportAccountRequest DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.ReportAccountRequest.DefaultInstance; } + } + + public override ReportAccountRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ReportAccountRequest) { + return MergeFrom((ReportAccountRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ReportAccountRequest other) { + if (other == global::bnet.protocol.user_manager.ReportAccountRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTargetAccount) { + MergeTargetAccount(other.TargetAccount); + } + 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(_reportAccountRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _reportAccountRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.hasTargetAccount) { + subBuilder.MergeFrom(TargetAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + TargetAccount = subBuilder.BuildPartial(); + break; + } + case 18: { + global::bnet.protocol.user_manager.PlayerReport.Builder subBuilder = global::bnet.protocol.user_manager.PlayerReport.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 HasTargetAccount { + get { return result.hasTargetAccount; } + } + public global::bnet.protocol.EntityId TargetAccount { + get { return result.TargetAccount; } + set { SetTargetAccount(value); } + } + public Builder SetTargetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTargetAccount = true; + result.targetAccount_ = value; + return this; + } + public Builder SetTargetAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTargetAccount = true; + result.targetAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeTargetAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTargetAccount && + result.targetAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.targetAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.targetAccount_).MergeFrom(value).BuildPartial(); + } else { + result.targetAccount_ = value; + } + result.hasTargetAccount = true; + return this; + } + public Builder ClearTargetAccount() { + PrepareBuilder(); + result.hasTargetAccount = false; + result.targetAccount_ = null; + 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"); + PrepareBuilder(); + result.hasReport = true; + result.report_ = value; + return this; + } + public Builder SetReport(global::bnet.protocol.user_manager.PlayerReport.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReport = true; + result.report_ = builderForValue.Build(); + return this; + } + public Builder MergeReport(global::bnet.protocol.user_manager.PlayerReport value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + 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() { + PrepareBuilder(); + result.hasReport = false; + result.report_ = null; + return this; + } + } + static ReportAccountRequest() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class ReportAccountResponse : pb::GeneratedMessage { + private ReportAccountResponse() { } + private static readonly ReportAccountResponse defaultInstance = new ReportAccountResponse().MakeReadOnly(); + private static readonly string[] _reportAccountResponseFieldNames = new string[] { "reported_account" }; + private static readonly uint[] _reportAccountResponseFieldTags = new uint[] { 10 }; + public static ReportAccountResponse DefaultInstance { + get { return defaultInstance; } + } + + public override ReportAccountResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ReportAccountResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_ReportAccountResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_ReportAccountResponse__FieldAccessorTable; } + } + + public const int ReportedAccountFieldNumber = 1; + private bool hasReportedAccount; + private global::bnet.protocol.EntityId reportedAccount_; + public bool HasReportedAccount { + get { return hasReportedAccount; } + } + public global::bnet.protocol.EntityId ReportedAccount { + get { return reportedAccount_ ?? global::bnet.protocol.EntityId.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (HasReportedAccount) { + if (!ReportedAccount.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _reportAccountResponseFieldNames; + if (hasReportedAccount) { + output.WriteMessage(1, field_names[0], ReportedAccount); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasReportedAccount) { + size += pb::CodedOutputStream.ComputeMessageSize(1, ReportedAccount); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static ReportAccountResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportAccountResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportAccountResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReportAccountResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReportAccountResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportAccountResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ReportAccountResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ReportAccountResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ReportAccountResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReportAccountResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ReportAccountResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ReportAccountResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ReportAccountResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ReportAccountResponse result; + + private ReportAccountResponse PrepareBuilder() { + if (resultIsReadOnly) { + ReportAccountResponse original = result; + result = new ReportAccountResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ReportAccountResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.ReportAccountResponse.Descriptor; } + } + + public override ReportAccountResponse DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.ReportAccountResponse.DefaultInstance; } + } + + public override ReportAccountResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ReportAccountResponse) { + return MergeFrom((ReportAccountResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ReportAccountResponse other) { + if (other == global::bnet.protocol.user_manager.ReportAccountResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasReportedAccount) { + MergeReportedAccount(other.ReportedAccount); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_reportAccountResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _reportAccountResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.hasReportedAccount) { + subBuilder.MergeFrom(ReportedAccount); + } + input.ReadMessage(subBuilder, extensionRegistry); + ReportedAccount = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasReportedAccount { + get { return result.hasReportedAccount; } + } + public global::bnet.protocol.EntityId ReportedAccount { + get { return result.ReportedAccount; } + set { SetReportedAccount(value); } + } + public Builder SetReportedAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReportedAccount = true; + result.reportedAccount_ = value; + return this; + } + public Builder SetReportedAccount(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReportedAccount = true; + result.reportedAccount_ = builderForValue.Build(); + return this; + } + public Builder MergeReportedAccount(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReportedAccount && + result.reportedAccount_ != global::bnet.protocol.EntityId.DefaultInstance) { + result.reportedAccount_ = global::bnet.protocol.EntityId.CreateBuilder(result.reportedAccount_).MergeFrom(value).BuildPartial(); + } else { + result.reportedAccount_ = value; + } + result.hasReportedAccount = true; + return this; + } + public Builder ClearReportedAccount() { + PrepareBuilder(); + result.hasReportedAccount = false; + result.reportedAccount_ = null; + return this; + } + } + static ReportAccountResponse() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class IgnoreInviterRequest : pb::GeneratedMessage { + private IgnoreInviterRequest() { } + private static readonly IgnoreInviterRequest defaultInstance = new IgnoreInviterRequest().MakeReadOnly(); + private static readonly string[] _ignoreInviterRequestFieldNames = new string[] { "target_id" }; + private static readonly uint[] _ignoreInviterRequestFieldTags = new uint[] { 10 }; + public static IgnoreInviterRequest DefaultInstance { + get { return defaultInstance; } + } + + public override IgnoreInviterRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override IgnoreInviterRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_IgnoreInviterRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_IgnoreInviterRequest__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 override bool IsInitialized { + get { + if (!hasTargetId) return false; + if (!TargetId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _ignoreInviterRequestFieldNames; + if (hasTargetId) { + output.WriteMessage(1, field_names[0], 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 IgnoreInviterRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static IgnoreInviterRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static IgnoreInviterRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static IgnoreInviterRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static IgnoreInviterRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static IgnoreInviterRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static IgnoreInviterRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static IgnoreInviterRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static IgnoreInviterRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static IgnoreInviterRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private IgnoreInviterRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(IgnoreInviterRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(IgnoreInviterRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private IgnoreInviterRequest result; + + private IgnoreInviterRequest PrepareBuilder() { + if (resultIsReadOnly) { + IgnoreInviterRequest original = result; + result = new IgnoreInviterRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override IgnoreInviterRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.IgnoreInviterRequest.Descriptor; } + } + + public override IgnoreInviterRequest DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.IgnoreInviterRequest.DefaultInstance; } + } + + public override IgnoreInviterRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is IgnoreInviterRequest) { + return MergeFrom((IgnoreInviterRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(IgnoreInviterRequest other) { + if (other == global::bnet.protocol.user_manager.IgnoreInviterRequest.DefaultInstance) return this; + PrepareBuilder(); + 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(_ignoreInviterRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _ignoreInviterRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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; + } + } + } + + 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; + } + } + static IgnoreInviterRequest() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UnignoreInvitersRequest : pb::GeneratedMessage { + private UnignoreInvitersRequest() { } + private static readonly UnignoreInvitersRequest defaultInstance = new UnignoreInvitersRequest().MakeReadOnly(); + private static readonly string[] _unignoreInvitersRequestFieldNames = new string[] { "target_id" }; + private static readonly uint[] _unignoreInvitersRequestFieldTags = new uint[] { 10 }; + public static UnignoreInvitersRequest DefaultInstance { + get { return defaultInstance; } + } + + public override UnignoreInvitersRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UnignoreInvitersRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_UnignoreInvitersRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_UnignoreInvitersRequest__FieldAccessorTable; } + } + + public const int TargetIdFieldNumber = 1; + private pbc::PopsicleList targetId_ = new pbc::PopsicleList(); + public scg::IList TargetIdList { + get { return targetId_; } + } + public int TargetIdCount { + get { return targetId_.Count; } + } + public global::bnet.protocol.EntityId GetTargetId(int index) { + return targetId_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.EntityId element in TargetIdList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _unignoreInvitersRequestFieldNames; + if (targetId_.Count > 0) { + output.WriteMessageArray(1, field_names[0], targetId_); + } + 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 TargetIdList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static UnignoreInvitersRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnignoreInvitersRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnignoreInvitersRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnignoreInvitersRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnignoreInvitersRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnignoreInvitersRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UnignoreInvitersRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UnignoreInvitersRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UnignoreInvitersRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnignoreInvitersRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UnignoreInvitersRequest MakeReadOnly() { + targetId_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UnignoreInvitersRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnignoreInvitersRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnignoreInvitersRequest result; + + private UnignoreInvitersRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnignoreInvitersRequest original = result; + result = new UnignoreInvitersRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UnignoreInvitersRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.UnignoreInvitersRequest.Descriptor; } + } + + public override UnignoreInvitersRequest DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.UnignoreInvitersRequest.DefaultInstance; } + } + + public override UnignoreInvitersRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UnignoreInvitersRequest) { + return MergeFrom((UnignoreInvitersRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UnignoreInvitersRequest other) { + if (other == global::bnet.protocol.user_manager.UnignoreInvitersRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.targetId_.Count != 0) { + result.targetId_.Add(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(_unignoreInvitersRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unignoreInvitersRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.targetId_, global::bnet.protocol.EntityId.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList TargetIdList { + get { return PrepareBuilder().targetId_; } + } + public int TargetIdCount { + get { return result.TargetIdCount; } + } + public global::bnet.protocol.EntityId GetTargetId(int index) { + return result.GetTargetId(index); + } + public Builder SetTargetId(int index, global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.targetId_[index] = value; + return this; + } + public Builder SetTargetId(int index, global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.targetId_[index] = builderForValue.Build(); + return this; + } + public Builder AddTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.targetId_.Add(value); + return this; + } + public Builder AddTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.targetId_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeTargetId(scg::IEnumerable values) { + PrepareBuilder(); + result.targetId_.Add(values); + return this; + } + public Builder ClearTargetId() { + PrepareBuilder(); + result.targetId_.Clear(); + return this; + } + } + static UnignoreInvitersRequest() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class BlockToonRequest : pb::GeneratedMessage { + private BlockToonRequest() { } + private static readonly BlockToonRequest defaultInstance = new BlockToonRequest().MakeReadOnly(); + private static readonly string[] _blockToonRequestFieldNames = new string[] { "target_id" }; + private static readonly uint[] _blockToonRequestFieldTags = new uint[] { 10 }; + public static BlockToonRequest DefaultInstance { + get { return defaultInstance; } + } + + public override BlockToonRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BlockToonRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_BlockToonRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_BlockToonRequest__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 override bool IsInitialized { + get { + if (!hasTargetId) return false; + if (!TargetId.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _blockToonRequestFieldNames; + if (hasTargetId) { + output.WriteMessage(1, field_names[0], 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 BlockToonRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BlockToonRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BlockToonRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BlockToonRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BlockToonRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BlockToonRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BlockToonRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BlockToonRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BlockToonRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BlockToonRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BlockToonRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BlockToonRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BlockToonRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BlockToonRequest result; + + private BlockToonRequest PrepareBuilder() { + if (resultIsReadOnly) { + BlockToonRequest original = result; + result = new BlockToonRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BlockToonRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.BlockToonRequest.Descriptor; } + } + + public override BlockToonRequest DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.BlockToonRequest.DefaultInstance; } + } + + public override BlockToonRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BlockToonRequest) { + return MergeFrom((BlockToonRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BlockToonRequest other) { + if (other == global::bnet.protocol.user_manager.BlockToonRequest.DefaultInstance) return this; + PrepareBuilder(); + 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(_blockToonRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _blockToonRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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; + } + } + } + + 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; + } + } + static BlockToonRequest() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UnblockToonsRequest : pb::GeneratedMessage { + private UnblockToonsRequest() { } + private static readonly UnblockToonsRequest defaultInstance = new UnblockToonsRequest().MakeReadOnly(); + private static readonly string[] _unblockToonsRequestFieldNames = new string[] { "target_id" }; + private static readonly uint[] _unblockToonsRequestFieldTags = new uint[] { 10 }; + public static UnblockToonsRequest DefaultInstance { + get { return defaultInstance; } + } + + public override UnblockToonsRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UnblockToonsRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_UnblockToonsRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_UnblockToonsRequest__FieldAccessorTable; } + } + + public const int TargetIdFieldNumber = 1; + private pbc::PopsicleList targetId_ = new pbc::PopsicleList(); + public scg::IList TargetIdList { + get { return targetId_; } + } + public int TargetIdCount { + get { return targetId_.Count; } + } + public global::bnet.protocol.EntityId GetTargetId(int index) { + return targetId_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.EntityId element in TargetIdList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _unblockToonsRequestFieldNames; + if (targetId_.Count > 0) { + output.WriteMessageArray(1, field_names[0], targetId_); + } + 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 TargetIdList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static UnblockToonsRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnblockToonsRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnblockToonsRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnblockToonsRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnblockToonsRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnblockToonsRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UnblockToonsRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UnblockToonsRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UnblockToonsRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnblockToonsRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UnblockToonsRequest MakeReadOnly() { + targetId_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UnblockToonsRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnblockToonsRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnblockToonsRequest result; + + private UnblockToonsRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnblockToonsRequest original = result; + result = new UnblockToonsRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UnblockToonsRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.UnblockToonsRequest.Descriptor; } + } + + public override UnblockToonsRequest DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.UnblockToonsRequest.DefaultInstance; } + } + + public override UnblockToonsRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UnblockToonsRequest) { + return MergeFrom((UnblockToonsRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UnblockToonsRequest other) { + if (other == global::bnet.protocol.user_manager.UnblockToonsRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.targetId_.Count != 0) { + result.targetId_.Add(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(_unblockToonsRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unblockToonsRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.targetId_, global::bnet.protocol.EntityId.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList TargetIdList { + get { return PrepareBuilder().targetId_; } + } + public int TargetIdCount { + get { return result.TargetIdCount; } + } + public global::bnet.protocol.EntityId GetTargetId(int index) { + return result.GetTargetId(index); + } + public Builder SetTargetId(int index, global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.targetId_[index] = value; + return this; + } + public Builder SetTargetId(int index, global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.targetId_[index] = builderForValue.Build(); + return this; + } + public Builder AddTargetId(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.targetId_.Add(value); + return this; + } + public Builder AddTargetId(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.targetId_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeTargetId(scg::IEnumerable values) { + PrepareBuilder(); + result.targetId_.Add(values); + return this; + } + public Builder ClearTargetId() { + PrepareBuilder(); + result.targetId_.Clear(); + return this; + } + } + static UnblockToonsRequest() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UnblockToonsResponse : pb::GeneratedMessage { + private UnblockToonsResponse() { } + private static readonly UnblockToonsResponse defaultInstance = new UnblockToonsResponse().MakeReadOnly(); + private static readonly string[] _unblockToonsResponseFieldNames = new string[] { "unblocked_toon" }; + private static readonly uint[] _unblockToonsResponseFieldTags = new uint[] { 10 }; + public static UnblockToonsResponse DefaultInstance { + get { return defaultInstance; } + } + + public override UnblockToonsResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UnblockToonsResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_UnblockToonsResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_UnblockToonsResponse__FieldAccessorTable; } + } + + public const int UnblockedToonFieldNumber = 1; + private pbc::PopsicleList unblockedToon_ = new pbc::PopsicleList(); + public scg::IList UnblockedToonList { + get { return unblockedToon_; } + } + public int UnblockedToonCount { + get { return unblockedToon_.Count; } + } + public global::bnet.protocol.EntityId GetUnblockedToon(int index) { + return unblockedToon_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.EntityId element in UnblockedToonList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _unblockToonsResponseFieldNames; + if (unblockedToon_.Count > 0) { + output.WriteMessageArray(1, field_names[0], unblockedToon_); + } + 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 UnblockedToonList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static UnblockToonsResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnblockToonsResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnblockToonsResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnblockToonsResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnblockToonsResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnblockToonsResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UnblockToonsResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UnblockToonsResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UnblockToonsResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnblockToonsResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UnblockToonsResponse MakeReadOnly() { + unblockedToon_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UnblockToonsResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnblockToonsResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnblockToonsResponse result; + + private UnblockToonsResponse PrepareBuilder() { + if (resultIsReadOnly) { + UnblockToonsResponse original = result; + result = new UnblockToonsResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UnblockToonsResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.UnblockToonsResponse.Descriptor; } + } + + public override UnblockToonsResponse DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.UnblockToonsResponse.DefaultInstance; } + } + + public override UnblockToonsResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UnblockToonsResponse) { + return MergeFrom((UnblockToonsResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UnblockToonsResponse other) { + if (other == global::bnet.protocol.user_manager.UnblockToonsResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.unblockedToon_.Count != 0) { + result.unblockedToon_.Add(other.unblockedToon_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unblockToonsResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unblockToonsResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.unblockedToon_, global::bnet.protocol.EntityId.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList UnblockedToonList { + get { return PrepareBuilder().unblockedToon_; } + } + public int UnblockedToonCount { + get { return result.UnblockedToonCount; } + } + public global::bnet.protocol.EntityId GetUnblockedToon(int index) { + return result.GetUnblockedToon(index); + } + public Builder SetUnblockedToon(int index, global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.unblockedToon_[index] = value; + return this; + } + public Builder SetUnblockedToon(int index, global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.unblockedToon_[index] = builderForValue.Build(); + return this; + } + public Builder AddUnblockedToon(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.unblockedToon_.Add(value); + return this; + } + public Builder AddUnblockedToon(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.unblockedToon_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeUnblockedToon(scg::IEnumerable values) { + PrepareBuilder(); + result.unblockedToon_.Add(values); + return this; + } + public Builder ClearUnblockedToon() { + PrepareBuilder(); + result.unblockedToon_.Clear(); + return this; + } + } + static UnblockToonsResponse() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class UnignoreInvitersResponse : pb::GeneratedMessage { + private UnignoreInvitersResponse() { } + private static readonly UnignoreInvitersResponse defaultInstance = new UnignoreInvitersResponse().MakeReadOnly(); + private static readonly string[] _unignoreInvitersResponseFieldNames = new string[] { "unignored_inviter" }; + private static readonly uint[] _unignoreInvitersResponseFieldTags = new uint[] { 10 }; + public static UnignoreInvitersResponse DefaultInstance { + get { return defaultInstance; } + } + + public override UnignoreInvitersResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UnignoreInvitersResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_UnignoreInvitersResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_UnignoreInvitersResponse__FieldAccessorTable; } + } + + public const int UnignoredInviterFieldNumber = 1; + private pbc::PopsicleList unignoredInviter_ = new pbc::PopsicleList(); + public scg::IList UnignoredInviterList { + get { return unignoredInviter_; } + } + public int UnignoredInviterCount { + get { return unignoredInviter_.Count; } + } + public global::bnet.protocol.EntityId GetUnignoredInviter(int index) { + return unignoredInviter_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::bnet.protocol.EntityId element in UnignoredInviterList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _unignoreInvitersResponseFieldNames; + if (unignoredInviter_.Count > 0) { + output.WriteMessageArray(1, field_names[0], unignoredInviter_); + } + 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 UnignoredInviterList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static UnignoreInvitersResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnignoreInvitersResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnignoreInvitersResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnignoreInvitersResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnignoreInvitersResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnignoreInvitersResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UnignoreInvitersResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UnignoreInvitersResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UnignoreInvitersResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnignoreInvitersResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UnignoreInvitersResponse MakeReadOnly() { + unignoredInviter_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UnignoreInvitersResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnignoreInvitersResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnignoreInvitersResponse result; + + private UnignoreInvitersResponse PrepareBuilder() { + if (resultIsReadOnly) { + UnignoreInvitersResponse original = result; + result = new UnignoreInvitersResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UnignoreInvitersResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.UnignoreInvitersResponse.Descriptor; } + } + + public override UnignoreInvitersResponse DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.UnignoreInvitersResponse.DefaultInstance; } + } + + public override UnignoreInvitersResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UnignoreInvitersResponse) { + return MergeFrom((UnignoreInvitersResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UnignoreInvitersResponse other) { + if (other == global::bnet.protocol.user_manager.UnignoreInvitersResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.unignoredInviter_.Count != 0) { + result.unignoredInviter_.Add(other.unignoredInviter_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unignoreInvitersResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unignoreInvitersResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.unignoredInviter_, global::bnet.protocol.EntityId.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList UnignoredInviterList { + get { return PrepareBuilder().unignoredInviter_; } + } + public int UnignoredInviterCount { + get { return result.UnignoredInviterCount; } + } + public global::bnet.protocol.EntityId GetUnignoredInviter(int index) { + return result.GetUnignoredInviter(index); + } + public Builder SetUnignoredInviter(int index, global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.unignoredInviter_[index] = value; + return this; + } + public Builder SetUnignoredInviter(int index, global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.unignoredInviter_[index] = builderForValue.Build(); + return this; + } + public Builder AddUnignoredInviter(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.unignoredInviter_.Add(value); + return this; + } + public Builder AddUnignoredInviter(global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.unignoredInviter_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeUnignoredInviter(scg::IEnumerable values) { + PrepareBuilder(); + result.unignoredInviter_.Add(values); + return this; + } + public Builder ClearUnignoredInviter() { + PrepareBuilder(); + result.unignoredInviter_.Clear(); + return this; + } + } + static UnignoreInvitersResponse() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class InviterIgnoredNotification : pb::GeneratedMessage { + private InviterIgnoredNotification() { } + private static readonly InviterIgnoredNotification defaultInstance = new InviterIgnoredNotification().MakeReadOnly(); + private static readonly string[] _inviterIgnoredNotificationFieldNames = new string[] { "players" }; + private static readonly uint[] _inviterIgnoredNotificationFieldTags = new uint[] { 10 }; + public static InviterIgnoredNotification DefaultInstance { + get { return defaultInstance; } + } + + public override InviterIgnoredNotification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override InviterIgnoredNotification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_InviterIgnoredNotification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::bnet.protocol.user_manager.UserManager.internal__static_bnet_protocol_user_manager_InviterIgnoredNotification__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::ICodedOutputStream output) { + int size = SerializedSize; + string[] field_names = _inviterIgnoredNotificationFieldNames; + 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.EntityId element in PlayersList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + } + + public static InviterIgnoredNotification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static InviterIgnoredNotification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static InviterIgnoredNotification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static InviterIgnoredNotification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static InviterIgnoredNotification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static InviterIgnoredNotification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static InviterIgnoredNotification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static InviterIgnoredNotification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static InviterIgnoredNotification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static InviterIgnoredNotification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private InviterIgnoredNotification 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(InviterIgnoredNotification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.4.1.473")] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(InviterIgnoredNotification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private InviterIgnoredNotification result; + + private InviterIgnoredNotification PrepareBuilder() { + if (resultIsReadOnly) { + InviterIgnoredNotification original = result; + result = new InviterIgnoredNotification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override InviterIgnoredNotification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + 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.InviterIgnoredNotification.Descriptor; } + } + + public override InviterIgnoredNotification DefaultInstanceForType { + get { return global::bnet.protocol.user_manager.InviterIgnoredNotification.DefaultInstance; } + } + + public override InviterIgnoredNotification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is InviterIgnoredNotification) { + return MergeFrom((InviterIgnoredNotification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(InviterIgnoredNotification other) { + if (other == global::bnet.protocol.user_manager.InviterIgnoredNotification.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(_inviterIgnoredNotificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _inviterIgnoredNotificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + 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.EntityId.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.EntityId GetPlayers(int index) { + return result.GetPlayers(index); + } + public Builder SetPlayers(int index, global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.players_[index] = value; + return this; + } + public Builder SetPlayers(int index, global::bnet.protocol.EntityId.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.players_[index] = builderForValue.Build(); + return this; + } + public Builder AddPlayers(global::bnet.protocol.EntityId value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.players_.Add(value); + return this; + } + public Builder AddPlayers(global::bnet.protocol.EntityId.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 InviterIgnoredNotification() { + object.ReferenceEquals(global::bnet.protocol.user_manager.UserManager.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 RemoveRecentPlayers( + pb::IRpcController controller, + global::bnet.protocol.user_manager.RemoveRecentPlayersRequest request, + global::System.Action done); + public abstract void ReportToon( + pb::IRpcController controller, + global::bnet.protocol.user_manager.ReportToonRequest request, + global::System.Action done); + public abstract void BlockToon( + pb::IRpcController controller, + global::bnet.protocol.user_manager.BlockToonRequest request, + global::System.Action done); + public abstract void UnblockToons( + pb::IRpcController controller, + global::bnet.protocol.user_manager.UnblockToonsRequest request, + global::System.Action done); + public abstract void ReportAccount( + pb::IRpcController controller, + global::bnet.protocol.user_manager.ReportAccountRequest request, + global::System.Action done); + public abstract void IgnoreInviter( + pb::IRpcController controller, + global::bnet.protocol.user_manager.IgnoreInviterRequest request, + global::System.Action done); + public abstract void UnignoreInviters( + pb::IRpcController controller, + global::bnet.protocol.user_manager.UnignoreInvitersRequest 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.AddRecentPlayers(controller, (global::bnet.protocol.user_manager.AddRecentPlayersRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 2: + this.RemoveRecentPlayers(controller, (global::bnet.protocol.user_manager.RemoveRecentPlayersRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 3: + this.ReportToon(controller, (global::bnet.protocol.user_manager.ReportToonRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 4: + this.BlockToon(controller, (global::bnet.protocol.user_manager.BlockToonRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 5: + this.UnblockToons(controller, (global::bnet.protocol.user_manager.UnblockToonsRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 6: + this.ReportAccount(controller, (global::bnet.protocol.user_manager.ReportAccountRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 7: + this.IgnoreInviter(controller, (global::bnet.protocol.user_manager.IgnoreInviterRequest) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 8: + this.UnignoreInviters(controller, (global::bnet.protocol.user_manager.UnignoreInvitersRequest) 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.user_manager.RemoveRecentPlayersRequest.DefaultInstance; + case 3: + return global::bnet.protocol.user_manager.ReportToonRequest.DefaultInstance; + case 4: + return global::bnet.protocol.user_manager.BlockToonRequest.DefaultInstance; + case 5: + return global::bnet.protocol.user_manager.UnblockToonsRequest.DefaultInstance; + case 6: + return global::bnet.protocol.user_manager.ReportAccountRequest.DefaultInstance; + case 7: + return global::bnet.protocol.user_manager.IgnoreInviterRequest.DefaultInstance; + case 8: + return global::bnet.protocol.user_manager.UnignoreInvitersRequest.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.RemoveRecentPlayersResponse.DefaultInstance; + case 3: + return global::bnet.protocol.user_manager.ReportToonResponse.DefaultInstance; + case 4: + return global::bnet.protocol.NoData.DefaultInstance; + case 5: + return global::bnet.protocol.user_manager.UnblockToonsResponse.DefaultInstance; + case 6: + return global::bnet.protocol.user_manager.ReportAccountResponse.DefaultInstance; + case 7: + return global::bnet.protocol.NoData.DefaultInstance; + case 8: + return global::bnet.protocol.user_manager.UnignoreInvitersResponse.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 RemoveRecentPlayers( + pb::IRpcController controller, + global::bnet.protocol.user_manager.RemoveRecentPlayersRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[2], + controller, request, global::bnet.protocol.user_manager.RemoveRecentPlayersResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.user_manager.RemoveRecentPlayersResponse.DefaultInstance)); + } + + public override void ReportToon( + pb::IRpcController controller, + global::bnet.protocol.user_manager.ReportToonRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[3], + controller, request, global::bnet.protocol.user_manager.ReportToonResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.user_manager.ReportToonResponse.DefaultInstance)); + } + + public override void BlockToon( + pb::IRpcController controller, + global::bnet.protocol.user_manager.BlockToonRequest 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 UnblockToons( + pb::IRpcController controller, + global::bnet.protocol.user_manager.UnblockToonsRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[5], + controller, request, global::bnet.protocol.user_manager.UnblockToonsResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.user_manager.UnblockToonsResponse.DefaultInstance)); + } + + public override void ReportAccount( + pb::IRpcController controller, + global::bnet.protocol.user_manager.ReportAccountRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[6], + controller, request, global::bnet.protocol.user_manager.ReportAccountResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.user_manager.ReportAccountResponse.DefaultInstance)); + } + + public override void IgnoreInviter( + pb::IRpcController controller, + global::bnet.protocol.user_manager.IgnoreInviterRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[7], + controller, request, global::bnet.protocol.NoData.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.NoData.DefaultInstance)); + } + + public override void UnignoreInviters( + pb::IRpcController controller, + global::bnet.protocol.user_manager.UnignoreInvitersRequest request, + global::System.Action done) { + channel.CallMethod(Descriptor.Methods[8], + controller, request, global::bnet.protocol.user_manager.UnignoreInvitersResponse.DefaultInstance, + pb::RpcUtil.GeneralizeCallback(done, global::bnet.protocol.user_manager.UnignoreInvitersResponse.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 NotifyInviterIgnored( + pb::IRpcController controller, + global::bnet.protocol.user_manager.InviterIgnoredNotification request, + global::System.Action done); + public abstract void NotifyInviterUnignored( + pb::IRpcController controller, + global::bnet.protocol.user_manager.InviterIgnoredNotification 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.NotifyInviterIgnored(controller, (global::bnet.protocol.user_manager.InviterIgnoredNotification) request, + pb::RpcUtil.SpecializeCallback( + done)); + return; + case 1: + this.NotifyInviterUnignored(controller, (global::bnet.protocol.user_manager.InviterIgnoredNotification) 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.InviterIgnoredNotification.DefaultInstance; + case 1: + return global::bnet.protocol.user_manager.InviterIgnoredNotification.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.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 NotifyInviterIgnored( + pb::IRpcController controller, + global::bnet.protocol.user_manager.InviterIgnoredNotification 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 NotifyInviterUnignored( + pb::IRpcController controller, + global::bnet.protocol.user_manager.InviterIgnoredNotification 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/Mooege/.gitignore b/src/Mooege/.gitignore new file mode 100644 index 00000000..31de9bbd --- /dev/null +++ b/src/Mooege/.gitignore @@ -0,0 +1,5 @@ +bin/ +obj/ +/*.ReSharper +/*.pidb +/*.csproj.user diff --git a/src/Mooege/Common/Config/Config.cs b/src/Mooege/Common/Config/Config.cs new file mode 100644 index 00000000..50537eb4 --- /dev/null +++ b/src/Mooege/Common/Config/Config.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 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..4f032f01 --- /dev/null +++ b/src/Mooege/Common/Config/ConfigManager.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 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..ed858eed --- /dev/null +++ b/src/Mooege/Common/Extensions/ArrayExtensions.cs @@ -0,0 +1,91 @@ +/* + * 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; + +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..f8be4279 --- /dev/null +++ b/src/Mooege/Common/Extensions/BigIntegerExtensions.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.Numerics; +using System.Text; + +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; + } + } +} diff --git a/src/Mooege/Common/Extensions/CodedOutputStream.cs b/src/Mooege/Common/Extensions/CodedOutputStream.cs new file mode 100644 index 00000000..01778753 --- /dev/null +++ b/src/Mooege/Common/Extensions/CodedOutputStream.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +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..7f7c22c3 --- /dev/null +++ b/src/Mooege/Common/Extensions/DateTimeExtensions.cs @@ -0,0 +1,35 @@ +/* + * 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 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/source/D3Sharp/Utils/Extensions/EnumerableExtensions.cs b/src/Mooege/Common/Extensions/EnumerableExtensions.cs similarity index 68% rename from source/D3Sharp/Utils/Extensions/EnumerableExtensions.cs rename to src/Mooege/Common/Extensions/EnumerableExtensions.cs index ea687552..2d2ef87d 100644 --- a/source/D3Sharp/Utils/Extensions/EnumerableExtensions.cs +++ b/src/Mooege/Common/Extensions/EnumerableExtensions.cs @@ -1,9 +1,27 @@ +/* + * 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 D3Sharp.Utils.Extensions +namespace Mooege.Common.Extensions { public static class EnumerableExtensions { @@ -15,6 +33,8 @@ public static string HexDump(this IEnumerable collection) sb.Append(value.ToString("X2")); sb.Append(' '); } + if (sb.Length>0) + sb.Remove(sb.Length-1, 1); return sb.ToString(); } @@ -49,7 +69,6 @@ public static string Dump(this IEnumerable collection) output.Append(hexstring); output.Append(' '); output.Append(text); - output.Append(Environment.NewLine); return output.ToString(); } } diff --git a/src/Mooege/Common/Extensions/IMessageExtensions.cs b/src/Mooege/Common/Extensions/IMessageExtensions.cs new file mode 100644 index 00000000..c20e4a01 --- /dev/null +++ b/src/Mooege/Common/Extensions/IMessageExtensions.cs @@ -0,0 +1,220 @@ +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..a57186bd --- /dev/null +++ b/src/Mooege/Common/Extensions/ListExtensions.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +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/Helpers/Concurrency/ConcurrentList.cs b/src/Mooege/Common/Helpers/Concurrency/ConcurrentList.cs new file mode 100644 index 00000000..f4e4df36 --- /dev/null +++ b/src/Mooege/Common/Helpers/Concurrency/ConcurrentList.cs @@ -0,0 +1,265 @@ +/* + * 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 + */ + +// 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..bf1e6f8a --- /dev/null +++ b/src/Mooege/Common/Helpers/Hash/StringHashHelper.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.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..a661a8bc --- /dev/null +++ b/src/Mooege/Common/Helpers/IO/FileHelpers.cs @@ -0,0 +1,58 @@ +/* + * 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.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..0f9f35c8 --- /dev/null +++ b/src/Mooege/Common/Helpers/Math/FastRandom.cs @@ -0,0 +1,415 @@ +/* + * 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 + */ + +// Credits goes to SharpNEAT project: http://sharpneat.sourceforge.net/ (GPL v2/LGPL). + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.Contracts; + +// 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>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>19))^(t^(t>>8)); + + buffer[i++] = (byte)w; + if(i>8); + if(i>16); + if(i>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..34af70c4 --- /dev/null +++ b/src/Mooege/Common/Helpers/Math/RandomHelper.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; +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/LogConfig.cs b/src/Mooege/Common/Logging/LogConfig.cs new file mode 100644 index 00000000..3f1881e2 --- /dev/null +++ b/src/Mooege/Common/Logging/LogConfig.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 + */ + +namespace Mooege.Common.Logging +{ + public sealed class LogConfig : Config.Config + { + public string LoggingRoot { get { return this.GetString("Root", @"logs"); } set { this.Set("Root", value); } } + + public LogTargetConfig[] Targets = new[] { new LogTargetConfig("ConsoleLog"), new LogTargetConfig("ServerLog"), new LogTargetConfig("PacketLog") }; + + private static readonly LogConfig _instance = new LogConfig(); + public static LogConfig Instance { get { return _instance; } } + private LogConfig() : base("Logging") { } + } + + public class LogTargetConfig : Config.Config + { + public bool Enabled { get { return this.GetBoolean("Enabled", true); } set { this.Set("Enabled", value); } } + public string Target { get { return this.GetString("Target", "Console"); } set { this.GetString("Target", value); } } + public bool IncludeTimeStamps { get { return this.GetBoolean("IncludeTimeStamps", false); } set { this.Set("IncludeTimeStamps", value); } } + public string FileName { get { return this.GetString("FileName", ""); } set { this.GetString("FileName", value); } } + public Logger.Level MinimumLevel { get { return (Logger.Level)( this.GetInt("MinimumLevel", (int)Logger.Level.Info, true)); } set { this.Set("MinimumLevel", (int)value ); } } + public Logger.Level MaximumLevel { get { return (Logger.Level)(this.GetInt("MaximumLevel", (int)Logger.Level.Fatal, true)); } set { this.Set("MaximumLevel", (int)value); } } + public bool ResetOnStartup { get { return this.GetBoolean("ResetOnStartup", false); } set { this.Set("ResetOnStartup", value); } } + + public LogTargetConfig(string loggerName) : base(loggerName) { } + } +} diff --git a/source/D3Sharp/Utils/TinyLogger.cs b/src/Mooege/Common/Logging/TinyLogger.cs similarity index 51% rename from source/D3Sharp/Utils/TinyLogger.cs rename to src/Mooege/Common/Logging/TinyLogger.cs index 2e8dc294..42cc273f 100644 --- a/source/D3Sharp/Utils/TinyLogger.cs +++ b/src/Mooege/Common/Logging/TinyLogger.cs @@ -1,32 +1,40 @@ -using System; +/* + * 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.Diagnostics; using System.Globalization; using System.IO; using System.Linq; -using System.Text; -using D3Sharp.Utils.win32; +using Mooege.Common.Extensions; +using Mooege.Net.GS.Message; -namespace D3Sharp.Utils +namespace Mooege.Common.Logging { - 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 readonly static List Targets = new List(); internal static readonly Dictionary Loggers = new Dictionary(); - public static void AttachLogTarget(Target target) + public static void AttachLogTarget(LogTarget target) { Targets.Add(target); } @@ -49,23 +57,23 @@ public static Logger CreateLogger(string name) internal static class LogRouter { - public static void RouteMessage(Level level, string logger, string message) + public static void RouteMessage(Logger.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)) + foreach (var target in LogManager.Targets.Where(target => level >= target.MinimumLevel && level <= target.MaximumLevel)) { target.LogMessage(level, logger, message); } } - public static void RouteException(Level level, string logger, string message, Exception exception) + public static void RouteException(Logger.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)) + foreach (var target in LogManager.Targets.Where(target => level >= target.MinimumLevel && level <= target.MaximumLevel)) { target.LogException(level, logger, message, exception); } @@ -109,6 +117,14 @@ private void LogException(Level level, string message, object[] args, Exception public void Fatal(string message) { Log(Level.Fatal, message, null); } public void Fatal(string message, params object[] args) { Log(Level.Fatal, message, args); } + // moonet packet loggers + public void LogIncoming(Google.ProtocolBuffers.IMessage msg) { Log(Level.Dump, "[I] " + msg.AsText(), null); } + public void LogOutgoing(Google.ProtocolBuffers.IMessage msg) { Log(Level.Dump, "[O] " + msg.AsText(), null); } + + // ingame packet loggers + public void LogIncoming(GameMessage msg) { Log(Level.Dump, "[I] " + msg.AsText(), null); } + public void LogOutgoing(GameMessage msg) { Log(Level.Dump, "[O] " + msg.AsText(), null); } + 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); } @@ -126,39 +142,76 @@ private void LogException(Level level, string message, object[] 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 enum Level + { + Dump, // used for logging packets. + Trace, + Debug, + Info, + Warn, + Error, + Fatal + } } - public class Target + public class LogTarget { - 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 Logger.Level MinimumLevel { get; protected set; } + public Logger.Level MaximumLevel { get; protected set; } + public bool IncludeTimeStamps { get; protected set; } + + public virtual void LogMessage(Logger.Level level, string logger, string message) { throw new NotSupportedException(); } + public virtual void LogException(Logger.Level level, string logger, string message, Exception exception) { throw new NotSupportedException(); } } - public class FileTarget : Target, IDisposable + public class FileTarget : LogTarget, IDisposable { + private readonly string _fileName; private readonly string _filePath; private FileStream _fileStream; private StreamWriter _logStream; - public FileTarget(Level minLevel, string filePath) + public FileTarget(string fileName, Logger.Level minLevel, Logger.Level maxLevel, bool includeTimeStamps, bool reset = false) { - MinimumLevel = minLevel; - _filePath = filePath; - this._fileStream = new FileStream(_filePath, FileMode.Append, FileAccess.Write); - this._logStream = new StreamWriter(this._fileStream); - this._logStream.AutoFlush = true; + this._fileName = fileName; + this._filePath = string.Format("{0}/{1}", LogConfig.Instance.LoggingRoot, _fileName); + this.MinimumLevel = minLevel; + this.MaximumLevel = maxLevel; + this.IncludeTimeStamps = includeTimeStamps; + + if (!Directory.Exists(LogConfig.Instance.LoggingRoot)) // create logging directory if it does not exist. + Directory.CreateDirectory(LogConfig.Instance.LoggingRoot); + + this._fileStream = new FileStream(_filePath, reset ? FileMode.Create : FileMode.Append, FileAccess.Write, FileShare.Read); + this._logStream = new StreamWriter(this._fileStream) {AutoFlush = true}; } - public override void LogMessage(Level level, string logger, string message) + public override void LogMessage(Logger.Level level, string logger, string message) { - this._logStream.WriteLine(string.Format("[{0}] [{1}]: {2}", level.ToString().PadLeft(5), logger, 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) + this._logStream.WriteLine(string.Format("{0}[{1}] [{2}]: {3}", timeStamp, level.ToString().PadLeft(5), logger, message)); + } } - public override void LogException(Level level, string logger, string message, Exception exception) + public override void LogException(Logger.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)); + lock (this) + { + var timeStamp = this.IncludeTimeStamps + ? "[" + DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss.fff") + "] " + : ""; + + if (!this._disposed) + this._logStream.WriteLine(string.Format("{0}[{1}] [{2}]: {3} - [Exception] {4}", timeStamp, level.ToString().PadLeft(5), logger, message, exception)); + } } #region de-ctor @@ -195,52 +248,46 @@ private void Dispose(bool disposing) #endregion } - public class ConsoleTarget : Target + public class ConsoleTarget : LogTarget { - // Win32 API constants. - private const int StdOutputHandle = -11; - private const int CodePage = 437; - - public ConsoleTarget(Level minLevel, bool initConsole = false) + public ConsoleTarget(Logger.Level minLevel, Logger.Level maxLevel, bool includeTimeStamps) { MinimumLevel = minLevel; - // if (initConsole) InitConsole(); TODO: Make sure only get compiled in win32 + MaximumLevel = maxLevel; + this.IncludeTimeStamps = includeTimeStamps; } - - // TODO: Make sure only get compiled in win32 - /*private static void InitConsole() // binds a new console window to a windowed application. + + public override void LogMessage(Logger.Level level, string logger, string message) { - 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. - }*/ + var timeStamp = this.IncludeTimeStamps + ? "[" + DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss.fff") + "] " + : ""; - 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)); + Console.WriteLine(string.Format("{0}[{1}] [{2}]: {3}", timeStamp, level.ToString().PadLeft(5), logger, message)); } - public override void LogException(Level level, string logger, string message, Exception exception) + 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") + "] " + : ""; + SetForeGroundColor(level); - Console.WriteLine(string.Format("[{0}] [{1}]: {2} - [Exception] {3}", level.ToString().PadLeft(5), logger, message, exception)); + Console.WriteLine(string.Format("{0}[{1}] [{2}]: {3} - [Exception] {4}", timeStamp, level.ToString().PadLeft(5), logger, message, exception)); } - private static void SetForeGroundColor(Level level) + private static void SetForeGroundColor(Logger.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; + case Logger.Level.Dump: Console.ForegroundColor = ConsoleColor.DarkGray; break; + case Logger.Level.Trace: 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/MPQ/Asset.cs b/src/Mooege/Common/MPQ/Asset.cs new file mode 100644 index 00000000..be555b18 --- /dev/null +++ b/src/Mooege/Common/MPQ/Asset.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 Mooege.Core.GS.Common.Types.SNO; + +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; + + public FileFormat Data + { + get + { + if (_data == null && SourceAvailable && Parser != null) + { + RunParser(); + } + + 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..425c7919 --- /dev/null +++ b/src/Mooege/Common/MPQ/DBAsset.cs @@ -0,0 +1,46 @@ +/* + * 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.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..67d6b26f --- /dev/null +++ b/src/Mooege/Common/MPQ/Data.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.Concurrent; +using System.Collections.Generic; +using System.Reflection; +using System.Threading.Tasks; +using CrystalMpq; +using Gibbed.IO; +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 }; + + public Data() + : base(VersionInfo.MPQ.RequiredPatchVersion, new List { "CoreData.mpq", "ClientData.mpq" }, "/base/d3-update-base-(?.*?).mpq") + { } + + public void Init() + { + 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.LoadCatalog("TOC.dat", true, PatchExceptions.ToList()); // used for reading assets patched to zero bytes and removed from mainCatalog file. + 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. + 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.Info("Found a total of {0} assets from {1} catalog and postponed loading because lazy loading is activated.", assetsCount, fileName); + else + Logger.Info("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.Info("Found a total of {0} assets from DB catalog and postponed loading because lazy loading is activated.", assetCount); + else + Logger.Info("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 + asset.RunParser(); + } + } + + /// + /// 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; + + 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..4e6715a1 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileExtensions.cs @@ -0,0 +1,36 @@ +/* + * 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 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", + }; + } +} diff --git a/src/Mooege/Common/MPQ/FileFormat.cs b/src/Mooege/Common/MPQ/FileFormat.cs new file mode 100644 index 00000000..ca99dab6 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormat.cs @@ -0,0 +1,23 @@ +/* + * 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 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..32c5ad28 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormatAttribute.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; +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..01803c82 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Act.cs @@ -0,0 +1,116 @@ +/* + * 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 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..97e2fe68 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Actor.cs @@ -0,0 +1,192 @@ +/* + * 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 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..d60d974f --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Adventure.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 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..67e7722a --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Anim.cs @@ -0,0 +1,274 @@ +/* + * 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 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..6d492603 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/AnimSet.cs @@ -0,0 +1,178 @@ +/* + * 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 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..71d3402c --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/BossEncounter.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 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..85c387bd --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Condition.cs @@ -0,0 +1,227 @@ +/* + * 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 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 I10 { get; private set; } + public int I11 { 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(); + this.I6 = stream.ReadValueS32(); + this.I7 = stream.ReadValueS32(); + stream.Position += 4; + this.I8 = stream.ReadValueS32(); + this.I9 = stream.ReadValueS32(); + this.I10 = stream.ReadValueS32(); + this.I11 = 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..183ebeed --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Conversation.cs @@ -0,0 +1,260 @@ +/* + * 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 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..ae3792d0 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/ConversationList.cs @@ -0,0 +1,86 @@ +/* + * 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 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..b870ade9 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/EffectGroup.cs @@ -0,0 +1,69 @@ +/* + * 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 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..a019d7e9 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Encounter.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.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..ae77096d --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/GameBalance.cs @@ -0,0 +1,1785 @@ +/* + * 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 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; + +namespace Mooege.Common.MPQ.FileFormats +{ + // this file should be fixed with our naming-conventions. /raist + + [FileFormat(SNOGroup.GameBalance)] + 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, + PlayerTalisman = 14, + Merchant = 20, + PetRightHand = 23, + PetLeftHand = 24, + PetSpecial = 25, + PetLeftFinger = 28, + PetRightFinger = 27, + PetNeck = 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 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 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.SNOBaseItem = stream.ReadValueS32(); //320 + this.SNOSet = stream.ReadValueS32(); //324 + this.SNOComponentTreasureClass = stream.ReadValueS32(); //328 + this.SNOComponentTreasureClassMagic = stream.ReadValueS32(); //332 + this.SNOComponentTreasureClassRare = stream.ReadValueS32(); //336 + this.SNORareNamePrefixStringList = stream.ReadValueS32(); //340 + this.SNORareNameSuffixStringList = stream.ReadValueS32(); //344 + this.I15 = new int[4]; //348 + for (int i = 0; i < 4; i++) + this.I15[i] = stream.ReadValueS32(); + stream.Position += 88; + this.WeaponDamageMin = stream.ReadValueF32(); //452 + this.WeaponDamageDelta = stream.ReadValueF32(); //456 + stream.Position += 84; + this.ArmorValue = stream.ReadValueF32(); //544 + this.F3 = stream.ReadValueF32(); //548 + stream.Position += 168; + this.AttacksPerSecond = stream.ReadValueF32(); //720 + stream.Position += 84; + this.F4 = stream.ReadValueF32(); //808 + this.F5 = stream.ReadValueF32(); //812 + stream.Position += 100; + this.SNOSkill0 = stream.ReadValueS32(); //916 + this.I11 = stream.ReadValueS32(); //920 + this.SNOSkill1 = stream.ReadValueS32(); //924 + this.I12 = stream.ReadValueS32(); //928 + this.SNOSkill2 = stream.ReadValueS32(); //932 + this.I13 = stream.ReadValueS32(); //936 + this.SNOSkill3 = stream.ReadValueS32(); //940 + this.I14 = stream.ReadValueS32(); //944 + 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(); //1376 + this.RecipeToGrant = new int[10]; //1380 + for (int i = 0; i < 10; i++) + this.RecipeToGrant[i] = stream.ReadValueS32(); + this.EnhancementToGrant = stream.ReadValueS32(); //1420 + this.LegendaryAffixFamily = new int[6]; + for (int i = 0; i < 6; i++) + this.LegendaryAffixFamily[i] = stream.ReadValueS32(); //1424 + this.MaxAffixLevel = new int[6]; + for (int i = 0; i < 6; i++) + this.MaxAffixLevel[i] = stream.ReadValueS32(); //1446 + this.Gem = (GemType)stream.ReadValueS32(); //1472 + this.I16 = stream.ReadValueS32(); //1476 + this.I17 = (Alpha)stream.ReadValueS32(); //1780 + 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 += 32; + } + } + + 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 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 ResourceMax { get; private set; } + public float ResourceFactorLevel { get; private set; } + public float ResourceRegenPerSecond { 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 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 Attack { get; private set; } + public float Precision { get; private set; } + public float Vitality { get; private set; } + public float Defense { 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 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.F0 = stream.ReadValueF32(); //308 + this.I1 = stream.ReadValueS32(); //312 + stream.Position += 16; + this.HitpointsMax = stream.ReadValueF32(); //332 + this.HitpointsFactorLevel = stream.ReadValueF32(); //336 + stream.Position += 8; + this.F3 = stream.ReadValueF32(); //348 + this.ResourceMax = stream.ReadValueF32(); //352 + this.ResourceFactorLevel = stream.ReadValueF32(); //356 + this.ResourceRegenPerSecond = stream.ReadValueF32(); //360 + stream.Position += 4; + this.F7 = stream.ReadValueF32(); //368 + this.F8 = stream.ReadValueF32(); //372 + this.F9 = stream.ReadValueF32(); //376 + stream.Position += 24; + this.F10 = stream.ReadValueF32(); //404 + stream.Position += 72; + this.F11 = stream.ReadValueF32(); //480 + this.CritPercentCap = stream.ReadValueF32(); //484 + this.F13 = stream.ReadValueF32(); //488 + stream.Position += 4; + this.F14 = stream.ReadValueF32(); //496 + stream.Position += 32; + this.WalkingRate = stream.ReadValueF32(); //532 + this.RunningRate = stream.ReadValueF32(); //536 + stream.Position += 4; + this.F17 = stream.ReadValueF32(); //544 + stream.Position += 32; + this.F18 = stream.ReadValueF32(); //580 + this.F19 = stream.ReadValueF32(); //584 + this.F20 = stream.ReadValueF32(); //588 + this.F21 = stream.ReadValueF32(); //592 + this.F22 = stream.ReadValueF32(); //596 + this.F23 = stream.ReadValueF32(); //600 + stream.Position += 4; + this.F24 = stream.ReadValueF32(); //608 + this.F25 = stream.ReadValueF32(); //612 + stream.Position += 60; + this.F26 = stream.ReadValueF32(); //676 + stream.Position += 8; + this.F27 = stream.ReadValueF32(); //688 + this.F28 = stream.ReadValueF32(); //692 + this.F29 = stream.ReadValueF32(); //696 + this.F30 = stream.ReadValueF32(); //700 + stream.Position += 12; + this.F31 = stream.ReadValueF32(); //716 + this.F32 = stream.ReadValueF32(); //720 + this.F33 = stream.ReadValueF32(); //724 + stream.Position += 40; + this.F34 = stream.ReadValueF32(); //768 + stream.Position += 24; + this.Attack = stream.ReadValueF32(); //796 + this.Precision = stream.ReadValueF32(); //800 + this.Vitality = stream.ReadValueF32(); //804 + this.Defense = stream.ReadValueF32(); //808 + stream.Position += 40; + this.GetHitMaxBase = stream.ReadValueF32(); //852 + this.GetHitMaxPerLevel = stream.ReadValueF32(); //856 + this.GetHitRecoveryBase = stream.ReadValueF32(); //860 + this.GetHitRecoveryPerLevel = stream.ReadValueF32(); //864 + } + + public enum Resource : int + { + 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 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 int ExclusionCategory { get; private set; } + public int[] I7 { get; private set; } + public int[] ItemGroup { 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.AffixType1 = (AffixType1)stream.ReadValueS32(); //288 + this.I6 = stream.ReadValueS32(); //292 + this.SNORareNamePrefixStringList = stream.ReadValueS32(); //296 + this.SNORareNameSuffixStringList = stream.ReadValueS32(); //300 + this.AffixFamily0 = stream.ReadValueS32(); //304 + this.AffixFamily1 = stream.ReadValueS32(); //308 + this.ExclusionCategory = stream.ReadValueS32(); //312 + this.I7 = new int[6]; //316 + for (int i = 0; i < 6; i++) + this.I7[i] = stream.ReadValueS32(); + this.ItemGroup = new int[6]; //340 + for (int i = 0; i < 6; i++) + this.ItemGroup[i] = stream.ReadValueS32(); + this.QualityMask = (QualityMask)stream.ReadValueS32(); //364 + this.AffixType2 = (AffixType2)stream.ReadValueS32(); //368 + this.AssociatedAffix = stream.ReadValueS32(); //372 + this.AttributeSpecifier = new AttributeSpecifier[4]; //376 + 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 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 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(); + stream.Position += 480; + this.F0 = stream.ReadValueF32(); //752 + this.F1 = stream.ReadValueF32(); //756 + this.F2 = stream.ReadValueF32(); //760 + this.F3 = stream.ReadValueF32(); //764 + stream.Position += 8; + this.F4 = stream.ReadValueF32(); //776 + this.F5 = stream.ReadValueF32(); //780 + this.F6 = stream.ReadValueF32(); //784 + stream.Position += 36; + } + + } + + 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); + } + } + +} diff --git a/src/Mooege/Common/MPQ/FileFormats/Globals.cs b/src/Mooege/Common/MPQ/FileFormats/Globals.cs new file mode 100644 index 00000000..d74d4983 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Globals.cs @@ -0,0 +1,349 @@ +/* + * 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 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 DifficultyTuningParams[] TuningParams { get; private set; } //len 4 + public float F0 { get; private set; } + public float F1 { get; private set; } + public float F2 { get; private set; } + public int I0 { get; private set; } + public Dictionary ActorGroup { get; private set; } + public int I1 { get; private set; } + public Dictionary StartLocationNames { get; private set; } + public List ScriptGlobalVars { 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 F33 { get; private set; } + public float F34 { get; private set; } + public RGBAColor[] Colors { 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 float F8 { get; private set; } + public float F9 { get; private set; } + public int I6 { 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 int I7 { get; private set; } + public int I8 { 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 int I9 { get; private set; } + public int[] I10 { get; private set; } //len 4 + public BannerParams BannerParams { 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 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 Globals(MpqFile file) + { + var stream = file.Open(); + this.Header = new Header(stream); + this.TuningParams = new DifficultyTuningParams[4]; + for (int i = 0; i < 4; i++) + this.TuningParams[i] = new DifficultyTuningParams(stream); + this.F0 = stream.ReadValueF32(); //140 + this.F1 = stream.ReadValueF32(); //144 + this.F2 = stream.ReadValueF32(); //148 + this.I0 = stream.ReadValueS32(); //152 + stream.Position += 12; + + this.ActorGroup = new Dictionary(); + foreach(var group in stream.ReadSerializedData()) //166 + this.ActorGroup.Add(group.UHash, group); + + + this.I1 = stream.ReadValueS32(); //176 + stream.Position += 12; + + this.StartLocationNames = new Dictionary(); + foreach (var startLocation in stream.ReadSerializedData()) //168 + StartLocationNames.Add(startLocation.I0, startLocation); + + stream.Position += 8; + this.ScriptGlobalVars = stream.ReadSerializedData(); //208 + this.F3 = stream.ReadValueF32(); //216 + this.F4 = stream.ReadValueF32(); //220 + this.F5 = stream.ReadValueF32(); //224 + this.F6 = stream.ReadValueF32(); //228 + this.F7 = stream.ReadValueF32(); //232 + this.F33 = stream.ReadValueF32(); //236 + this.F34 = stream.ReadValueF32(); //240 + Colors = new RGBAColor[400]; //244 + for (int i = 0; i < 400; i++) + Colors[i] = new RGBAColor(stream); + this.I2 = stream.ReadValueS32(); //1844 + this.I3 = stream.ReadValueS32(); //1848 + this.I4 = stream.ReadValueS32(); //1852 + this.I5 = stream.ReadValueS32(); //1856 + this.F8 = stream.ReadValueF32(); //1860 + this.F9 = stream.ReadValueF32(); //1864 + this.I6 = stream.ReadValueS32(); //1868 + this.F10 = stream.ReadValueF32(); //1872 + this.F11 = stream.ReadValueF32(); //1876 + this.F12 = stream.ReadValueF32(); //1880 + this.F13 = stream.ReadValueF32(); //1884 + this.F14 = stream.ReadValueF32(); //1888 + this.F15 = stream.ReadValueF32(); //1892 + this.F16 = stream.ReadValueF32(); //1896 + this.I7 = stream.ReadValueS32(); //1900 + this.I8 = stream.ReadValueS32(); //1904 + this.F17 = stream.ReadValueF32(); //1908 + this.F18 = stream.ReadValueF32(); //1912 + this.F19 = stream.ReadValueF32(); //1916 + this.F20 = stream.ReadValueF32(); //1920 + this.F21 = stream.ReadValueF32(); //1924 + this.I9 = stream.ReadValueS32(); //1928 + this.I10 = new int[4]; //1932 + for (int i = 0; i < 4; i++) + this.I10[i] = stream.ReadValueS32(); + stream.Position += 4; + this.BannerParams = new BannerParams(stream); //1952 + this.I11 = stream.ReadValueS32(); //2184 + this.I12 = stream.ReadValueS32(); //2188 + this.I13 = stream.ReadValueS32(); //2192 + this.I14 = stream.ReadValueS32(); //2196 + this.I15 = stream.ReadValueS32(); //2200 + this.F22 = stream.ReadValueF32(); //2204 + this.F23 = stream.ReadValueF32(); //2208 + this.F24 = stream.ReadValueF32(); //2212 + this.F25 = stream.ReadValueF32(); //2216 + this.F26 = stream.ReadValueF32(); //2220 + this.F27 = stream.ReadValueF32(); //2224 + this.F28 = stream.ReadValueF32(); //2228 + this.F29 = stream.ReadValueF32(); //2232 + this.F30 = stream.ReadValueF32(); //2236 + this.F31 = stream.ReadValueF32(); //2240 + this.F32 = stream.ReadValueF32(); //2244 + 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 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(); + } + } + + 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 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..5df15edd --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/LevelArea.cs @@ -0,0 +1,187 @@ +/* + * 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 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..1b429ce1 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Lore.cs @@ -0,0 +1,57 @@ +/* + * 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 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..92cf9efa --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/MarkerSet.cs @@ -0,0 +1,168 @@ +/* + * 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 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.Misc; +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..d91cc161 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Monster.cs @@ -0,0 +1,357 @@ +/* + * 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 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[138]; + for (int i = 0; i < 138; i++) + { + Floats[i] = stream.ReadValueF32(); + } + F0 = stream.ReadValueF32(); + F1 = stream.ReadValueF32(); + F2 = stream.ReadValueF32(); + F3 = stream.ReadValueF32(); + F4 = stream.ReadValueF32(); + F5 = stream.ReadValueF32(); + + // 660 + this.I4 = stream.ReadValueS32(); + this.HealthDropinfo0 = new HealthDropInfo(stream); + this.HealthDropinfo1 = new HealthDropInfo(stream); + this.HealthDropinfo2 = new HealthDropInfo(stream); + this.HealthDropinfo3 = new HealthDropInfo(stream); + // 712 + 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); + } + // 908 + this.SNOTreasureClassFirstKill = stream.ReadValueS32(); + this.SNOTreasureClass = stream.ReadValueS32(); + this.SNOTreasureClassRare = stream.ReadValueS32(); + this.SNOTreasureClassChampion = stream.ReadValueS32(); + this.SNOTreasureClassChampionLight = stream.ReadValueS32(); + // 928 + this.F6 = stream.ReadValueF32(); + this.F7 = stream.ReadValueF32(); + this.F8 = stream.ReadValueF32(); + this.F9 = stream.ReadValueF32(); + I5 = stream.ReadValueS32(); + F10 = stream.ReadValueF32(); + I6 = stream.ReadValueS32(); + I7 = stream.ReadValueS32(); + //960 + this.SNOInventory = stream.ReadValueS32(); + this.SNOSecondaryInventory = stream.ReadValueS32(); + this.SNOLore = stream.ReadValueS32(); + AIBehavior = new int[6]; + for (int i = 0; i < 6; i++) + { + this.AIBehavior[i] = stream.ReadValueS32(); + } + 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(); + } + // 1092 + this.I8 = stream.ReadValueS32(); + this.I9 = stream.ReadValueS32(); + this.I10 = stream.ReadValueS32(); + this.PowerType = (MonsterPowerType)stream.ReadValueS32(); + + stream.Position += (7 * 4); + // 1136 + this.TagMap = stream.ReadSerializedItem(); + stream.Position += (2 * 4); + this.I11 = stream.ReadValueS32(); + stream.Position += (3 * 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 + { + 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..e70db410 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Observer.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 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..84bfc43a --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/PhysMesh.cs @@ -0,0 +1,177 @@ +/* + * 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 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..70400c2a --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Power.cs @@ -0,0 +1,139 @@ +/* + * 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 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..afaa109d --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Quest.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.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 Unknown1 { 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(); + Unknown1 = 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..25d90ac2 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/QuestRange.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 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..d458144f --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Recipe.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 CrystalMpq; +using Gibbed.IO; +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..51673e8d --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Scene.cs @@ -0,0 +1,262 @@ +/* + * 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 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 > 128 || SquaresCountY > 128) + { + WalkGrid = new byte[256, 256]; + } + + + // Loop thru each NavmeshSquare in the array, and fills the grid + for (int i = 0; i < NavMeshSquareCount; i++) + { + WalkGrid[i % SquaresCountY, 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 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..a30ce271 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/SceneGroup.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.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..1c7d4db4 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/SkillKit.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.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 ReqLevel { get; private set; } + public int I2 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.SNOPower = stream.ReadValueS32(); + this.Category = (ActiveSkillCategory)stream.ReadValueS32(); + this.ReqLevel = stream.ReadValueS32(); + this.I2 = 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..80912ef8 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/TreasureClass.cs @@ -0,0 +1,114 @@ +/* + * 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 CrystalMpq; +using Gibbed.IO; +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..2a40e1c6 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Tutorial.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 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 I2 { 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.I2 = 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..3323d7f2 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/Types/Common.cs @@ -0,0 +1,312 @@ +/* + * 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 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..d305f504 --- /dev/null +++ b/src/Mooege/Common/MPQ/FileFormats/World.cs @@ -0,0 +1,493 @@ +/* + * 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 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; } + public SceneParams SceneParams { get; private set; } + public List MarkerSets = new List(); + public Environment Environment { get; private set; } + public LabelRuleSet LabelRuleSet { get; private set; } + public SceneClusterSet SceneClusterSet { get; private set; } + 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 World(MpqFile file) + { + var stream = file.Open(); + + this.Header = new Header(stream); + + this.IsGenerated = (stream.ReadValueS32() != 0); + 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 + { + public List SceneChunks = new List(); + public int ChunkCount { get; private set; } + + public void Read(MpqFileStream stream) + { + this.SceneChunks = stream.ReadSerializedData(); + this.ChunkCount = stream.ReadValueS32(); + stream.Position += (3 * 4); + } + } + + public class SceneChunk : ISerializableData + { + public SNOHandle SNOHandle { get; private set; } + public PRTransform PRTransform { get; private set; } + public SceneSpecification SceneSpecification { get; private set; } + + 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 class TileInfo : ISerializableData + { + [PersistentProperty("Int0")] + public int Int0 { get; private set; } + + [PersistentProperty("Int1")] + public int Int1 { get; private set; } + + [PersistentProperty("SNOScene")] + public int SNOScene { get; private set; } + + [PersistentProperty("Int2")] + public int Int2 { get; private set; } + + [PersistentProperty("TagMap")] + public TagMap TagMap { get; private set; } + + [PersistentProperty("CustomTileInfo")] + public CustomTileInfo CustomTileInfo { get; private set; } + + public void Read(MpqFileStream stream) + { + Int0 = stream.ReadValueS32(); + Int1 = stream.ReadValueS32(); + SNOScene = stream.ReadValueS32(); + Int2 = stream.ReadValueS32(); + this.TagMap = stream.ReadSerializedItem(); + + stream.Position += (2 * 4); + CustomTileInfo = new CustomTileInfo(stream); + } + } + + public class DRLGCommand : ISerializableData + { + [PersistentProperty("Name")] + public string Name { get; private set; } + + [PersistentProperty("I0")] + public int Int0 { get; private set; } + + [PersistentProperty("TagMap")] + public TagMap TagMap { get; private set; } + + public void Read(MpqFileStream stream) + { + this.Name = stream.ReadString(128, true); + Int0 = 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 + { + public int ClusterCount { get; private set; } + public List SceneClusters = new List(); + + public SceneClusterSet(MpqFileStream stream) + { + this.ClusterCount = stream.ReadValueS32(); + stream.Position += (4 * 3); + this.SceneClusters = stream.ReadSerializedData(); + } + } + + public class SceneCluster : ISerializableData + { + public string Name { get; private set; } + public int ClusterId { get; private set; } + public int GroupCount { get; private set; } + public List SubSceneGroups = new List(); + public SubSceneGroup Default { get; private set; } + + 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 + { + public int I0 { get; private set; } + public int SubSceneCount { get; private set; } + public List Entries = new List(); + + 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 + { + public int SNOScene { get; private set; } + public int Probability { get; private set; } + public int LabelCount { get; private set; } + public List Labels = new List(); + + 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 + { + public int GBId { get; private set; } + public int I0 { get; private set; } + + public void Read(MpqFileStream stream) + { + GBId = stream.ReadValueS32(); + I0 = stream.ReadValueS32(); + } + } + + #endregion + + #region others + + public class LabelRuleSet + { + public int Rulecount { get; private set; } + public List LabelRules = new List(); + + public LabelRuleSet(MpqFileStream stream) + { + Rulecount = stream.ReadValueS32(); + stream.Position += (3 * 4); + this.LabelRules = stream.ReadSerializedData(); + } + } + + public class LabelRule : ISerializableData + { + public string Name { get; private set; } + public LabelCondition LabelCondition { get; private set; } + public int Int0 { get; private set; } + public int LabelCount { get; private set; } + public List Entries = new List(); + + 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 + { + public int GBIdLabel { get; private set; } + public int Int0 { get; private set; } + public float Float0 { get; private set; } + public int Int1 { get; private set; } + public int Int2 { get; private set; } + + public void Read(MpqFileStream stream) + { + this.GBIdLabel = stream.ReadValueS32(); + Int0 = stream.ReadValueS32(); + Float0 = stream.ReadValueF32(); + Int1 = stream.ReadValueS32(); + Int2 = stream.ReadValueS32(); + } + } + + public class LabelCondition + { + public DT_ENUM0 Enum0 { get; private set; } + public int Int0 { get; private set; } + public int[] Int1 { get; private set; } + + 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 +} \ 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..8fb482df --- /dev/null +++ b/src/Mooege/Common/MPQ/MPQAsset.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.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..f7b7f994 --- /dev/null +++ b/src/Mooege/Common/MPQ/MPQPatchChain.cs @@ -0,0 +1,113 @@ +/* + * 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 System.Text.RegularExpressions; +using CrystalMpq; +using CrystalMpq.Utility; +using Mooege.Common.Logging; +using Wintellect.PowerCollections; + +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("Added 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 file: {0}.", System.IO.Path.GetFileName(mpq)); + this.FileSystem.Archives.Add(new MpqArchive(mpq, 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..f8fbea97 --- /dev/null +++ b/src/Mooege/Common/MPQ/MPQStorage.cs @@ -0,0 +1,62 @@ +/* + * 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.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..39d0cb2c --- /dev/null +++ b/src/Mooege/Common/MPQ/SerializableData.cs @@ -0,0 +1,195 @@ +/* + * 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 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/Config.cs b/src/Mooege/Common/Storage/Config.cs new file mode 100644 index 00000000..53110fca --- /dev/null +++ b/src/Mooege/Common/Storage/Config.cs @@ -0,0 +1,32 @@ +/* + * 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 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..0498f646 --- /dev/null +++ b/src/Mooege/Common/Storage/DBManager.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 System.Data.SQLite; +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 Connection { get; private set; } + public static SQLiteConnection MPQMirror { get; private set; } + + public static readonly Logger Logger = LogManager.CreateLogger(); + + static DBManager() + { + Connect(); + } + + private static void Connect() + { + try + { + Connection = new SQLiteConnection(String.Format("Data Source={0}/{1}/account.db", FileHelpers.AssemblyRoot, Config.Instance.Root)); + Connection.Open(); + + MPQMirror = new SQLiteConnection(String.Format("Data Source={0}/{1}/mpqdata.db", FileHelpers.AssemblyRoot, Config.Instance.Root)); + MPQMirror.Open(); + } + catch (Exception e) + { + Logger.FatalException(e, "Connect()"); + } + } + } +} diff --git a/src/Mooege/Common/Storage/PersistenceManager.cs b/src/Mooege/Common/Storage/PersistenceManager.cs new file mode 100644 index 00000000..449137f4 --- /dev/null +++ b/src/Mooege/Common/Storage/PersistenceManager.cs @@ -0,0 +1,621 @@ +/* + * 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.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..b73cf7c7 --- /dev/null +++ b/src/Mooege/Common/Versions/VersionInfo.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.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 = "0.7931.*"; + } + + /// + /// MooNet versions info. + /// + public static class MooNet + { + /// + /// Required client version. + /// + public const int RequiredClientVersion = 7931; + + public static Dictionary ClientVersionMaps = new Dictionary + { + {"Aurora 04768e5dce_public", 7931}, + {"Aurora 0ee3b2e0e2_public", 7841}, + {"Aurora b4367eba86_public", 7728} + }; + + /// + /// Auth module's hash map for client platforms. + /// + public static Dictionary AuthModuleHashMap = new Dictionary() + { + { MooNetClient.ClientPlatform.Win,"8F52906A2C85B416A595702251570F96D3522F39237603115F2F1AB24962043C".ToByteArray() }, + { MooNetClient.ClientPlatform.Mac,"63BC118937E6EA2FAA7B7192676DAEB1B7CA87A9C24ED9F5ACD60E630B4DD7A4".ToByteArray() } + }; + + public static class Achievements + { + /// + /// AchievementFile hash. + /// + public static string AchievementFileHash = "ef29e59b9394e7c6f694afbb92b70a74c4fd4c96961a8ec490e770371b72e6ab"; + + /// + /// AchievementFile filename. + /// + public static string AchievementFilename = AchievementFileHash + ".achv"; + + /// + /// AchievementFile download URL. + /// + public static string AchievementURL = "http://us.depot.battle.net:1119/" + AchievementFilename; + + } + } + + /// + /// MPQ storage versions info. + /// + public static class MPQ + { + /// + /// Required MPQ patch version. + /// + public const int RequiredPatchVersion = 7931; + } + + /// + /// Ingame connection & client versions info. + /// + public static class Ingame + { + /// + /// Ingame protocol hash. + /// + public const int ProtocolHash = unchecked((int)0x208CA037); + + // unchecked((int)0x208CA037) // 7931 + // unchecked((int)0x208CA037) // 7841 + // unchecked((int)0x9E121BBD) // 7728 + // 0x21EEE08D // 7446 + + public const string VersionString = "0.4.1.7931"; + + // 0.3.1.7779 // 7728 + // 0.3.0.7484 // 7447 + // 0.3.0.7333 // beta patch-3 + } + } +} diff --git a/src/Mooege/Core/Cryptography/ARC4.cs b/src/Mooege/Core/Cryptography/ARC4.cs new file mode 100644 index 00000000..da9d1628 --- /dev/null +++ b/src/Mooege/Core/Cryptography/ARC4.cs @@ -0,0 +1,79 @@ +/* + * 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://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..189a3d90 --- /dev/null +++ b/src/Mooege/Core/Cryptography/SRP6a.cs @@ -0,0 +1,292 @@ +/* + * 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.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()) // server's public ephemeral value (B) + .Concat(SecondChallenge.ToArray()) // 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(); + } + + /// + /// Verifies the account using srp6a session provided values by client. + /// + /// Client's public ephemeral + /// Client M. + /// Session seed. + /// + public bool Verify(byte[] ABytes, byte[] M_client, byte[] seed) + { + var A = ABytes.ToBigInteger(); // client's public ephemeral + var u = H.ComputeHash(new byte[0].Concat(ABytes).Concat(B.ToArray()).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()); // K = H(S) - Shared, strong session key. + var K = this.SessionKey.ToBigInteger(); + + 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()) + .Concat(hashedIdentitySalt) + .Concat(this.Account.Salt.ToArray()) + .Concat(ABytes) + .Concat(B.ToArray()) + .Concat(K.ToArray()) + .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(ABytes) + .Concat(M_client) + .Concat(K.ToArray()) + .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()) // 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..8d758345 --- /dev/null +++ b/src/Mooege/Core/Cryptography/SSL/CertificateHelper.cs @@ -0,0 +1,58 @@ +/* + * 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.IO; +using System.Linq; +using System.Text; +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..1ef5fd09 --- /dev/null +++ b/src/Mooege/Core/GS/AI/Brain.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.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) + 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) + { } + + private void Perform(int tickCounter) + { + if (this.CurrentAction == null) + return; + + if (this.CurrentAction.Done) + { + this.CurrentAction = null; + return; + } + + if (!this.CurrentAction.Started) + this.CurrentAction.Start(tickCounter); + else + this.CurrentAction.Update(tickCounter); + } + } +} diff --git a/src/Mooege/Core/GS/AI/BrainState.cs b/src/Mooege/Core/GS/AI/BrainState.cs new file mode 100644 index 00000000..93558760 --- /dev/null +++ b/src/Mooege/Core/GS/AI/BrainState.cs @@ -0,0 +1,62 @@ +/* + * 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.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, + End + } +} 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..b1fa94fb --- /dev/null +++ b/src/Mooege/Core/GS/AI/Brains/FollowerBrain.cs @@ -0,0 +1,35 @@ +/* + * 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.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..be8ad133 --- /dev/null +++ b/src/Mooege/Core/GS/AI/Brains/HirelingBrain.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 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/MonsterBrain.cs b/src/Mooege/Core/GS/AI/Brains/MonsterBrain.cs new file mode 100644 index 00000000..bc0bb5d4 --- /dev/null +++ b/src/Mooege/Core/GS/AI/Brains/MonsterBrain.cs @@ -0,0 +1,76 @@ +/* + * 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; + +namespace Mooege.Core.GS.AI.Brains +{ + public class MonsterBrain:Brain + { + /// + /// Hostile actors in range. + /// + public List EnemiesInRange { get; protected set; } + + public MonsterBrain(Actor body) + : base(body) + { + } + + private List GetPlayersInRange(Mooege.Core.GS.Map.World world) + { + // Not as clean and fancy as quadtreee, but the cost is like alot less. + // Quadtree avg's 0.134ms vs 0.004ms for this. Probably could stick to the Quadtree by just only checking every X seconds. + List playerList = new List(); + foreach (var p in world.Players.Values) + { + if (MovementHelpers.GetDistance(this.Body.Position, p.Position) < 240f) + { + playerList.Add(p); + } + } + return playerList; + } + + public override void Think(int tickCounter) + { + if (this.Body is NPC) return; + + // Reading enemies in range from quad map is quite expensive, so read it once at the very start. /raist. + this.EnemiesInRange = this.GetPlayersInRange(Body.World); //this.Body.GetPlayersInRange(); + + if (this.EnemiesInRange.Count > 0) // if there are enemies around + this.State = BrainState.Combat; // attack them. + else + this.State = BrainState.Wander; // else just wander around. + + if (this.CurrentAction == null) + { + var heading = new Vector3D(this.Body.Position.X + FastRandom.Instance.Next(-40, 40), this.Body.Position.Y + FastRandom.Instance.Next(-40, 40), this.Body.Position.Z); + + if (this.Body.Position.DistanceSquared(ref heading) > this.Body.WalkSpeed * this.Body.World.Game.TickRate) // just skip the movements that can be accomplished in a single game.update(). /raist. + this.CurrentAction = new MoveToPointWithPathfindAction(this.Body, heading); + } + } + } +} 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..18174fd1 --- /dev/null +++ b/src/Mooege/Core/GS/AI/Brains/NPCBrain.cs @@ -0,0 +1,31 @@ +/* + * 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 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..c7d23801 --- /dev/null +++ b/src/Mooege/Core/GS/AI/Pathfinder.cs @@ -0,0 +1,264 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Core.GS.Common.Types.Math; +using System.Drawing; +using Mooege.Common; +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..75fa4c68 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Actions/ActorAction.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 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/Actor.cs b/src/Mooege/Core/GS/Actors/Actor.cs new file mode 100644 index 00000000..5d07e125 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Actor.cs @@ -0,0 +1,675 @@ +/* + * 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 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.Definitions.Actor; +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; + +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 }; } + } + + /// + /// 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 + /// + private Mooege.Common.MPQ.FileFormats.QuestRange _questRange; + + protected Mooege.Common.MPQ.FileFormats.ConversationList ConversationList; + + /// + /// Returns true if actor has world location. + /// TODO: I belive this belongs to WorldObject.cs /raist. + /// + public virtual bool HasWorldLocation + { + get { return true; } + } + + protected 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) + { } + + /// + /// Unregister from quest events when object is destroyed + /// + public override void Destroy() + { + if (_questRange != 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; + + 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(); + + 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 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, + Field1 = -1, + Field2 = -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 + + private void quest_OnQuestProgress(Quest quest) + { + UpdateQuestRangeVisbility(); + } + + 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}", SNOId, 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}", SNOId, snoConversationList); + } + + + if (this.Tags.ContainsKey(MarkerKeys.TriggeredConversation)) + snoTriggeredConversation = Tags[MarkerKeys.TriggeredConversation].Id; + + + } + + #endregion + + #region movement + + public void Move(Vector3D point, float facingAngle) + { + this.SetFacingRotation(facingAngle); + + var movementMessage = new NotifyActorMovementMessage + { + ActorId = (int)this.DynamicID, + Position = point, + Angle = facingAngle, + TurnImmediately = false, + Speed = this.WalkSpeed, + Field5 = 0, + AnimationTag = this.AnimationSet == null ? 0 : this.AnimationSet.GetAnimationTag(Mooege.Common.MPQ.FileFormats.AnimationTags.Walk) + }; + + this.World.BroadcastIfRevealed(movementMessage, 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..6c0c1ef6 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/ActorFactory.cs @@ -0,0 +1,165 @@ +/* + * 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.Reflection; +using Mooege.Common.MPQ; +using Mooege.Common.MPQ.FileFormats.Types; +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.DestructibleLootContainer: + return new DesctructibleLootContainer(world, snoId, tags); + case GizmoGroup.Portal: + return new Portal(world, snoId, tags); + 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.Barricade: + case GizmoGroup.CathedralIdol: + case GizmoGroup.Destructible: + case GizmoGroup.Door: + 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)) + 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) + { + 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..84b25df6 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Environment.cs @@ -0,0 +1,36 @@ +/* + * 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.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..eeda9c96 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Gizmo.cs @@ -0,0 +1,42 @@ +/* + * 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.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..5118a4c3 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/HandledSNO.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; + +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..90d7a473 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Artisans/Artisan.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 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..47a05565 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Artisans/ArtisanShortcut.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.Collections.Generic; +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..49ea3f80 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Artisans/Blacksmith.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.Collections.Generic; +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..e922243d --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Artisans/Jeweler.cs @@ -0,0 +1,43 @@ +/* + * 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.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..d970a6b3 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Artisans/Mystic.cs @@ -0,0 +1,33 @@ +/* + * 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.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..32486274 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Cain.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.Collections.Generic; +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 /* Ho-ho-horadrim */)] + public class Cain : InteractiveNPC + { + public Cain(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + this.Attributes[GameAttribute.MinimapActive] = true; + Conversations.Add(new ConversationInteraction(72416)); + Conversations.Add(new ConversationInteraction(198588)); + Conversations.Add(new ConversationInteraction(73171)); + Interactions.Add(new IdentifyAllInteraction()); + } + + public override bool Reveal(Player player) + { + if (!base.Reveal(player)) + return false; + + return true; + } + } +} 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..75e549b5 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/CaptainRumford.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +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..7cb88ab9 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Checkpoint.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 Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message.Definitions.Effect; +using Mooege.Core.GS.Common.Types.Math; + +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..d76d3def --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/DesctructibleLootContainer.cs @@ -0,0 +1,109 @@ +/* + * 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.Net.GS.Message.Definitions.Animation; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Misc; +using TreasureClass = Mooege.Common.MPQ.FileFormats.TreasureClass; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.Items; + +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/Healthwell.cs b/src/Mooege/Core/GS/Actors/Implementations/Healthwell.cs new file mode 100644 index 00000000..0d3beb23 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Healthwell.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 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..cb355b95 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Enchantress.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.Collections.Generic; +using Mooege.Common.Helpers.Hash; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Map; +using Mooege.Common.Helpers; +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..3d162fd8 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Hireling.cs @@ -0,0 +1,448 @@ +/* + * 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.Common.Types.Math; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; +using Mooege.Common.Helpers; +using Mooege.Net.GS.Message.Definitions.World; +using Mooege.Core.GS.Actors.Interactions; +using Mooege.Net.GS.Message.Definitions.Inventory; +using Mooege.Net.GS.Message.Fields; +using Mooege.Net.GS.Message.Definitions.Hireling; +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; + this.Attributes[GameAttribute.Hitpoints_Max_Total] = 308.25f; + this.Attributes[GameAttribute.Hitpoints_Max] = 216.25f; + this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 3.051758E-05f; + this.Attributes[GameAttribute.Hitpoints_Cur] = 308.25f; + + + 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) + { + this.Attributes[GameAttribute.Skill_Total, info.Skill1SNOId] = 1; + this.Attributes[GameAttribute.Skill, info.Skill1SNOId] = 1; + } + + if (info.Skill2SNOId != -1) + { + this.Attributes[GameAttribute.Skill_Total, info.Skill2SNOId] = 1; + this.Attributes[GameAttribute.Skill, info.Skill2SNOId] = 1; + } + + if (info.Skill3SNOId != -1) + { + this.Attributes[GameAttribute.Skill_Total, info.Skill3SNOId] = 1; + this.Attributes[GameAttribute.Skill, info.Skill3SNOId] = 1; + } + + if (info.Skill4SNOId != -1) + { + 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.Get_Hit_Damage] = 20; + this.Attributes[GameAttribute.Get_Hit_Recovery] = 3.051758E-05f; + this.Attributes[GameAttribute.Get_Hit_Max] = 3.051758E-05f; + this.Attributes[GameAttribute.Dodge_Rating_Total] = 3.051758E-05f; + this.Attributes[GameAttribute.Block_Amount_Item_Delta] = 4; + this.Attributes[GameAttribute.Block_Amount_Item_Min] = 6; + this.Attributes[GameAttribute.Block_Amount_Total_Min] = 6; + this.Attributes[GameAttribute.Block_Chance_Item_Total] = 0.1099854f; + this.Attributes[GameAttribute.Block_Chance_Item] = 3.051758E-05f; + this.Attributes[GameAttribute.Block_Chance_Total] = 0.1099854f; + this.Attributes[GameAttribute.Resource_Cur, 0] = 0x3f800000; + this.Attributes[GameAttribute.Resource_Max, 0] = 1; + this.Attributes[GameAttribute.Resource_Max_Total, 0] = 0x3F800000; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total_All] = 6; + this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_All] = 2; + this.Attributes[GameAttribute.Resource_Regen_Total, 0] = 3.051758E-05f; + this.Attributes[GameAttribute.Resource_Effective_Max, 0] = 1; + this.Attributes[GameAttribute.Attacks_Per_Second_Item_CurrentHand] = 1.199219f; + this.Attributes[GameAttribute.Attacks_Per_Second_Item_Total_MainHand] = 1.199219f; + this.Attributes[GameAttribute.Attacks_Per_Second_Total] = 1.199219f; + this.Attributes[GameAttribute.Attacks_Per_Second_Item_MainHand] = 1.199219f; + this.Attributes[GameAttribute.Attacks_Per_Second] = 1; + this.Attributes[GameAttribute.Attacks_Per_Second_Item_Total] = 1.199219f; + this.Attributes[GameAttribute.Attacks_Per_Second_Item_Subtotal] = 3.051758E-05f; + this.Attributes[GameAttribute.Attacks_Per_Second_Item] = 3.051758E-05f; + this.Attributes[GameAttribute.Hit_Chance] = 1; + this.Attributes[GameAttribute.Casting_Speed_Total] = 1; + this.Attributes[GameAttribute.Casting_Speed] = 1; + this.Attributes[GameAttribute.Movement_Scalar_Total] = 1; + this.Attributes[GameAttribute.Movement_Scalar_Capped_Total] = 1; + this.Attributes[GameAttribute.Movement_Scalar_Subtotal] = 1; + this.Attributes[GameAttribute.Strafing_Rate_Total] = 0.1799316f; + this.Attributes[GameAttribute.Sprinting_Rate_Total] = 0.3598633f; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total_MainHand, 0] = 6; + this.Attributes[GameAttribute.Running_Rate_Total] = 0.3598633f; + this.Attributes[GameAttribute.Walking_Rate_Total] = 0.3598633f; + this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_MainHand, 0] = 2; + this.Attributes[GameAttribute.Strafing_Rate] = 0.1799316f; + this.Attributes[GameAttribute.Damage_Delta, 0] = 2; + this.Attributes[GameAttribute.Damage_Delta_Total, 0] = 2; + this.Attributes[GameAttribute.Sprinting_Rate] = 0.3598633f; + this.Attributes[GameAttribute.Damage_Min, 0] = 6.808594f; + this.Attributes[GameAttribute.Running_Rate] = 0.3598633f; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 0] = 6; + this.Attributes[GameAttribute.Walking_Rate] = 0.3598633f; + this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 0] = 2; + this.Attributes[GameAttribute.Damage_Min_Total, 0] = 6.808594f; + this.Attributes[GameAttribute.Movement_Scalar] = 1; + this.Attributes[GameAttribute.Damage_Min_Subtotal, 0] = 6.808594f; + this.Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 2; + this.Attributes[GameAttribute.Damage_Weapon_Delta_SubTotal, 0] = 2; + this.Attributes[GameAttribute.Damage_Weapon_Max, 0] = 8; + this.Attributes[GameAttribute.Damage_Weapon_Max_Total, 0] = 8; + this.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = 2; + this.Attributes[GameAttribute.Damage_Weapon_Min, 0] = 6; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] = 6; + this.Attributes[GameAttribute.Resource_Type_Primary] = 0; + this.Attributes[GameAttribute.Hitpoints_Max_Total] = 308.25f; + this.Attributes[GameAttribute.Hitpoints_Max] = 216.25f; + this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 3.051758E-05f; + this.Attributes[GameAttribute.Hitpoints_Total_From_Vitality] = 92; + this.Attributes[GameAttribute.Hitpoints_Factor_Vitality] = 4; + this.Attributes[GameAttribute.Hitpoints_Cur] = 308.25f; + this.Attributes[GameAttribute.Experience_Next] = 0x003C19; + this.Attributes[GameAttribute.Experience_Granted] = 0x28; + this.Attributes[GameAttribute.Armor_Total] = 20; + this.Attributes[GameAttribute.Armor_Item_Total] = 20; + this.Attributes[GameAttribute.Armor_Item_SubTotal] = 20; + this.Attributes[GameAttribute.Armor_Item] = 20; + this.Attributes[GameAttribute.Defense] = 23; + this.Attributes[GameAttribute.Vitality] = 23; + this.Attributes[GameAttribute.Precision] = 23; + this.Attributes[GameAttribute.Attack] = 23; + this.Attributes[GameAttribute.General_Cooldown] = 0; + this.Attributes[GameAttribute.Level_Cap] = 60; + + if (IsProxy) + return; + + this.Attributes[GameAttribute.Callout_Cooldown, 0x000FFFFF] = 0x00000797; + this.Attributes[GameAttribute.Buff_Active, 0x20c51] = 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_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.Buff_Visual_Effect, 0x000FFFFF] = true; + 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..b2e7ea50 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Scoundrel.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.Collections.Generic; +using Mooege.Common.Helpers.Hash; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Map; +using Mooege.Net.GS.Message; +using Mooege.Common.Helpers; +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..59bec934 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Hirelings/Templar.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.Collections.Generic; +using Mooege.Common.Helpers.Hash; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Map; +using Mooege.Net.GS.Message; +using Mooege.Common.Helpers; +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..e766fa5b --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/LootContainer.cs @@ -0,0 +1,93 @@ +/* + * 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.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 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/NephalemAltar.cs b/src/Mooege/Core/GS/Actors/Implementations/NephalemAltar.cs new file mode 100644 index 00000000..a6b1aee6 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/NephalemAltar.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.Collections.Generic; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Net.GS.Message.Definitions.World; +using Mooege.Net.GS.Message.Definitions.Misc; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Actors.Implementations +{ + [HandledSNO(220930 /* Global_Nephalem_Altar.acr */)] + public sealed class NephalemAltar : Gizmo + { + public NephalemAltar(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + Attributes[GameAttribute.MinimapActive] = true; + } + + public override void OnTargeted(Player player, TargetMessage message) + { + player.InGameClient.SendMessage(new ANNDataMessage(Opcodes.UseNephalemAltarMessage) + { + ActorID = this.DynamicID + }); + + player.Attributes[GameAttribute.Last_Altar_ANN] = (int)this.DynamicID; + player.Attributes.BroadcastChangedIfRevealed(); + Attributes[GameAttribute.Gizmo_Has_Been_Operated] = true; + Attributes.BroadcastChangedIfRevealed(); + } + } +} 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..e6d3619f --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/ProximityTriggeredGizmo.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 Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Definitions.Misc; +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..0e0c739a --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Savepoint.cs @@ -0,0 +1,56 @@ +/* + * 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 Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; +using Mooege.Core.GS.Common.Types.Math; +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(); + } + } + + } +} 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..646af479 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Shrine.cs @@ -0,0 +1,56 @@ +/* + * 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.Net.GS.Message.Definitions.Animation; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Net.GS.Message; +using TreasureClass = Mooege.Common.MPQ.FileFormats.TreasureClass; +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..0f65030c --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/StartingPoint.cs @@ -0,0 +1,42 @@ +/* + * 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.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..5c4fd3e2 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Stash.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.Collections.Generic; +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..e0880ab8 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Vendor.cs @@ -0,0 +1,117 @@ +/* + * 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.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 +{ + [HandledSNO(178396 /* Fence_In_Town_01? */)] //TODO this is just a test, do it properly for all vendors? + 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..2119f200 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Waypoint.cs @@ -0,0 +1,142 @@ +/* + * 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.Windows; +using Mooege.Common.MPQ; +using Mooege.Common.MPQ.FileFormats.Types; +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, + + Field4 = unchecked((int)0x9799F57B), + Field5 = 0, + Field6 = 0, + Field7 = 0, + Field8 = 0, + Field9 = true, + Field10 = false, + Field11 = false, + Field12 = 0 + }); + + return true; + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Implementations/Zombie.cs b/src/Mooege/Core/GS/Actors/Implementations/Zombie.cs new file mode 100644 index 00000000..63d781c6 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Implementations/Zombie.cs @@ -0,0 +1,36 @@ +/* + * 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.MPQ.FileFormats.Types; +using Mooege.Core.GS.AI.Brains; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Common.Types.TagMap; + +namespace Mooege.Core.GS.Actors.Implementations +{ + [HandledSNO(6652)] + public class Zombie : Monster + { + public Zombie(World world, int snoId, TagMap tags) + : base(world, snoId, tags) + { + //this.Brain = new MonsterBrain(this); + } + } +} 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..eafbb8b4 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Interactions/Interactions.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +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..39517baf --- /dev/null +++ b/src/Mooege/Core/GS/Actors/InteractiveNPC.cs @@ -0,0 +1,184 @@ +/* + * 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.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.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..083118b3 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Living.cs @@ -0,0 +1,82 @@ +/* + * 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 Mooege.Common.Helpers; +using Mooege.Common.Helpers.Math; +using Mooege.Common.MPQ.FileFormats.Types; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +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; + + this.Attributes[GameAttribute.Hitpoints_Max_Total] = 4.546875f; + this.Attributes[GameAttribute.Hitpoints_Max] = 4.546875f; + 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; + } + } +} diff --git a/src/Mooege/Core/GS/Actors/Monster.cs b/src/Mooege/Core/GS/Actors/Monster.cs new file mode 100644 index 00000000..8d644b9d --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Monster.cs @@ -0,0 +1,208 @@ +/* + * 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; + + +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; + } + } + + 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; + + } + + public override void OnTargeted(Player player, TargetMessage message) + { + this.Die(player); + } + + + public void Update(int tickCounter) + { + if (this.Brain == null) + return; + + this.Brain.Update(tickCounter); + } + + // FIXME: Hardcoded hell. /komiga + public void Die(Player player) + { + /*var killAni = new int[]{ + 0x2cd7, + 0x2cd4, + 0x01b378, + 0x2cdc, + 0x02f2, + 0x2ccf, + 0x2cd0, + 0x2cd1, + 0x2cd2, + 0x2cd3, + 0x2cd5, + 0x01b144, + 0x2cd6, + 0x2cd8, + 0x2cda, + 0x2cd9 + };*/ + this.World.BroadcastIfRevealed(new PlayEffectMessage() + { + ActorId = this.DynamicID, + Effect = Effect.Hit, + OptionalParameter = 0x2, + }, this); + + this.World.BroadcastIfRevealed(new PlayEffectMessage() + { + ActorId = this.DynamicID, + Effect = Effect.Unknown12, + }, this); + + this.World.BroadcastIfRevealed(new PlayHitEffectMessage() + { + ActorID = this.DynamicID, + HitDealer = player.DynamicID, + Field2 = 0x2, + Field3 = false, + }, this); + + this.World.BroadcastIfRevealed(new FloatingNumberMessage() + { + ActorID = this.DynamicID, + Number = 9001.0f, + Type = FloatingNumberMessage.FloatType.White, + }, this); + + this.World.BroadcastIfRevealed(new ANNDataMessage(Opcodes.ANNDataMessage13) + { + ActorID = this.DynamicID + }, this); + + this.World.BroadcastIfRevealed(new PlayAnimationMessage() + { + ActorID = this.DynamicID, + Field1 = 0xb, + Field2 = 0, + tAnim = new PlayAnimationMessageSpec[1] + { + new PlayAnimationMessageSpec() + { + Duration = 0x2, + AnimationSNO = AnimationSet.GetRandomDeath(),//killAni[RandomHelper.Next(killAni.Length)], + PermutationIndex = 0x0, + Speed = 0.1f + } + } + }, this); + + this.World.BroadcastIfRevealed(new ANNDataMessage(Opcodes.ANNDataMessage24) + { + ActorID = this.DynamicID, + }, this); + + GameAttributeMap attribs = this.Attributes; //TODO change it /fasbat + attribs[GameAttribute.Hitpoints_Cur] = 0f; + attribs[GameAttribute.Could_Have_Ragdolled] = true; + attribs[GameAttribute.Deleted_On_Server] = true; + + attribs.BroadcastChangedIfRevealed(); + + // Spawn Random item and give exp for each player in range + List players = this.GetPlayersInRange(26f); + foreach (Player plr in players) + { + plr.UpdateExp(this.Attributes[GameAttribute.Experience_Granted]); + this.World.SpawnRandomItemDrop(this, plr); + } + + player.ExpBonusData.Update(player.GBHandle.Type, this.GBHandle.Type); + this.World.SpawnGold(this, player); + if (RandomHelper.Next(1, 100) < 20) + this.World.SpawnHealthGlobe(this, player, this.Position); + this.PlayLore(); + this.Destroy(); + } + + /// + /// Plays lore for first death of this monster's death. + /// + private 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..62c6aadb --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Movement/MoveToPointAction.cs @@ -0,0 +1,76 @@ +/* + * 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.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..3bb78920 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Movement/MoveToPointWithPathfindAction.cs @@ -0,0 +1,102 @@ +/* + * 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.Actions; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Core.GS.Ticker; +using Mooege.Core.GS.AI; +using System.Threading.Tasks; + +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..233f3517 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Movement/MovementHelpers.cs @@ -0,0 +1,69 @@ +/* + * 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; + +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; + + return (float) Math.Atan2((targetPosition.Y - lookerPosition.Y), (targetPosition.X - lookerPosition.X)); + } + + 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..a383166d --- /dev/null +++ b/src/Mooege/Core/GS/Actors/NPC.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.Collections.Generic; +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..d41faa5e --- /dev/null +++ b/src/Mooege/Core/GS/Actors/Portal.cs @@ -0,0 +1,142 @@ +/* + * 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 Mooege.Common.Helpers.Hash; +using Mooege.Common.Logging; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Players; +using Mooege.Net.GS.Message; +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) || 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 + + Field4 = StringHashHelper.HashNormal(markerName), + Field5 = 0, + Field6 = 0, + Field7 = 0, + Field8 = 0, + Field9 = true, + Field10 = false, + Field11 = 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..800d67d1 --- /dev/null +++ b/src/Mooege/Core/GS/Actors/ServerProp.cs @@ -0,0 +1,21 @@ +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/Common/InventoryGrid.cs b/src/Mooege/Core/GS/Common/InventoryGrid.cs new file mode 100644 index 00000000..d9271b1b --- /dev/null +++ b/src/Mooege/Core/GS/Common/InventoryGrid.cs @@ -0,0 +1,253 @@ +/* + * 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 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; + } + + // 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 }; + 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) + { + InventorySlot? slot = FindSlotForItem(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(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(Item item) + { + InventorySize size = GetItemInventorySize(item); + for (int r = 0; r <= Rows - 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..70dd30d5 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Collision/AABB.cs @@ -0,0 +1,109 @@ +/* + * 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 CrystalMpq; +using Gibbed.IO; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Common.Types.Collision +{ + public class AABB + { + public Vector3D Min; + public Vector3D Max; + + 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..1d3f9ce0 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Math/PRTransform.cs @@ -0,0 +1,76 @@ +/* + * 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 CrystalMpq; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Common.Types.Math +{ + public class PRTransform + { + public Quaternion Quaternion; + public Vector3D Vector3D; + + 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..cb760b69 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Math/Quaternion.cs @@ -0,0 +1,77 @@ +/* + * 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 CrystalMpq; +using Gibbed.IO; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Common.Types.Math +{ + public class Quaternion + { + public float W; + public Vector3D Vector3D; + + public Quaternion() { } + + /// + /// 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..fc2b100f --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Math/Vector2D.cs @@ -0,0 +1,92 @@ +/* + * 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 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; + + [PersistentProperty("Y")] + public int Y; + + 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..bd645923 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Math/Vector2F.cs @@ -0,0 +1,460 @@ +/* + * 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.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..33dbe081 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Math/Vector3D.cs @@ -0,0 +1,205 @@ +/* + * 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 CrystalMpq; +using Gibbed.IO; +using Mooege.Common.MPQ; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Common.Types.Math +{ + public class Vector3D : ISerializableData + { + public float X; + public float Y; + public float Z; + + 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..b696f1aa --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Misc/Circle.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.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..0ec903cb --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Misc/RGBAColor.cs @@ -0,0 +1,92 @@ +/* + * 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 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..d1e26291 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/QuadTrees/QuadNode.cs @@ -0,0 +1,130 @@ +/* + * 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 + */ + +// 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..215589c5 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/QuadTrees/QuadTree.cs @@ -0,0 +1,535 @@ +/* + * 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 + */ + +// 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..86333edf --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/SNO/SNOGroup.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +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, + } +} 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..55b4ba8c --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/SNO/SNOHandle.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.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..3ada245f --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Scene/SceneCachedValues.cs @@ -0,0 +1,129 @@ +/* + * 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 CrystalMpq; +using Gibbed.IO; +using Mooege.Core.GS.Common.Types.Collision; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Common.Types.Scene +{ + public class SceneCachedValues + { + public int Unknown1; + public int Unknown2; + public int Unknown3; + public AABB AABB1; + public AABB AABB2; + public int[] Unknown4; // MaxLength = 4 + public int Unknown5; + + 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..a005ee7b --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/Scene/SceneSpecification.cs @@ -0,0 +1,208 @@ +/* + * 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 CrystalMpq; +using Gibbed.IO; +using Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Common.Types.Scene +{ + public class SceneSpecification + { + public int CellZ; // Position.Z rounded down + public Vector2D Cell; + public int[] SNOLevelAreas; // Area names - MaxLength = 4 + public int SNOPrevWorld; + public int Unknown1; + public int SNOPrevLevelArea; + public int SNONextWorld; + public int Unknown2; + public int SNONextLevelArea; + public int SNOMusic; + public int SNOCombatMusic; + public int SNOAmbient; + public int SNOReverb; + public int SNOWeather; + public int SNOPresetWorld; + public int Unknown3; + public int Unknown4; + public int Unknown5; + public int ClusterID; + public SceneCachedValues SceneCachedValues; + + 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..90bfddca --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/TagMap/ActorKeys.cs @@ -0,0 +1,151 @@ +/* + * 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; + +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 + } + +} 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..db4ea150 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/TagMap/AnimationSetKeys.cs @@ -0,0 +1,133 @@ +/* + * 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; + +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..bffa0fc6 --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/TagMap/MarkerKeys.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.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); + public static TagKeyInt GroupHash = new TagKeyInt(524814); + + // 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 TagKeyInt TriggerDistance = new TagKeyInt(528384); // raven_pecking + + 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..f3b526ab --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/TagMap/PowerKeys.cs @@ -0,0 +1,522 @@ +/* + * 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; + +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..1973447e --- /dev/null +++ b/src/Mooege/Core/GS/Common/Types/TagMap/TagMap.cs @@ -0,0 +1,284 @@ +/* + * 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 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]); + } + } + + 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; private 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..6f8c7339 --- /dev/null +++ b/src/Mooege/Core/GS/Games/Game.cs @@ -0,0 +1,385 @@ +/* + * 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.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.Player; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Core.GS.Games +{ + public class Game : IMessageConsumer + { + 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 + + // 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) + { + 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 or 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 = false, + 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.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.BnetEntityID.High, Low = (long)joinedPlayer.Toon.BnetEntityID.Low }, //Toon + GameAccountId = new EntityId() { High = (long)joinedPlayer.Toon.Owner.BnetGameAccountID.High, Low = (long)joinedPlayer.Toon.Owner.BnetGameAccountID.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..8caf8884 --- /dev/null +++ b/src/Mooege/Core/GS/Games/GameCommands.cs @@ -0,0 +1,554 @@ +/* + * 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.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.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.EnableCauldronOfJordan(); + invokerClient.InGameClient.Player.EnableCubeOfNephalem(); + 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.")] + //public class LevelUpCommand : CommandGroup + //{ + // [DefaultCommand] + // public string LevelUp(string[] @params, MooNetClient invokerClient) + // { + // // TODO: does not work, should be actually refactoring Player.cs:UpdateExp() and use it. /raist. + + // 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]")] + 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); + } + } + + [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..594a01c0 --- /dev/null +++ b/src/Mooege/Core/GS/Games/GameDebugCommands.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 System.Threading; +using System.Windows.Forms; +using Mooege.Core.GS.Map; +using Mooege.Core.GS.Map.Debug; +using Mooege.Core.GS.Objects; +using Mooege.Core.GS.Players; +using Mooege.Core.MooNet.Accounts; +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..0d51c593 --- /dev/null +++ b/src/Mooege/Core/GS/Games/GameManager.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.Collections.Generic; +using Mooege.Common.Logging; +using Mooege.Core.GS.Players; +using Mooege.Common.Extensions; +using System; + +namespace Mooege.Core.GS.Games +{ + public static class GameManager + { + 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) + { + var toon = p.Toon; + toon.TimePlayed += DateTimeExtensions.ToUnixTime(DateTime.UtcNow) - toon.LoginTime; + toon.SaveToDB(); + + // Remove Player From World + if (p.InGameClient != null) + p.World.Leave(p); + } + + 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..31ef2e71 --- /dev/null +++ b/src/Mooege/Core/GS/Games/Quest.cs @@ -0,0 +1,228 @@ +/* + * 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.MPQ; +using Mooege.Net.GS.Message.Definitions.Quest; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Core.GS.Games; +using Mooege.Common; + +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..1ab291fc --- /dev/null +++ b/src/Mooege/Core/GS/Games/QuestManager.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; +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 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..bb8051d0 --- /dev/null +++ b/src/Mooege/Core/GS/Generators/WorldGenerator.cs @@ -0,0 +1,404 @@ +/* + * 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.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.Map; +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; + + +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 dynamic worlds yet!", worldAsset.Name, worldAsset.SNOId); + 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 + { + var subSceneEntry = RandomHelper.RandomItem(clusters[cID].Default.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 = SceneMiniMapVisibility.Revealed, + 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 + { + var subScenePosition = scene.Position + pos; + var subscene = new Scene(world, subScenePosition, subSceneEntry.SNOScene, scene) + { + MiniMapVisibility = SceneMiniMapVisibility.Revealed, + RotationW = sceneChunk.PRTransform.Quaternion.W, + RotationAxis = sceneChunk.PRTransform.Quaternion.Vector3D, + Specification = sceneChunk.SceneSpecification + }; + scene.Subscenes.Add(subscene); + subscene.LoadMarkers(); + } + } + + } + 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; + } + + /// + /// 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 + + 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.Warn("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: + + loadActor(spawnEntry.SNOHandle, gizmoLocations[location], world, new TagMap()); + break; + + case SNOGroup.Encounter: + + var encounter = spawnEntry.SNOHandle.Target as Encounter; + var actor = RandomHelper.RandomItem(encounter.Spawnoptions, x => x.Probability); + loadActor(new SNOHandle(actor.SNOSpawn), gizmoLocations[location], world, new 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]) + { + 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(6652), + 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 = new Quaternion + { + W = (float)(RandomHelper.NextDouble() * System.Math.PI * 2), + Vector3D = new Vector3D(0, 0, 1) + } + }, + world, + new TagMap() + ); + } + } + } + } + + + + } + } + + + private static void 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; + } + + actor.RotationW = location.Quaternion.W; + actor.RotationAxis = location.Quaternion.Vector3D; + actor.EnterWorld(location.Vector3D); + } + + + + /// + /// 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..72817129 --- /dev/null +++ b/src/Mooege/Core/GS/Items/Affix.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; +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..660f8752 --- /dev/null +++ b/src/Mooege/Core/GS/Items/AffixGenerator.cs @@ -0,0 +1,118 @@ +/* + * 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.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); + + 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; + } + } + } + } + } + } + } + + } +} diff --git a/src/Mooege/Core/GS/Items/FormulaScript.cs b/src/Mooege/Core/GS/Items/FormulaScript.cs new file mode 100644 index 00000000..4c363ee5 --- /dev/null +++ b/src/Mooege/Core/GS/Items/FormulaScript.cs @@ -0,0 +1,264 @@ +/* + * 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 Mooege.Common.Helpers.Math; +using Mooege.Common.Logging; +using Mooege.Net.GS.Message; + +namespace Mooege.Core.GS.Items +{ + 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..9dd08bfa --- /dev/null +++ b/src/Mooege/Core/GS/Items/HandledItem.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; + +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..066ef8bf --- /dev/null +++ b/src/Mooege/Core/GS/Items/HandledType.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; + +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..c8b6a207 --- /dev/null +++ b/src/Mooege/Core/GS/Items/Implementations/Book.cs @@ -0,0 +1,73 @@ +/* + * 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 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/CauldronOfJordan.cs b/src/Mooege/Core/GS/Items/Implementations/CauldronOfJordan.cs new file mode 100644 index 00000000..e330b2bd --- /dev/null +++ b/src/Mooege/Core/GS/Items/Implementations/CauldronOfJordan.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.Text; + +namespace Mooege.Core.GS.Items.Implementations +{ + [HandledItem("StoneOfWealth")] + class CauldronOfJordan : Item + { + public CauldronOfJordan(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.EnableCauldronOfJordan(); + this.Destroy(); + } + + public static void OnUse(GS.Players.Player player, Item sellItem) + { + int sellValue = sellItem.ItemDefinition.BaseGoldValue; // TODO: calculate correct sell value for magic items + player.Inventory.AddGoldAmount(sellValue); + + // TODO: instead of destroying item, it should be moved to merchants inventory for rebuy. + player.Inventory.DestroyInventoryItem(sellItem); + } + } +} \ No newline at end of file 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..269ffd4e --- /dev/null +++ b/src/Mooege/Core/GS/Items/Implementations/Dye.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.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..12543cb6 --- /dev/null +++ b/src/Mooege/Core/GS/Items/Implementations/HealthPotion.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.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/NephalemCube.cs b/src/Mooege/Core/GS/Items/Implementations/NephalemCube.cs new file mode 100644 index 00000000..fcaf53d6 --- /dev/null +++ b/src/Mooege/Core/GS/Items/Implementations/NephalemCube.cs @@ -0,0 +1,73 @@ +/* + * 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 Mooege.Net.GS.Message; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Net.GS.Message.Definitions.Misc; + +namespace Mooege.Core.GS.Items.Implementations +{ + [HandledItem("NephalemCube")] + public class NephalemCube : Item + { + public NephalemCube(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.EnableCubeOfNephalem(); + this.Destroy(); + } + + public static void OnUse(GS.Players.Player player, Item salvageItem) + { + if (salvageItem == null) return; + player.Inventory.DestroyInventoryItem(salvageItem); + + List craftingMaterials = TreasureClassManager.CreateLoot(player, salvageItem.ItemDefinition.SNOComponentTreasureClass); + if (salvageItem.Attributes[GameAttribute.Item_Quality_Level] >= (int)ItemTable.ItemQuality.Magic1) + craftingMaterials.AddRange(TreasureClassManager.CreateLoot(player, salvageItem.ItemDefinition.SNOComponentTreasureClassMagic)); + if (salvageItem.Attributes[GameAttribute.Item_Quality_Level] >= (int)ItemTable.ItemQuality.Rare4) + craftingMaterials.AddRange(TreasureClassManager.CreateLoot(player, salvageItem.ItemDefinition.SNOComponentTreasureClassRare)); + + List craftigItemsGbids = new List(); + foreach (Item crafingItem in craftingMaterials) + { + craftigItemsGbids.Add(crafingItem.GBHandle.GBID); + // reveal new item to player + player.Inventory.PickUp(crafingItem); + } + + // TODO: This Message doesn't work. I think i should produce an entry in the chat window like "Salvaging Gloves gave you Common scrap!" - angerwin + //SalvageResultsMessage message = new SalvageResultsMessage + //{ + // gbidNewItems = craftigItemsGbids.ToArray(), + // gbidOriginalItem = salvageItem.GBHandle.GBID, + // Field1 = 0, // Unkown + // Field2 = 0, // Unkown + + //}; + //player.InGameClient.SendMessage(message); + } + + } +} \ 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..4d803545 --- /dev/null +++ b/src/Mooege/Core/GS/Items/Implementations/Potion.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 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..1017e874 --- /dev/null +++ b/src/Mooege/Core/GS/Items/Implementations/SpellRune.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.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..66b09f80 --- /dev/null +++ b/src/Mooege/Core/GS/Items/Implementations/StoneOfRecall.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.Text; + +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..0419b60d --- /dev/null +++ b/src/Mooege/Core/GS/Items/Item.cs @@ -0,0 +1,444 @@ +/* + * 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 Mooege.Common.Helpers.Math; +using Mooege.Common.Logging; +using Mooege.Core.GS.Actors; +using Mooege.Core.GS.Common.Types.Math; +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 + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + 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) + : base(world, definition.SNOActor) + { + this.ItemDefinition = definition; + + 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; + + this.ItemLevel = definition.ItemLevel; + + // 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; + Attributes[GameAttribute.Attacks_Per_Second_Item_Subtotal] += definition.AttacksPerSecond; + Attributes[GameAttribute.Attacks_Per_Second_Item_Total] += definition.AttacksPerSecond; + + Attributes[GameAttribute.Damage_Weapon_Min, 0] += definition.WeaponDamageMin; + Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] += definition.WeaponDamageMin; + + Attributes[GameAttribute.Damage_Weapon_Delta, 0] += definition.WeaponDamageDelta; + Attributes[GameAttribute.Damage_Weapon_Delta_SubTotal, 0] += definition.WeaponDamageDelta; + Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] += definition.WeaponDamageDelta; + + Attributes[GameAttribute.Damage_Weapon_Max, 0] += Attributes[GameAttribute.Damage_Weapon_Min, 0] + Attributes[GameAttribute.Damage_Weapon_Delta, 0]; + Attributes[GameAttribute.Damage_Weapon_Max_Total, 0] += Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] + Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0]; + + Attributes[GameAttribute.Damage_Weapon_Min_Total_All] = definition.WeaponDamageMin; + Attributes[GameAttribute.Damage_Weapon_Delta_Total_All] = definition.WeaponDamageDelta; + } + } + + private void ApplyArmorSpecificOptions(ItemTable definition) + { + if (definition.ArmorValue > 0) + { + Attributes[GameAttribute.Armor_Item] += definition.ArmorValue; + Attributes[GameAttribute.Armor_Item_SubTotal] += definition.ArmorValue; + 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 + }; + } + + #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..5202e05e --- /dev/null +++ b/src/Mooege/Core/GS/Items/ItemCreation/AttributeCreatorFactory.cs @@ -0,0 +1,36 @@ +/* + * 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.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..16738226 --- /dev/null +++ b/src/Mooege/Core/GS/Items/ItemCreation/DefaultAttributeCreator.cs @@ -0,0 +1,33 @@ +/* + * 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 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..8230416e --- /dev/null +++ b/src/Mooege/Core/GS/Items/ItemCreation/IItemAttributeCreator.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 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..331e6139 --- /dev/null +++ b/src/Mooege/Core/GS/Items/ItemCreation/PotionAttributeCreator.cs @@ -0,0 +1,31 @@ +/* + * 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 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..8c0a2adc --- /dev/null +++ b/src/Mooege/Core/GS/Items/ItemCreation/WeaponAttributeCreator.cs @@ -0,0 +1,79 @@ +/* + * 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 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..89c37592 --- /dev/null +++ b/src/Mooege/Core/GS/Items/ItemGenerator.cs @@ -0,0 +1,259 @@ +/* + * 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.Common.Helpers.Hash; +using Mooege.Common.Helpers.Math; +using Mooege.Common.Logging; +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; + +// 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(); + + 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.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; + } + + // 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]; + 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)); + } + } + +} + diff --git a/src/Mooege/Core/GS/Items/ItemGroup.cs b/src/Mooege/Core/GS/Items/ItemGroup.cs new file mode 100644 index 00000000..fc87da84 --- /dev/null +++ b/src/Mooege/Core/GS/Items/ItemGroup.cs @@ -0,0 +1,136 @@ +/* + * 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.Hash; +using Mooege.Common.MPQ.FileFormats; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Common.Types.SNO; +using Mooege.Common.Helpers; + +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..4d226f31 --- /dev/null +++ b/src/Mooege/Core/GS/Items/RuneHelper.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.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..619e1e26 --- /dev/null +++ b/src/Mooege/Core/GS/Items/TreasureClassManager.cs @@ -0,0 +1,56 @@ +/* + * 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.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..0eb308f4 --- /dev/null +++ b/src/Mooege/Core/GS/Map/Debug/ControlExtensions.cs @@ -0,0 +1,69 @@ +/* + * 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; + +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..2516128d --- /dev/null +++ b/src/Mooege/Core/GS/Map/Debug/DebugNavMesh.cs @@ -0,0 +1,387 @@ +/* + * 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.Drawing; +using System.Linq; +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 bool DrawMasterScenes; + public bool DrawSubScenes; + public bool DrawWalkableCells; + public bool DrawUnwalkableCells; + public bool DrawMonsters; + public bool DrawNPCs; + public bool DrawPlayers; + 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(); + } + + #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); + }); + } + + 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.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..f384f33d --- /dev/null +++ b/src/Mooege/Core/GS/Map/Debug/WorldVisualizer.cs @@ -0,0 +1,302 @@ +/* + * 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.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..60fe593d --- /dev/null +++ b/src/Mooege/Core/GS/Map/Scene.cs @@ -0,0 +1,426 @@ +/* + * 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 System.Windows; +using Mooege.Common; +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; +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 SceneMiniMapVisibility 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() + { + 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.Warn("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.Warn("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.Warn("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; + + 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 = 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..d8c4596d --- /dev/null +++ b/src/Mooege/Core/GS/Map/World.cs @@ -0,0 +1,726 @@ +/* + * 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.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Windows; +using Mooege.Common; +using Mooege.Common.Helpers; +using Mooege.Common.Helpers.Math; +using Mooege.Common.Logging; +using Mooege.Common.MPQ.FileFormats.Types; +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.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(); + + /// + /// 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(); } + } + + /// + /// 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.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); + } + + UpdateFlippy(tickCounter); + } + + #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 + }); + + 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; + 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); + } + + /// + /// 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 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..08adf9bf --- /dev/null +++ b/src/Mooege/Core/GS/Objects/DynamicObject.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 + */ + +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..b8ba1d5d --- /dev/null +++ b/src/Mooege/Core/GS/Objects/GameAttributeMap.cs @@ -0,0 +1,361 @@ +/* + * 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 Mooege.Net.GS.Message.Definitions.Attribute; +using Mooege.Core.GS.Objects; +using System.Linq; +using Mooege.Net.GS.Message; +using Mooege.Net.GS; + +namespace Mooege.Core.GS.Objects +{ + public class GameAttributeMap + { + 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; + } + + + + #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; + } + + GameAttributeValue GetAttributeValue(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; + } + + void SetAttributeValue(GameAttribute attribute, int? key, GameAttributeValue value) + { + KeyId keyid; + keyid.Id = attribute.Id; + keyid.Key = key; + + if (!_changedAttributes.Contains(keyid)) + _changedAttributes.Add(keyid); + + 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); + } + _attributeValues[keyid] = value; + } + + 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)); } + } + } +} diff --git a/src/Mooege/Core/GS/Objects/IRevealable.cs b/src/Mooege/Core/GS/Objects/IRevealable.cs new file mode 100644 index 00000000..cd4e75c1 --- /dev/null +++ b/src/Mooege/Core/GS/Objects/IRevealable.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 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..649a35c8 --- /dev/null +++ b/src/Mooege/Core/GS/Objects/IUpdateable.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.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..afa2d498 --- /dev/null +++ b/src/Mooege/Core/GS/Objects/WorldObject.cs @@ -0,0 +1,128 @@ +/* + * 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; +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; } + + /// + /// Replaces the object rotation with one that rotates along the Z-axis by the specified "facing" angle. + /// + /// The angle in radians. + public void SetFacingRotation(float facingAngle) + { + this.RotationW = (float)Math.Cos(facingAngle / 2f); + this.RotationAxis = new Vector3D(0, 0, (float)Math.Sin(facingAngle / 2f)); + } + + /// + /// Creates a new world object. + /// + /// The world object belongs to. + /// The dynamicId of the object. + protected WorldObject(World world, uint dynamicID) + : base(dynamicID) + { + 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..8a787000 --- /dev/null +++ b/src/Mooege/Core/GS/Players/ConversationManager.cs @@ -0,0 +1,457 @@ +/* + * 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.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) + { + 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, + 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); + } + + /// + /// 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..e513a070 --- /dev/null +++ b/src/Mooege/Core/GS/Players/Equipment.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 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 + { + 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, Amulett = 13, + Skills = 16, Stash = 17, Gold = 18, Vendor = 20 // To do: 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 Item _inventoryGold; + + private uint[] _equipment; // array of equiped items_id (not item) + + public Equipment(Player owner){ + this._equipment = new uint[17]; + this._owner = owner; + this.Items = new Dictionary(); + this._inventoryGold = ItemGenerator.CreateGold(_owner, 0); + this._inventoryGold.Attributes[GameAttribute.ItemStackQuantityLo] = 0; + this._inventoryGold.SetInventoryLocation(18, 0, 0); + this._inventoryGold.Owner = _owner; + this.Items.Add(_inventoryGold.DynamicID,_inventoryGold); + } + + /// + /// Equips an item in an equipment slot + /// + public void EquipItem(Item item, int slot) + { + _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, + }; + } + else + { + return Items[(_equipment[(int)equipSlot])].CreateVisualItem(); + } + } + + 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 Item AddGoldItem(Item collectedItem) + { + + return AddGoldAmount(collectedItem.Attributes[GameAttribute.Gold]); + } + + internal Item AddGoldAmount(int amount) + { + _inventoryGold.Attributes[GameAttribute.ItemStackQuantityLo] += amount; + _inventoryGold.Attributes.SendChangedMessage(_owner.InGameClient); + return _inventoryGold; + } + + 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); + } + + _inventoryGold.SetInventoryLocation((int)EquipmentSlotId.Gold, 0, 0); + 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..e8ec7005 --- /dev/null +++ b/src/Mooege/Core/GS/Players/ExpBonusData.cs @@ -0,0 +1,215 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Common; +using Mooege.Common.Logging; +using Mooege.Net.GS.Message.Definitions.Combat; +using Mooege.Common.Helpers; + +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..a6f95e23 --- /dev/null +++ b/src/Mooege/Core/GS/Players/Inventory.cs @@ -0,0 +1,597 @@ +/* + * 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 Mooege.Common; +using Mooege.Common.Logging; +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.Net.GS.Message.Definitions.Stash; +using Mooege.Core.GS.Objects; +using Mooege.Common.Helpers; +using Mooege.Net.GS.Message.Definitions.Misc; +using System.Collections.Generic; +using System.Linq; +using Mooege.Core.GS.Items.Implementations; + +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 + + private Equipment _equipment; + private InventoryGrid _inventoryGrid; + private InventoryGrid _stashGrid; + // 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 + }); */ + } + + + /// + /// 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 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; + } + + 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 + { + // equip item and place other item in the backpack + sourceGrid.RemoveItem(item); + _equipment.EquipItem(item, targetEquipSlot); + sourceGrid.AddItem(oldEquipItem); + } + 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); + } + } + } + + /// + /// 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)) + { + _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 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); + 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 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 RequestUseCauldronOfJordanMessage) OnUseCauldronOfJordanMessage(message as RequestUseCauldronOfJordanMessage); + else if (message is RequestUseNephalemCubeMessage) OnUseNephalmCubeMessage(message as RequestUseNephalemCubeMessage); + else return; + } + + private void OnBuySharedStashSlots(RequestBuySharedStashSlotsMessage requestBuySharedStashSlotsMessage) + { + // TODO: Take that money away ;) + _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); + Item sumGoldItem = _equipment.AddGoldItem(collectedItem); + } + + 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(); + } + + 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(16, 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]; + _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; + } + + + private void OnUseNephalmCubeMessage(RequestUseNephalemCubeMessage requestUseNephalemCubeMessage) + { + Item salvageItem = GetItem(requestUseNephalemCubeMessage.ActorID); + NephalemCube.OnUse(_owner, salvageItem); + } + + private void OnUseCauldronOfJordanMessage(RequestUseCauldronOfJordanMessage requestUseCauldronOfJordanMessage) + { + Item sellItem = GetItem(requestUseCauldronOfJordanMessage.ActorID); + CauldronOfJordan.OnUse(_owner, sellItem); + } + + + public void AddGoldAmount(int amount) + { + _equipment.AddGoldAmount(amount); + } + } +} \ 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..7b48d6ce --- /dev/null +++ b/src/Mooege/Core/GS/Players/Player.cs @@ -0,0 +1,1617 @@ +/* + * 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.Collections.Generic; +using System.Threading; +using Mooege.Common; +using Mooege.Common.Helpers.Math; +using Mooege.Common.Logging; +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.Skills; +using Mooege.Core.MooNet.Toons; +using Mooege.Net.GS; +using Mooege.Net.GS.Message; +using Mooege.Net.GS.Message.Definitions.Actor; +using Mooege.Net.GS.Message.Definitions.Conversation; +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.Artisans; +using Mooege.Core.GS.Actors.Implementations.Hirelings; +using Mooege.Net.GS.Message.Definitions.Hireling; +using System; +using Mooege.Common.Helpers; +using Mooege.Net.GS.Message.Definitions.ACD; + +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, + }); + } + } + } + + /// + /// 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, GetClassSNOId(bnetToon.Gender, bnetToon.Class)) + { + 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.GroundItems = new Dictionary(); + this.Conversations = new ConversationManager(this, this.World.Game.Quests); + this.ExpBonusData = new ExpBonusData(this); + this.SelectedNPC = null; + + // TODO SavePoint from DB + this.SavePointData = new SavePointData() { snoWorld = -1, SavepointId = -1 }; + + #region Attributes + + //Skills + this.Attributes[GameAttribute.SkillKit] = this.SkillKit; + this.Attributes[GameAttribute.Skill_Total, 0x7545] = 1; //Axe Operate Gizmo + this.Attributes[GameAttribute.Skill, 0x7545] = 1; + this.Attributes[GameAttribute.Skill_Total, 0x76B7] = 1; //Punch! + this.Attributes[GameAttribute.Skill, 0x76B7] = 1; + this.Attributes[GameAttribute.Skill_Total, 0x6DF] = 1; //Use Item + this.Attributes[GameAttribute.Skill, 0x6DF] = 1; + this.Attributes[GameAttribute.Skill_Total, 0x7780] = 1; //Basic Attack + this.Attributes[GameAttribute.Skill, 0x7780] = 1; + this.Attributes[GameAttribute.Skill_Total, 0x0002EC66] = 0; //stone of recall + this.Attributes[GameAttribute.Skill_Total, 0xFFFFF] = 1; + this.Attributes[GameAttribute.Skill, 0xFFFFF] = 1; + + //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; + + //Resistance + this.Attributes[GameAttribute.Resistance, 0xDE] = 0.5f; + this.Attributes[GameAttribute.Resistance, 0x226] = 0.5f; + this.Attributes[GameAttribute.Resistance_Total, 0] = 10f; // 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 + this.Attributes[GameAttribute.Resistance_Total, 1] = 10f; //Fire + this.Attributes[GameAttribute.Resistance_Total, 2] = 10f; //Lightning + this.Attributes[GameAttribute.Resistance_Total, 3] = 10f; //Cold + this.Attributes[GameAttribute.Resistance_Total, 4] = 10f; //Poison + this.Attributes[GameAttribute.Resistance_Total, 5] = 10f; //Arcane + this.Attributes[GameAttribute.Resistance_Total, 6] = 10f; //Holy + this.Attributes[GameAttribute.Resistance_Total, 0xDE] = 0.5f; + this.Attributes[GameAttribute.Resistance_Total, 0x226] = 0.5f; + + //Damage + this.Attributes[GameAttribute.Damage_Delta_Total, 0] = 1f; + this.Attributes[GameAttribute.Damage_Delta_Total, 1] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Delta_Total, 2] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Delta_Total, 3] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Delta_Total, 4] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Delta_Total, 5] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Delta_Total, 6] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Min_Total, 0] = 2f; + this.Attributes[GameAttribute.Damage_Min_Total, 1] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Min_Total, 2] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Min_Total, 3] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Min_Total, 4] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Min_Total, 5] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Min_Total, 6] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Min_Total, 0xFFFFF] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Min_Subtotal, 0] = 2f; + this.Attributes[GameAttribute.Damage_Min_Subtotal, 1] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Min_Subtotal, 2] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Min_Subtotal, 3] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Min_Subtotal, 4] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Min_Subtotal, 5] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Min_Subtotal, 6] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Min_Subtotal, 0xFFFFF] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 0] = 2f; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 1] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 2] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 3] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 4] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 5] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 6] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Weapon_Min, 0] = 2f; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0] = 2f; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total_All] = 2f; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total_MainHand, 0] = 2f; + this.Attributes[GameAttribute.Damage_Weapon_Min_Total_CurrentHand, 0xFFFFF] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Weapon_Delta, 0] = 1f; + this.Attributes[GameAttribute.Damage_Weapon_Delta_SubTotal, 0] = 1f; + this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 0] = 1f; + this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 1] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 2] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 3] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 4] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 5] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_CurrentHand, 6] = 3.051758E-05f; + this.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0] = 1f; + this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_All] = 1f; + this.Attributes[GameAttribute.Damage_Weapon_Delta_Total_MainHand, 0] = 1f; + this.Attributes[GameAttribute.Damage_Weapon_Max, 0] = 3f; + this.Attributes[GameAttribute.Damage_Weapon_Max_Total, 0] = 3f; + + //Bonus stats + this.Attributes[GameAttribute.Get_Hit_Recovery] = 6f; + this.Attributes[GameAttribute.Get_Hit_Recovery_Per_Level] = 1f; + this.Attributes[GameAttribute.Get_Hit_Recovery_Base] = 5f; + this.Attributes[GameAttribute.Get_Hit_Max] = 60f; + this.Attributes[GameAttribute.Get_Hit_Max_Per_Level] = 10f; + this.Attributes[GameAttribute.Get_Hit_Max_Base] = 50f; + this.Attributes[GameAttribute.Hit_Chance] = 1f; + this.Attributes[GameAttribute.Dodge_Rating_Total] = 3.051758E-05f; + this.Attributes[GameAttribute.Attacks_Per_Second_Item_CurrentHand] = 1.199219f; + this.Attributes[GameAttribute.Attacks_Per_Second_Item_Total_MainHand] = 1.199219f; + this.Attributes[GameAttribute.Attacks_Per_Second_Total] = 1.199219f; + this.Attributes[GameAttribute.Attacks_Per_Second] = 1f; + this.Attributes[GameAttribute.Attacks_Per_Second_Item_MainHand] = 1.199219f; + this.Attributes[GameAttribute.Attacks_Per_Second_Item_Total] = 1.199219f; + this.Attributes[GameAttribute.Attacks_Per_Second_Item_Subtotal] = 3.051758E-05f; + this.Attributes[GameAttribute.Attacks_Per_Second_Item] = 3.051758E-05f; + this.Attributes[GameAttribute.Crit_Percent_Cap] = 0x3F400000; + this.Attributes[GameAttribute.Casting_Speed_Total] = 1f; + this.Attributes[GameAttribute.Casting_Speed] = 1f; + + //Basic stats + this.Attributes[GameAttribute.Level_Cap] = 13; + this.Attributes[GameAttribute.Level] = this.Toon.Level; + this.Attributes[GameAttribute.Experience_Next] = LevelBorders[this.Toon.Level]; + this.Attributes[GameAttribute.Experience_Granted] = 1000; + this.Attributes[GameAttribute.Armor_Total] = 0; + this.Attributes[GameAttribute.Attack] = (int)this.InitialAttack; + this.Attributes[GameAttribute.Precision] = (int)this.InitialPrecision; + this.Attributes[GameAttribute.Defense] = (int)this.InitialDefense; + this.Attributes[GameAttribute.Vitality] = (int)this.InitialVitality; + + //Hitpoints have to be calculated after Vitality + this.Attributes[GameAttribute.Hitpoints_Factor_Level] = 4f; + this.Attributes[GameAttribute.Hitpoints_Factor_Vitality] = 4f; + //this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 3.051758E-05f; + this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 40f; // For now, this just adds 40 hitpoints to the hitpoints gained from vitality + this.Attributes[GameAttribute.Hitpoints_Total_From_Vitality] = this.Attributes[GameAttribute.Vitality] * this.Attributes[GameAttribute.Hitpoints_Factor_Vitality]; + this.Attributes[GameAttribute.Hitpoints_Max] = GetMaxTotalHitpoints(); + this.Attributes[GameAttribute.Hitpoints_Max_Total] = GetMaxTotalHitpoints(); + this.Attributes[GameAttribute.Hitpoints_Cur] = this.Attributes[GameAttribute.Hitpoints_Max_Total]; + + //Resource + this.Attributes[GameAttribute.Resource_Cur, this.ResourceID] = 200f; + this.Attributes[GameAttribute.Resource_Max, this.ResourceID] = 200f; + this.Attributes[GameAttribute.Resource_Max_Total, this.ResourceID] = 200f; + this.Attributes[GameAttribute.Resource_Effective_Max, this.ResourceID] = 200f; + this.Attributes[GameAttribute.Resource_Regen_Total, this.ResourceID] = 3.051758E-05f; + this.Attributes[GameAttribute.Resource_Type_Primary] = this.ResourceID; + + // Class specific + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + 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; + */ + //Secondary Resource for the Demon Hunter + int Discipline = this.ResourceID + 1; //0x00000006 + this.Attributes[GameAttribute.Resource_Cur, Discipline] = 30f; + this.Attributes[GameAttribute.Resource_Max, Discipline] = 30f; + this.Attributes[GameAttribute.Resource_Max_Total, Discipline] = 30f; + this.Attributes[GameAttribute.Resource_Effective_Max, Discipline] = 30f; + this.Attributes[GameAttribute.Resource_Type_Secondary] = Discipline; + break; + case ToonClass.Monk: + 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; + } + + //Movement + this.Attributes[GameAttribute.Movement_Scalar_Total] = 1f; + this.Attributes[GameAttribute.Movement_Scalar_Capped_Total] = 1f; + this.Attributes[GameAttribute.Movement_Scalar_Subtotal] = 1f; + this.Attributes[GameAttribute.Movement_Scalar] = 1f; + this.Attributes[GameAttribute.Walking_Rate_Total] = 0.2797852f; + this.Attributes[GameAttribute.Walking_Rate] = 0.2797852f; + this.Attributes[GameAttribute.Running_Rate_Total] = 0.3598633f; + this.Attributes[GameAttribute.Running_Rate] = 0.3598633f; + this.Attributes[GameAttribute.Sprinting_Rate_Total] = 3.051758E-05f; + this.Attributes[GameAttribute.Strafing_Rate_Total] = 3.051758E-05f; + + //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.IsTrialActor] = 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; + + + // TODO: Fix this shit! Should be actually done so after loading is complete /raist. + this.Attributes[GameAttribute.Banter_Cooldown, 0xFFFFF] = 0x000007C9; + this.Attributes[GameAttribute.Buff_Active, 0x20CBE] = true; + this.Attributes[GameAttribute.Buff_Active, 0x33C40] = false; + this.Attributes[GameAttribute.Immobolize] = false; + this.Attributes[GameAttribute.Untargetable] = false; + this.Attributes[GameAttribute.CantStartDisplayedPowers] = false; + this.Attributes[GameAttribute.Buff_Icon_Start_Tick0, 0x20CBE] = 0xC1; + this.Attributes[GameAttribute.Disabled] = false; + this.Attributes[GameAttribute.Hidden] = false; + this.Attributes[GameAttribute.Buff_Icon_Count0, 0x33C40] = 0; + this.Attributes[GameAttribute.Buff_Icon_End_Tick0, 0x20CBE] = 0x7C9; + this.Attributes[GameAttribute.Loading] = false; + this.Attributes[GameAttribute.Buff_Icon_End_Tick0, 0x33C40] = 0; + this.Attributes[GameAttribute.Invulnerable] = false; + this.Attributes[GameAttribute.Buff_Icon_Count0, 0x20CBE] = 1; + this.Attributes[GameAttribute.Buff_Icon_Start_Tick0, 0x33C40] = 0; + + #endregion // Attributes + + // unlocking assigned skills + for (int i = 0; i < this.SkillSet.ActiveSkills.Length; i++) + { + this.Attributes[GameAttribute.Skill, this.SkillSet.ActiveSkills[i]] = 1; + this.Attributes[GameAttribute.Skill_Total, this.SkillSet.ActiveSkills[i]] = 1; + } + + this.Inventory = new Inventory(this); // Here because it needs attributes /fasbat + } + + #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 AssignPassiveSkillMessage) OnAssignPassiveSkill(client, (AssignPassiveSkillMessage)message); + else if (message is PlayerChangeHotbarButtonMessage) OnPlayerChangeHotbarButtonMessage(client, (PlayerChangeHotbarButtonMessage)message); + else if (message is TargetMessage) OnObjectTargeted(client, (TargetMessage)message); + else if (message is PlayerMovementMessage) OnPlayerMovement(client, (PlayerMovementMessage)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 return; + } + + 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]; // 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; + } + } + // switch off old skill in hotbar + this.Attributes[GameAttribute.Skill, oldSNOSkill] = 0; + this.Attributes[GameAttribute.Skill_Total, oldSNOSkill] = 0; + } + // switch on new skill in hotbar + this.Attributes[GameAttribute.Skill, message.SNOSkill] = 1; + this.Attributes[GameAttribute.Skill_Total, message.SNOSkill] = 1; + this.Attributes.BroadcastChangedIfRevealed(); + + foreach (HotbarButtonData button in this.SkillSet.HotBarSkills.Where(button => button.SNOSkill == oldSNOSkill)) // loop through hotbar and replace the old skill with new one + { + button.SNOSkill = message.SNOSkill; + } + + this.SkillSet.ActiveSkills[message.SkillIndex] = message.SNOSkill; + this.UpdateHeroState(); + } + + private void OnAssignPassiveSkill(GameClient client, AssignPassiveSkillMessage message) + { + var oldSNOSkill = this.SkillSet.PassiveSkills[message.SkillIndex]; // find replaced skills SNO. + if (oldSNOSkill != -1) + { + // switch off old passive skill + this.Attributes[GameAttribute.Trait, oldSNOSkill] = 0; + this.Attributes[GameAttribute.Skill, oldSNOSkill] = 0; + this.Attributes[GameAttribute.Skill_Total, oldSNOSkill] = 0; + } + // switch on new passive skill + this.Attributes[GameAttribute.Trait, message.SNOSkill] = 1; + this.Attributes[GameAttribute.Skill, message.SNOSkill] = 1; + this.Attributes[GameAttribute.Skill_Total, message.SNOSkill] = 1; + this.Attributes.BroadcastChangedIfRevealed(); + this.SkillSet.PassiveSkills[message.SkillIndex] = message.SNOSkill; + this.UpdateHeroState(); + } + + 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) + { + 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, PlayerMovementMessage 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; + + if (message.Angle != null) + this.SetFacingRotation(message.Angle.Value); + + + var msg = new NotifyActorMovementMessage + { + ActorId = message.ActorId, + Position = this.Position, + Angle = message.Angle, + TurnImmediately = false, + Speed = message.Speed, + Field5 = message.Field5, + 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 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); + + this.InGameClient.SendTick(); // if there's available messages to send, will handle ticking and flush the outgoing buffer. + } + + #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. + } + + 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(); + } + + 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, + Gender = Toon.Gender, + PlayerSavedData = this.GetSavedData(), + QuestRewardHistoryEntriesCount = 0x00000000, + tQuestRewardHistory = QuestRewardHistory, + }; + } + + #endregion + + #region player attribute handling + + public float InitialAttack // Defines the amount of attack points with which a player starts + { + get + { + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + return 10f + ((this.Toon.Level - 1) * 2); + case ToonClass.DemonHunter: + return 10f + ((this.Toon.Level - 1) * 2); + case ToonClass.Monk: + return 10f + ((this.Toon.Level - 1) * 2); + case ToonClass.WitchDoctor: + return 10f + ((this.Toon.Level - 1) * 2); + case ToonClass.Wizard: + return 10f + ((this.Toon.Level - 1) * 2); + } + return 10f + (this.Toon.Level - 1) * 2; + } + } + + public float InitialPrecision // Defines the amount of precision points with which a player starts + { + get + { + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + return 9f + (this.Toon.Level - 1); + case ToonClass.DemonHunter: + return 11f + ((this.Toon.Level - 1) * 2); + case ToonClass.Monk: + return 11f + ((this.Toon.Level - 1) * 2); + case ToonClass.WitchDoctor: + return 9f + ((this.Toon.Level - 1) * 2); + case ToonClass.Wizard: + return 10f + ((this.Toon.Level - 1) * 2); + } + return 10f + ((this.Toon.Level - 1) * 2); + } + } + + public float InitialDefense // Defines the amount of defense points with which a player starts + { + get + { + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + return 11f + ((this.Toon.Level - 1) * 2); + case ToonClass.DemonHunter: + // For DH and Wizard, half the levels (starting with the first) give 2 defense => (Level / 2) * 2 + // and half give 1 defense => ((Level - 1) / 2) * 1 + // Note: We can't cancel the twos in ((Level - 1) / 2) * 2 because of integer divison + return 9f + (((this.Toon.Level / 2) * 2) + ((this.Toon.Level - 1) / 2)); + case ToonClass.Monk: + return 10f + ((this.Toon.Level - 1) * 2); + case ToonClass.WitchDoctor: + return 9f + ((this.Toon.Level - 1) * 2); + case ToonClass.Wizard: + return 8f + (((this.Toon.Level / 2) * 2) + ((this.Toon.Level - 1) / 2)); + } + return 10f + ((this.Toon.Level - 1) * 2); + } + } + + public float InitialVitality // Defines the amount of vitality points with which a player starts + { + get + { + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + return 11f + ((this.Toon.Level - 1) * 2); + case ToonClass.DemonHunter: + // For DH and Wizard, half the levels give 2 vit => ((Level - 1) / 2) * 2 + // and half (starting with the first) give 1 vit => (Level / 2) * 1 + // Note: We can't cancel the twos in ((Level - 1) / 2) * 2 because of integer divison + return 9f + ((((this.Toon.Level - 1) / 2) * 2) + (this.Toon.Level / 2)); + case ToonClass.Monk: + return 9f + (this.Toon.Level - 1); + case ToonClass.WitchDoctor: + return 10f + (this.Toon.Level - 1); + case ToonClass.Wizard: + return 9f + ((((this.Toon.Level - 1) / 2) * 2) + (this.Toon.Level / 2)); + } + return 10f + ((this.Toon.Level - 1) * 2); + } + } + + // Notes on attribute increment algorithm: + // Precision: Barbarian => +1, else => +2 + // Defense: Wizard or Demon Hunter => (lvl+1)%2+1, else => +2 + // Vitality: Wizard or Demon Hunter => lvl%2+1, Barbarian => +2, else +1 + // Attack: All +2 + public float AttackIncrement + { + get + { + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + return 2f; + case ToonClass.DemonHunter: + return 2f; + case ToonClass.Monk: + return 2f; + case ToonClass.WitchDoctor: + return 2f; + case ToonClass.Wizard: + return 2f; + } + return 2f; + } + } + + public float VitalityIncrement + { + get + { + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + return 2f; + case ToonClass.DemonHunter: + return (this.Attributes[GameAttribute.Level] % 2) + 1f; + case ToonClass.Monk: + return 1f; + case ToonClass.WitchDoctor: + return 1f; + case ToonClass.Wizard: + return (this.Attributes[GameAttribute.Level] % 2) + 1f; + } + return 1f; + } + } + + public float DefenseIncrement + { + get + { + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + return 2f; + case ToonClass.DemonHunter: + return ((this.Attributes[GameAttribute.Level] + 1) % 2) + 1f; + case ToonClass.Monk: + return 2f; + case ToonClass.WitchDoctor: + return 2f; + case ToonClass.Wizard: + return ((this.Attributes[GameAttribute.Level] + 1) % 2) + 1f; + } + return 2f; + } + } + + public float PrecisionIncrement + { + get + { + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + return 1f; + case ToonClass.DemonHunter: + return 2f; + case ToonClass.Monk: + return 2f; + case ToonClass.WitchDoctor: + return 2f; + case ToonClass.Wizard: + return 2f; + } + return 2f; + } + } + #endregion + + #region saved-data + + private PlayerSavedData GetSavedData() + { + return new PlayerSavedData() + { + HotBarButtons = this.SkillSet.HotBarSkills, + SkilKeyMappings = this.SkillKeyMappings, + + PlaytimeTotal = 0x00000000, + WaypointFlags = 0x7FFFFFFF, + + Field4 = new HirelingSavedData() + { + HirelingInfos = this.HirelingInfo, + Field1 = 0x00000000, + Field2 = 0x00000002, + }, + + Field5 = 0x00006A770, + + LearnedLore = this.LearnedLore, + snoActiveSkills = this.SkillSet.ActiveSkills, + snoTraits = this.SkillSet.PassiveSkills, + SavePointData = new SavePointData { snoWorld = -1, SavepointId = -1, }, + m_SeenTutorials = this.SeenTutorials, + }; + } + + 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 = 0x00000000, Field3 = 0x0000, Field4 = false, Skill1SNOId = -1, Skill2SNOId = -1, Skill3SNOId = -1, Skill4SNOId = -1, }, + new HirelingInfo { HirelingIndex = 0x00000001, Field1 = -1, Level = 20, Field3 = 0x00003C19, Field4 = false, Skill1SNOId = 0x000006D3, Skill2SNOId = -1, Skill3SNOId = -1, Skill4SNOId = -1, }, + new HirelingInfo { HirelingIndex = 0x00000002, Field1 = -1, Level = 25, Field3 = 0x00003C19, Field4 = false, Skill1SNOId = -1, Skill2SNOId = -1, Skill3SNOId = -1, Skill4SNOId = -1, }, + new HirelingInfo { HirelingIndex = 0x00000003, Field1 = -1, Level = 30, Field3 = 0x00003C19, 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.Owner.BannerConfiguration) + .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 static int GetClassSNOId(int gender, ToonClass @class) + { + if(gender==0) // male + { + switch(@class) + { + case ToonClass.Barbarian: + return 0x0CE5; + case ToonClass.DemonHunter: + return 0x0125C7; + case ToonClass.Monk: + return 0x1271; + case ToonClass.WitchDoctor: + return 0x1955; + case ToonClass.Wizard: + return 0x1990; + } + } + else // female + { + switch (@class) + { + case ToonClass.Barbarian: + return 0x0CD5; + case ToonClass.DemonHunter: + return 0x0123D2; + case ToonClass.Monk: + return 0x126D; + case ToonClass.WitchDoctor: + return 0x1951; + case ToonClass.Wizard: + return 0x197E; + } + } + return 0x0; + } + + public int ClassSNO + { + get + { + if (this.Toon.Gender == 0) + { + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + return 0x0CE5; + case ToonClass.DemonHunter: + return 0x0125C7; + case ToonClass.Monk: + return 0x1271; + case ToonClass.WitchDoctor: + return 0x1955; + case ToonClass.Wizard: + return 0x1990; + } + } + else + { + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + return 0x0CD5; + case ToonClass.DemonHunter: + return 0x0123D2; + case ToonClass.Monk: + return 0x126D; + case ToonClass.WitchDoctor: + return 0x1951; + case ToonClass.Wizard: + return 0x197E; + } + } + return 0x0; + } + } + + 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 ResourceID + { + get + { + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + return 0x00000002; + case ToonClass.DemonHunter: + return 0x00000005; + case ToonClass.Monk: + return 0x00000003; + case ToonClass.WitchDoctor: + return 0x00000000; + case ToonClass.Wizard: + return 0x00000001; + } + return 0x00000000; + } + } + + public int SkillKit + { + get + { + switch (this.Toon.Class) + { + case ToonClass.Barbarian: + return 0x00008AF4; + case ToonClass.DemonHunter: + return 0x00008AFC; + case ToonClass.Monk: + return 0x00008AFA; + case ToonClass.WitchDoctor: + return 0x00008AFF; + case ToonClass.Wizard: + return 0x00008B00; + } + return 0x00000001; + } + } + + #endregion + + #region queries + + public List GetRevealedObjects() where T : class, IRevealable + { + return this.RevealedObjects.Values.OfType().Select(@object => @object).ToList(); + } + + #endregion + + #region experience handling + + private float GetMaxTotalHitpoints() + { + // Defines the Max Total hitpoints for the current level + // May want to move this into a property if it has to made class-specific + // This is still a work in progress on getting the right algorithm for all the classes + + return (this.Attributes[GameAttribute.Hitpoints_Total_From_Vitality]) + + (this.Attributes[GameAttribute.Hitpoints_Total_From_Level]); + } + + public static int[] LevelBorders = + { + 0, 1200, 2250, 4000, 6050, 8500, 11700, 15400, 19500, 24000, /* Level 1-10 */ + 28900, 34200, 39900, 44100, 45000, 46200, 48300, 50400, 52500, 54600, /* Level 11-20 */ + 56700, 58800, 60900, 63000, 65100, 67200, 69300, 71400, 73500, 75600, /* 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 + if ((this.Attributes[GameAttribute.Experience_Next] <= 0) && (this.Attributes[GameAttribute.Level] < this.Attributes[GameAttribute.Level_Cap])) + { + this.Attributes[GameAttribute.Level]++; + this.Toon.LevelUp(); + if (this.Attributes[GameAttribute.Level] < this.Attributes[GameAttribute.Level_Cap]) { this.Attributes[GameAttribute.Experience_Next] = this.Attributes[GameAttribute.Experience_Next] + LevelBorders[this.Attributes[GameAttribute.Level]]; } + else { this.Attributes[GameAttribute.Experience_Next] = 0; } + + // 4 main attributes are incremented according to class + this.Attributes[GameAttribute.Attack] += (int)this.AttackIncrement; + this.Attributes[GameAttribute.Precision] += (int)this.PrecisionIncrement; + this.Attributes[GameAttribute.Vitality] += (int)this.VitalityIncrement; + this.Attributes[GameAttribute.Defense] += (int)this.DefenseIncrement; + + // Hitpoints from level may actually change. This needs to be verified by someone with the beta. + //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. + this.Attributes[GameAttribute.Hitpoints_Total_From_Vitality] = this.Attributes[GameAttribute.Vitality] * this.Attributes[GameAttribute.Hitpoints_Factor_Vitality]; + this.Attributes[GameAttribute.Hitpoints_Max] = GetMaxTotalHitpoints(); + 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]; + + this.Attributes.BroadcastChangedIfRevealed(); + + this.InGameClient.SendMessage(new PlayerLevel() + { + Field0 = 0x00000000, + Field1 = this.Attributes[GameAttribute.Level], + }); + + this.InGameClient.SendMessage(new PlayEffectMessage() + { + ActorId = this.DynamicID, + Effect = Effect.LevelUp, + }); + + this.World.BroadcastGlobal(new PlayEffectMessage() + { + ActorId = this.DynamicID, + Effect = Effect.PlayEffectGroup, + OptionalParameter = LevelUpEffects[this.Attributes[GameAttribute.Level]], + }); + } + + // constant 0 exp at Level_Cap + if (this.Attributes[GameAttribute.Experience_Next] < 0) + { + this.Attributes[GameAttribute.Experience_Next] = 0; + + } + this.Attributes.BroadcastChangedIfRevealed(); + //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]) / 100; + this.AddHP(quantity); + } + + public void AddHP(float quantity) + { + if (this.Attributes[GameAttribute.Hitpoints_Cur] + quantity >= this.Attributes[GameAttribute.Hitpoints_Max]) + this.Attributes[GameAttribute.Hitpoints_Cur] = this.Attributes[GameAttribute.Hitpoints_Max]; + else + this.Attributes[GameAttribute.Hitpoints_Cur] = this.Attributes[GameAttribute.Hitpoints_Cur] + quantity; + + this.InGameClient.SendMessage(new FloatingNumberMessage() + { + ActorID = this.DynamicID, + Number = quantity, + Type = FloatingNumberMessage.FloatType.Green + }); + + } + + #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) + { + // TODO: Fixme + // play lore to player + //InGameClient.SendMessage(new Mooege.Net.GS.Message.Definitions.Quest.LoreMessage + //{ + // Id = (int)(immediately ? Opcodes.PlayLoreImmediately : Opcodes.PlayLoreWithButton), + // 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, CubeOfNephalem, CauldonOfJourdan + + public void EnableStoneOfRecall() + { + Attributes[GameAttribute.Skill, 0x0002EC66] = 1; + Attributes[GameAttribute.Skill_Total, 0x0002EC66] = 1; + Attributes.SendChangedMessage(this.InGameClient); + } + + public void EnableCauldronOfJordan() + { + Attributes[GameAttribute.ItemMeltUnlocked] = true; + Attributes.SendChangedMessage(this.InGameClient); + } + + public void EnableCubeOfNephalem() + { + Attributes[GameAttribute.SalvageUnlocked] = true; + Attributes.SendChangedMessage(this.InGameClient); + } + + #endregion + + } +} diff --git a/src/Mooege/Core/GS/Skills/SkillSet.cs b/src/Mooege/Core/GS/Skills/SkillSet.cs new file mode 100644 index 00000000..9deb1575 --- /dev/null +++ b/src/Mooege/Core/GS/Skills/SkillSet.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.Linq; +using Mooege.Core.MooNet.Toons; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Core.GS.Skills +{ + public class SkillSet + { + public ToonClass @Class; + + public int[] ActiveSkills; + public HotbarButtonData[] HotBarSkills; + public int[] PassiveSkills; + + public SkillSet(ToonClass @class) + { + this.@Class = @class; + + this.ActiveSkills = Skills.GetAllActiveSkillsByClass(this.@Class).Take(6).ToArray(); + + this.HotBarSkills = new HotbarButtonData[9] { + new HotbarButtonData { SNOSkill = ActiveSkills[4], ItemGBId = -1 }, // left-click + new HotbarButtonData { SNOSkill = ActiveSkills[5], ItemGBId = -1 }, // right-click + new HotbarButtonData { SNOSkill = ActiveSkills[0], ItemGBId = -1 }, // hidden-bar - left-click switch - which key?? + new HotbarButtonData { SNOSkill = ActiveSkills[1], ItemGBId = -1 }, // hidden-bar - right-click switch (press x ingame) + new HotbarButtonData { SNOSkill = ActiveSkills[0], ItemGBId = -1 }, // bar-1 + new HotbarButtonData { SNOSkill = ActiveSkills[1], ItemGBId = -1 }, // bar-2 + new HotbarButtonData { SNOSkill = ActiveSkills[2], ItemGBId = -1 }, // bar-3 + new HotbarButtonData { SNOSkill = ActiveSkills[3], ItemGBId = -1 }, // bar-4 + new HotbarButtonData { SNOSkill = Skills.None, ItemGBId = 0x622256D4 } // bar-5 - potion + }; + + this.PassiveSkills = new int[3] { -1, -1, -1 }; // setting passive skills here crashes the client, need to figure out the reason. /raist. + } + } +} diff --git a/src/Mooege/Core/GS/Skills/Skills.cs b/src/Mooege/Core/GS/Skills/Skills.cs new file mode 100644 index 00000000..43b39895 --- /dev/null +++ b/src/Mooege/Core/GS/Skills/Skills.cs @@ -0,0 +1,696 @@ +/* + * 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.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..f957d8bd --- /dev/null +++ b/src/Mooege/Core/GS/Ticker/SteppedTickTimer.cs @@ -0,0 +1,185 @@ +/* + * 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.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..8d0c0f3b --- /dev/null +++ b/src/Mooege/Core/GS/Ticker/TickTimer.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 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) + { + 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..55f1e145 --- /dev/null +++ b/src/Mooege/Core/GS/Web/GSWebService.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.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..b14b67ac --- /dev/null +++ b/src/Mooege/Core/MooNet/Accounts/Account.cs @@ -0,0 +1,324 @@ +/* + * 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.Data.SQLite; +using System.Linq; +using Mooege.Common.Storage; +using Mooege.Core.Cryptography; +using Mooege.Core.MooNet.Friends; +using Mooege.Core.MooNet.Helpers; +using Mooege.Core.MooNet.Objects; +using Mooege.Core.MooNet.Toons; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Accounts +{ + public class Account : PersistentRPCObject + { + public bnet.protocol.EntityId BnetAccountID { get; private set; } + public bnet.protocol.EntityId BnetGameAccountID { get; private set; } + public D3.Account.BannerConfiguration BannerConfiguration { get; private set; } + public D3.PartyMessage.ScreenStatus ScreenStatus { get; set; } + public List Achievements { get; set; } + public List AchievementCriteria { get; set; } + + public string Email { get; private set; } // I - Username + public byte[] Salt { get; private set; } // s- User's salt. + public byte[] PasswordVerifier { get; private set; } // v - password verifier. + public UserLevels UserLevel { get; private set; } // user level for account. + + public bool IsOnline { get { return this.LoggedInClient != null; } } + + private static readonly D3.OnlineService.EntityId AccountHasNoToons = + D3.OnlineService.EntityId.CreateBuilder().SetIdHigh(0).SetIdLow(0).Build(); + + public D3.Account.Digest Digest + { + get + { + var builder = D3.Account.Digest.CreateBuilder().SetVersion(100) // 7447=>99, 7728=> 100 /raist. + .SetBannerConfiguration(this.BannerConfiguration) + .SetFlags(0); + + D3.OnlineService.EntityId lastPlayedHeroId; + if(Toons.Count>0) + { + lastPlayedHeroId = Toons.First().Value.D3EntityID; // we should actually hold player's last hero in database. /raist + this.LoggedInClient.CurrentToon = Toons.First().Value; + } + else + { + lastPlayedHeroId = AccountHasNoToons; + } + + builder.SetLastPlayedHeroId(lastPlayedHeroId); + return builder.Build(); + } + } + + private MooNetClient _loggedInClient; + + public MooNetClient LoggedInClient + { + get + { + return this._loggedInClient; + } + set + { + this._loggedInClient = value; + + // notify friends. + if (FriendManager.Friends[this.BnetAccountID.Low].Count == 0) return; // if account has no friends just skip. + + var fieldKey = FieldKeyHelper.Create(FieldKeyHelper.Program.BNet, 1, 2, 0); + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetBoolValue(this.IsOnline).Build()).Build(); + var operation = bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field).Build(); + + var state = bnet.protocol.presence.ChannelState.CreateBuilder().SetEntityId(this.BnetAccountID).AddFieldOperation(operation).Build(); + var channelState = bnet.protocol.channel.ChannelState.CreateBuilder().SetExtension(bnet.protocol.presence.ChannelState.Presence, state); + var notification = bnet.protocol.channel.UpdateChannelStateNotification.CreateBuilder().SetStateChange(channelState).Build(); + + foreach (var friend in FriendManager.Friends[this.BnetAccountID.Low]) + { + var account = AccountManager.GetAccountByPersistentID(friend.Id.Low); + if (account == null || account.LoggedInClient == null) return; // only send to friends that are online. + + // make the rpc call. + account.LoggedInClient.MakeTargetedRPC(this, ()=> + bnet.protocol.channel.ChannelSubscriber.CreateStub(account.LoggedInClient).NotifyUpdateChannelState(null, notification,callback => { })); + } + } + } + + public Dictionary Toons + { + get { return ToonManager.GetToonsForAccount(this); } + } + + public Account(ulong persistentId, string email, byte[] salt, byte[] passwordVerifier, UserLevels userLevel) // Account with given persistent ID + : base(persistentId) + { + this.SetFields(email,salt, passwordVerifier, userLevel); + } + + public Account(string email, string password, UserLevels userLevel) // Account with **newly generated** persistent ID + : base() + { + if (password.Length > 16) password = password.Substring(0, 16); // make sure the password does not exceed 16 chars. + + var salt = SRP6a.GetRandomBytes(32); + var passwordVerifier = SRP6a.CalculatePasswordVerifierForAccount(email, password, salt); + + this.SetFields(email, salt, passwordVerifier, userLevel); + } + + private static ulong? _persistentIdCounter = null; + protected override ulong GenerateNewPersistentId() + { + if (_persistentIdCounter == null) + _persistentIdCounter = AccountManager.GetNextAvailablePersistentId(); + + return (ulong)++_persistentIdCounter; + } + + private void SetFields(string email, byte[] salt, byte[] passwordVerifier, UserLevels userLevel) + { + this.Email = email; + this.Salt = salt; + this.PasswordVerifier = passwordVerifier; + this.UserLevel = userLevel; + + this.BnetAccountID = bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.AccountId).SetLow(this.PersistentID).Build(); + this.BnetGameAccountID = bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.GameAccountId).SetLow(this.PersistentID).Build(); + this.BannerConfiguration = D3.Account.BannerConfiguration.CreateBuilder() + .SetBannerShape(2952440006) + .SetSigilMain(976722430) + .SetSigilAccent(803826460) + .SetPatternColor(1797588777) + .SetBackgroundColor(1379006192) + .SetSigilColor(1797588777) + .SetSigilPlacement(3057352154) + .SetPattern(4173846786) + .SetUseSigilVariant(true) + .SetEpicBanner(0) + .Build(); + + this.Achievements = new List(); + this.AchievementCriteria = new List(); + } + + 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 selected toon. + { + if(this.LoggedInClient!=null) // check if the account is online actually. + field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(this.LoggedInClient.CurrentToon.D3EntityID.ToByteString()).Build()); + } + else + { + Logger.Warn("Unknown query-key: {0}, {1}, {2}", queryKey.Program, queryKey.Group, queryKey.Field); + } + break; + case FieldKeyHelper.Program.BNet: + Logger.Warn("Unknown query-key: {0}, {1}, {2}", queryKey.Program, queryKey.Group, queryKey.Field); + break; + } + + + return field.HasValue ? field.Build() : null; + } + + protected override void NotifySubscriptionAdded(MooNetClient client) + { + var operations = new List(); + + // Selected toon + if (this.LoggedInClient != null && this.Digest.LastPlayedHeroId != AccountHasNoToons) + { + var selectedToonKey = FieldKeyHelper.Create(FieldKeyHelper.Program.D3, 1, 1, 0); + var selectedToonField = bnet.protocol.presence.Field.CreateBuilder().SetKey(selectedToonKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(this.Digest.LastPlayedHeroId.ToByteString()).Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(selectedToonField).Build()); + } + + // RealID name field - NOTE: Probably won't ever use this for its actual purpose, but showing the email in final might not be a good idea + var realNameKey = FieldKeyHelper.Create(FieldKeyHelper.Program.BNet,1, 1, 0); + var realNameField = bnet.protocol.presence.Field.CreateBuilder().SetKey(realNameKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetStringValue(this.Email).Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(realNameField).Build()); + + // Account online? + var accountOnlineKey = FieldKeyHelper.Create(FieldKeyHelper.Program.BNet, 1, 2, 0); + var accountOnlineField = bnet.protocol.presence.Field.CreateBuilder().SetKey(accountOnlineKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetBoolValue(this.IsOnline).Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(accountOnlineField).Build()); + + // toon list + foreach(var pair in this.Toons) + { + var toonKey = FieldKeyHelper.Create(FieldKeyHelper.Program.BNet, 1, 4, 0); + var toonField = bnet.protocol.presence.Field.CreateBuilder().SetKey(toonKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(pair.Value.BnetEntityID.ToByteString()).Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(toonField).Build()); + } + + var tempNameKey = FieldKeyHelper.Create(FieldKeyHelper.Program.BNet, 1, 5, 0); + var tempNameField = bnet.protocol.presence.Field.CreateBuilder().SetKey(tempNameKey).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetStringValue("NICKTEMPNAME").Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(tempNameField).Build()); + + // Create a presence.ChannelState + var state = bnet.protocol.presence.ChannelState.CreateBuilder().SetEntityId(this.BnetAccountID).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.AddNotification.CreateBuilder().SetChannelState(channelState); + + // Make the rpc call + client.MakeTargetedRPC(this, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(client).NotifyAdd(null, notification.Build(), callback => { })); + } + + 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); + } + + public void SaveToDB() + { + try + { + var query = string.Format("INSERT INTO accounts (id, email, salt, passwordVerifier, userLevel) VALUES({0}, '{1}', @salt, @passwordVerifier, {2})", + this.PersistentID, this.Email, (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 void 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()"); + } + } + + 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()"); + } + } + + public override string ToString() + { + return String.Format("{{ Account: {0} [lowId: {1}] }}", this.Email, this.BnetAccountID.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..332a4675 --- /dev/null +++ b/src/Mooege/Core/MooNet/Accounts/AccountCommands.cs @@ -0,0 +1,183 @@ +/* + * 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.Core.MooNet.Commands; +using Mooege.Core.MooNet.Toons; +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() < 2) + return "Invalid arguments. Type 'help account add' to get help."; + + var email = @params[0]; + var password = @params[1]; + var userLevel = Account.UserLevels.User; + + if (@params.Count() == 3) + { + var level = @params[2].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 (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, userLevel); + return string.Format("Created new account {0} [user-level: {1}].", account.Email, account.UserLevel); + } + + [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 toons of the account. + foreach (var toon in ToonManager.GetToonsForAccount(account).Values) + { + ToonManager.DeleteToon(toon); + } + + 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."; + + account.UpdatePassword(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 ", 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."; + } + + account.UpdateUserLevel(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..fa9feef8 --- /dev/null +++ b/src/Mooege/Core/MooNet/Accounts/AccountManager.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; +using System.Collections.Generic; +using System.Data.SQLite; +using System.Linq; +using Mooege.Common.Logging; +using Mooege.Common.Storage; + +namespace Mooege.Core.MooNet.Accounts +{ + public static class AccountManager + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + private static readonly Dictionary Accounts = new Dictionary(); + public static List AccountsList { get { return Accounts.Values.ToList(); } } + + public static int TotalAccounts + { + get { return Accounts.Count; } + } + + static AccountManager() + { + LoadAccounts(); + } + + public static Account GetAccountByEmail(string email) + { + return Accounts.ContainsKey(email) ? Accounts[email] : null; + } + + public static Account CreateAccount(string email, string password, Account.UserLevels userLevel = Account.UserLevels.User) + { + var account = new Account(email, password, userLevel); + Accounts.Add(email, account); + account.SaveToDB(); + + return account; + } + + public static Account GetAccountByPersistentID(ulong persistentId) + { + return Accounts.Where(account => account.Value.PersistentID == persistentId).Select(account => account.Value).FirstOrDefault(); + } + + public static bool DeleteAccount(Account account) + { + if (account == null) return false; + if (!Accounts.ContainsKey(account.Email)) return false; + + try + { + var query = string.Format("DELETE from accounts where id={0}", account.PersistentID); + var cmd = new SQLiteCommand(query, DBManager.Connection); + cmd.ExecuteNonQuery(); + } + catch(Exception e) + { + Logger.ErrorException(e, "DeleteAccount()"); + return false; + } + + Accounts.Remove(account.Email); + // we should be also disconnecting the account if he's online. /raist. + + return true; + } + + private static void LoadAccounts() + { + var query = "SELECT * from accounts"; + var cmd = new SQLiteCommand(query, DBManager.Connection); + var reader = cmd.ExecuteReader(); + + if (!reader.HasRows) return; + + while (reader.Read()) + { + var accountId = (ulong)reader.GetInt64(0); + var email = reader.GetString(1); + + var salt = new byte[32]; + var readBytes = reader.GetBytes(2, 0, salt, 0, 32); + + var passwordVerifier = new byte[128]; + readBytes = reader.GetBytes(3, 0, passwordVerifier, 0, 128); + + var userLevel = (byte) reader.GetByte(4); + + var account = new Account(accountId, email, salt, passwordVerifier, (Account.UserLevels)userLevel); + Accounts.Add(email, account); + } + } + + public static ulong GetNextAvailablePersistentId() + { + var cmd = new SQLiteCommand("SELECT max(id) from accounts", DBManager.Connection); + try + { + return Convert.ToUInt64(cmd.ExecuteScalar()); + } + catch (InvalidCastException) + { + return 0; + } + } + } +} diff --git a/src/Mooege/Core/MooNet/Achievement/AchievementManager.cs b/src/Mooege/Core/MooNet/Achievement/AchievementManager.cs new file mode 100644 index 00000000..6ae46027 --- /dev/null +++ b/src/Mooege/Core/MooNet/Achievement/AchievementManager.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.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..a96a4e68 --- /dev/null +++ b/src/Mooege/Core/MooNet/Authentication/AuthManager.cs @@ -0,0 +1,119 @@ +/* + * 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 Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Common.Versions; +using Mooege.Core.Cryptography; +using Mooege.Core.MooNet.Accounts; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Authentication +{ + public static class AuthManager + { + private static readonly Logger Logger = LogManager.CreateLogger(); + + private 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) + { + 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.AuthenticationCompleteSignal.Set(); + return; + } + + var srp6a = new SRP6a(account); // create srp6 handler to process the authentication. + OngoingAuthentications.Add(client, srp6a); + + // request client to load password.dll for authentication. + var moduleLoadRequest = bnet.protocol.authentication.ModuleLoadRequest.CreateBuilder() + .SetModuleHandle(bnet.protocol.ContentHandle.CreateBuilder() + .SetRegion(0x00005553) // us + .SetUsage(0x61757468) // auth - password.dll + .SetHash(ByteString.CopyFrom(VersionInfo.MooNet.AuthModuleHashMap[client.Platform]))) + .SetMessage(ByteString.CopyFrom(srp6a.LogonChallenge)) + .Build(); + + client.MakeRPCWithListenerId(request.ListenerId, () => + bnet.protocol.authentication.AuthenticationClient.CreateStub(client).ModuleLoad(null, moduleLoadRequest, ModuleLoadResponse)); + } + + 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 authentication is sucesseful or password check's are disabled. + { + // 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.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; + } + + OngoingAuthentications.Remove(client); + client.AuthenticationCompleteSignal.Set(); // signal about completion of authentication processes so we can return the response for AuthenticationService:LogonRequest. + } + + 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..ad97482f --- /dev/null +++ b/src/Mooege/Core/MooNet/Authentication/Config.cs @@ -0,0 +1,29 @@ +/* + * 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 Mooege.Core.MooNet.Authentication +{ + public sealed class Config : Mooege.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..45dce180 --- /dev/null +++ b/src/Mooege/Core/MooNet/Authentication/VersionChecker.cs @@ -0,0 +1,74 @@ +/* + * 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 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 "enUS": + client.Locale = MooNetClient.ClientLocale.enUS; + 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. + } + } +} diff --git a/src/Mooege/Core/MooNet/Channels/Channel.cs b/src/Mooege/Core/MooNet/Channels/Channel.cs new file mode 100644 index 00000000..20dca39b --- /dev/null +++ b/src/Mooege/Core/MooNet/Channels/Channel.cs @@ -0,0 +1,378 @@ +/* + * 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.MooNet.Helpers; +using Mooege.Core.MooNet.Objects; +using Mooege.Core.MooNet.Toons; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Channels +{ + public class Channel : RPCObject + { + /// + /// bnet.protocol.EntityId encoded channel Id. + /// + public bnet.protocol.EntityId BnetEntityId { get; protected set; } + + /// + /// 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; } + + /// + /// 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(); + + /// + /// Channel owner. + /// + public MooNetClient Owner { get; protected 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, 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; + + 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 HasToon(Toon toon) // checks if given toon is already channels member + { + return this.Members.Any(pair => pair.Value.Identity.ToonId.Low == toon.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, false, true); + + bool isOwner = client == this.Owner; + var addedMember = new Member(identity, (isOwner) ? Member.Privilege.UnkCreator : Member.Privilege.UnkMember); + + 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; + + // added member should recieve a NotifyAdd. + var addNotification = bnet.protocol.channel.AddNotification.CreateBuilder() + .SetChannelState(channelState) + .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 => { })); + + 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.ToonId == 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.CurrentToon == null) + { + Logger.Warn("Could not remove toon-less client {0}", client.Connection.RemoteEndPoint.ToString()); + return; + } + else if (!HasUser(client)) + { + Logger.Warn("Attempted to remove non-member client {0} from channel", client.Connection.RemoteEndPoint.ToString()); + return; + } + else if (client.CurrentChannel != this) + { + Logger.Warn("Client {0} is being removed from a channel that is not its current one..", client.Connection.RemoteEndPoint.ToString()); + } + var memberId = this.Members[client].Identity.ToonId; + var message = bnet.protocol.channel.RemoveNotification.CreateBuilder() + .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; + + if (client == this.Owner) + this.Owner = null; + + if (this.Members.Count == 0 && !dissolving) + Dissolve(); + } + + #endregion + + #region channel-messaging + + public void SendMessage(MooNetClient client, bnet.protocol.channel.Message message) + { + var notification = + bnet.protocol.channel.SendMessageNotification.CreateBuilder().SetAgentId(client.CurrentToon.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.CurrentToon.ToString() : "N/A"); + } + } +} diff --git a/src/Mooege/Core/MooNet/Channels/ChannelInvitationManager.cs b/src/Mooege/Core/MooNet/Channels/ChannelInvitationManager.cs new file mode 100644 index 00000000..0c52f3ae --- /dev/null +++ b/src/Mooege/Core/MooNet/Channels/ChannelInvitationManager.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.Collections.Generic; +using System.Linq; +using Mooege.Core.MooNet.Objects; +using Mooege.Core.MooNet.Toons; +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 void HandleInvitation(MooNetClient client, bnet.protocol.invitation.Invitation invitation) + { + var invitee = this.Subscribers.FirstOrDefault(subscriber => subscriber.CurrentToon.BnetEntityID.Low == invitation.InviteeIdentity.ToonId.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.Invitation.ChannelInvitation).ChannelDescription.ChannelId); + + channel.Join(client, request.ObjectId); // add invitee to channel -- so inviter and other members will also be notified too. + + var notification = bnet.protocol.channel_invitation.InvitationRemovedNotification.CreateBuilder().SetInvitation(invitation).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 => { })); + + 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 = ToonManager.GetToonByLowID(invitation.InviterIdentity.ToonId.Low); + if (inviter == null || inviter.Owner.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.Owner.LoggedInClient.MakeTargetedRPC(inviter.Owner.LoggedInClient.CurrentChannel, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(inviter.Owner.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]; + + //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(client.CurrentChannel, () => + 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 = ToonManager.GetToonByLowID(invitation.InviteeIdentity.ToonId.Low); + invitee.Owner.LoggedInClient.MakeTargetedRPC(this, () => + bnet.protocol.channel_invitation.ChannelInvitationNotify.CreateStub(invitee.Owner.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..ee753279 --- /dev/null +++ b/src/Mooege/Core/MooNet/Channels/ChannelManager.cs @@ -0,0 +1,90 @@ +/* + * 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 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(); + + private readonly static Dictionary Channels = + new Dictionary(); + + public static Channel CreateNewChannel(MooNetClient client, ulong remoteObjectId) + { + var channel = new Channel(client, 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..37223df0 --- /dev/null +++ b/src/Mooege/Core/MooNet/Channels/Member.cs @@ -0,0 +1,106 @@ +/* + * 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; + +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.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); + } + 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) + { + this.Identity = identity; + this.Privileges = privs; + this.Roles = new List(); + } + + public Member(bnet.protocol.Identity identity, Privilege privs, params Role[] roles) + { + this.Identity = identity; + this.Privileges = privs; + this.Roles = new List(); + AddRoles(roles); + } + + 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..7a7b2861 --- /dev/null +++ b/src/Mooege/Core/MooNet/Commands/CommandAttribute.cs @@ -0,0 +1,84 @@ +/* + * 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.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..971370ae --- /dev/null +++ b/src/Mooege/Core/MooNet/Commands/CommandGroup.cs @@ -0,0 +1,140 @@ +/* + * 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 System.Reflection; +using Mooege.Common; +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..204554b6 --- /dev/null +++ b/src/Mooege/Core/MooNet/Commands/CommandManager.cs @@ -0,0 +1,211 @@ +/* + * 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.Reflection; +using Mooege.Common; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Channels; +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..b51c27f8 --- /dev/null +++ b/src/Mooege/Core/MooNet/Commands/Config.cs @@ -0,0 +1,29 @@ +/* + * 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 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..92f3d2d4 --- /dev/null +++ b/src/Mooege/Core/MooNet/Commands/DebugCommands.cs @@ -0,0 +1,129 @@ +/* + * 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.Helpers.Hash; +using Mooege.Core.MooNet.Accounts; +using Mooege.Core.MooNet.Objects; +using Mooege.Core.MooNet.Services; +using Mooege.Net.MooNet; +using Mooege.Common.Helpers; + +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."; + + 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); + + client = account.LoggedInClient; + if (client == null) + return string.Format("Account '{0}' is not logged in.", email); + } + + var output = string.Format("Imported service list for client: {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..8a710e4f --- /dev/null +++ b/src/Mooege/Core/MooNet/Commands/ServerCommands.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; +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..8d50d249 --- /dev/null +++ b/src/Mooege/Core/MooNet/Friends/FriendManager.cs @@ -0,0 +1,206 @@ +/* + * 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.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() + { + LoadFriendships(); + } + + public static void HandleInvitation(MooNetClient client, bnet.protocol.invitation.Invitation invitation) + { + var invitee = Instance.Subscribers.FirstOrDefault(subscriber => subscriber.Account.BnetAccountID.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. + + OnGoingInvitations.Add(invitation.Id, invitation); // track ongoing invitations so we can tranport it forth and back. + + var notification = bnet.protocol.friends.InvitationAddedNotification.CreateBuilder().SetInvitation(invitation); + + invitee.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(invitee).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.InvitationRemovedNotification.CreateBuilder() + .SetInvitation(invitation) + .SetReason((uint)InvitationRemoveReason.Accepted) // success? + .SetAddedFriend(inviteeAsFriend).Build(); + + inviter.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(inviter.LoggedInClient).NotifyReceivedInvitationRemoved(null, notificationToInviter,callback => { })); + + var notificationToInvitee = bnet.protocol.friends.InvitationRemovedNotification.CreateBuilder() + .SetInvitation(invitation) + .SetReason((uint)InvitationRemoveReason.Accepted) // success? + .SetAddedFriend(inviterAsFriend).Build(); + + invitee.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(invitee.LoggedInClient).NotifyReceivedInvitationRemoved(null, notificationToInvitee,callback => { })); + + Friends.Add(invitee.BnetAccountID.Low, inviterAsFriend); + Friends.Add(inviter.BnetAccountID.Low, inviteeAsFriend); + AddFriendshipToDB(inviter,invitee); + + // send friend added notification to inviter + var friendAddedNotificationToInviter = bnet.protocol.friends.FriendNotification.CreateBuilder().SetTarget(inviteeAsFriend).Build(); + + inviter.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(inviter.LoggedInClient).NotifyFriendAdded(null, friendAddedNotificationToInviter, callback => { })); + + // send friend added notification to invitee + var friendAddedNotificationToInvitee = bnet.protocol.friends.FriendNotification.CreateBuilder().SetTarget(inviterAsFriend).Build(); + + invitee.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(invitee.LoggedInClient).NotifyFriendAdded(null, friendAddedNotificationToInvitee, 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.InvitationRemovedNotification.CreateBuilder() + .SetInvitation(invitation) + .SetReason((uint)InvitationRemoveReason.Declined).Build(); + + inviter.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(inviter.LoggedInClient).NotifyReceivedInvitationRemoved(null, declinedNotification, callback => { })); + + invitee.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(invitee.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.BnetAccountID).Build(); + var removerAsFriend = bnet.protocol.friends.Friend.CreateBuilder().SetId(remover.BnetAccountID).Build(); + + var removed = Friends.Remove(remover.BnetAccountID.Low, removeeAsFriend); + if (!removed) Logger.Warn("No friendship mapping between {0} and {1}", remover.BnetAccountID.Low, removeeAsFriend); + removed = Friends.Remove(removee.BnetAccountID.Low, removerAsFriend); + if (!removed) Logger.Warn("No friendship mapping between {0} and {1}", removee.BnetAccountID.Low, removerAsFriend); + 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 => { })); + + if (removee.IsOnline) + { + var notifyRemovee = bnet.protocol.friends.FriendNotification.CreateBuilder().SetTarget(removerAsFriend).Build(); + removee.LoggedInClient.MakeTargetedRPC(FriendManager.Instance, () => + bnet.protocol.friends.FriendsNotify.CreateStub(removee.LoggedInClient).NotifyFriendRemoved(null, notifyRemovee, callback => { })); + } + } + + private static void AddFriendshipToDB(Account inviter, Account invitee) + { + try + { + var query = string.Format("INSERT INTO friends (accountId, friendId) VALUES({0},{1}); INSERT INTO friends (accountId, friendId) VALUES({2},{3});", inviter.BnetAccountID.Low, invitee.BnetAccountID.Low, invitee.BnetAccountID.Low, inviter.BnetAccountID.Low); + + var cmd = new SQLiteCommand(query, DBManager.Connection); + cmd.ExecuteNonQuery(); + } + catch (Exception e) + { + Logger.ErrorException(e, "FriendManager.AddFriendshipToDB()"); + } + } + + private static void RemoveFriendshipFromDB(Account remover, Account removee) + { + try + { + var query = string.Format("DELETE FROM friends WHERE accountId = {0} AND friendId = {1}; DELETE FROM friends WHERE accountId = {1} AND friendId = {0};", remover.BnetAccountID.Low, removee.BnetAccountID.Low); + + var cmd = new SQLiteCommand(query, DBManager.Connection); + cmd.ExecuteNonQuery(); + } + catch (Exception e) + { + Logger.ErrorException(e, "FriendManager.RemoveFriendshipFromDB()"); + } + } + + private static void LoadFriendships() // load friends from database. + { + const string query = "SELECT * from friends"; + var cmd = new SQLiteCommand(query, DBManager.Connection); + var reader = cmd.ExecuteReader(); + + if (!reader.HasRows) return; + + while (reader.Read()) + { + var friend = + bnet.protocol.friends.Friend.CreateBuilder().SetId( + bnet.protocol.EntityId.CreateBuilder().SetHigh((ulong)EntityIdHelper.HighIdType.AccountId). + SetLow((ulong)reader.GetInt64(1))).Build(); + + Friends.Add((ulong)reader.GetInt64(0), friend); + } + } + } + + 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..b66fc3f8 --- /dev/null +++ b/src/Mooege/Core/MooNet/Games/GameFactory.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.Collections.Generic; +using Google.ProtocolBuffers; +using Mooege.Core.GS.Games; +using Mooege.Core.MooNet.Channels; +using Mooege.Core.MooNet.Helpers; +using Mooege.Core.MooNet.Objects; +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) + { + 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); + } + + 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); + } + } + + private 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() + .SetToonId(client.CurrentToon.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 + 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.CurrentToon.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.CurrentToon.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(this.Owner.CurrentToon.BnetEntityID) + .SetTargetId(client.CurrentToon.BnetEntityID) + .SetType("GAME_CONNECTION_INFO") + .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..78c0466b --- /dev/null +++ b/src/Mooege/Core/MooNet/Games/GameFactoryManager.cs @@ -0,0 +1,179 @@ +/* + * 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; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Channels; +using Mooege.Core.MooNet.Toons; +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 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 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.GameCreateParams.IsPrivate && 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 && !game.GameCreateParams.IsPrivate) + { + 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..fce5bd08 --- /dev/null +++ b/src/Mooege/Core/MooNet/Helpers/EntityIdHelper.cs @@ -0,0 +1,57 @@ +/* + * 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 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) + { + case 0x100000000000000: + return HighIdType.AccountId; + case 0x200000000000000: + return HighIdType.GameAccountId; + case 0x300000000000000: + return HighIdType.ToonId; + case 0x600000000000000: + 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 = 0x300000000000000, + 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..43975dd8 --- /dev/null +++ b/src/Mooege/Core/MooNet/Helpers/FieldKeyHelper.cs @@ -0,0 +1,36 @@ +/* + * 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 Mooege.Core.MooNet.Helpers +{ + public class FieldKeyHelper + { + public enum Program : uint + { + BNet = 16974, + D3 = 17459 + } + + public static bnet.protocol.presence.FieldKey Create(Program program, uint group, uint field, uint index) + { + return + bnet.protocol.presence.FieldKey.CreateBuilder().SetProgram((uint) program).SetGroup(group).SetField( + field).SetIndex(index).Build(); + } + } +} \ 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..4de3720b --- /dev/null +++ b/src/Mooege/Core/MooNet/Helpers/NotificationTypeHelper.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 + */ + +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..408aa5d4 --- /dev/null +++ b/src/Mooege/Core/MooNet/Objects/PersistentRPCObject.cs @@ -0,0 +1,91 @@ +/* + * 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 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/RPCObject.cs b/src/Mooege/Core/MooNet/Objects/RPCObject.cs new file mode 100644 index 00000000..8f5b0f35 --- /dev/null +++ b/src/Mooege/Core/MooNet/Objects/RPCObject.cs @@ -0,0 +1,143 @@ +/* + * 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 Mooege.Common; +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; } + + /// + /// 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) + { + // 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 + 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 + } + + /// + /// Notifies a specific subscriber about the object's present state. + /// This methods should be actually implemented by deriving object classes. + /// + /// The subscriber. + protected virtual void NotifySubscriptionAdded(MooNetClient client) { } + + // ** 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..5cdd3a58 --- /dev/null +++ b/src/Mooege/Core/MooNet/Objects/RPCObjectManager.cs @@ -0,0 +1,56 @@ +/* + * 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 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..fa76fe50 --- /dev/null +++ b/src/Mooege/Core/MooNet/Online/PlayerManager.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 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..fccc1c4a --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/AchievementService.cs @@ -0,0 +1,84 @@ +/* + * 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 Google.ProtocolBuffers; +using Mooege.Common.Versions; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; +using Mooege.Core.MooNet.Achievement; +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 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 + var response = bnet.protocol.achievements.RegisterWithServiceResponse.CreateBuilder() + .SetMaxRecordsPerUpdate(1) + .SetMaxCriteriaPerRecord(2) + .SetMaxAchievementsPerRecord(1) + .SetMaxRegistrations(16) + .SetFlushFrequency(180); + done(response.Build()); + } + + public override void RequestSnapshot(IRpcController controller, bnet.protocol.achievements.RequestSnapshotRequest request, Action done) + { + var snapshot = bnet.protocol.achievements.Snapshot.CreateBuilder(); + + foreach (var achievement in this.Client.Account.Achievements) + snapshot.AddAchievementSnapshot(achievement); + + foreach (var criteria in this.Client.Account.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) + { + throw new NotImplementedException(); + } + + public override void Initialize(IRpcController controller, bnet.protocol.achievements.InitializeRequest request, Action done) + { + var contentHandle = bnet.protocol.ContentHandle.CreateBuilder() + .SetRegion(0x00005553) + .SetUsage(0x61636876) + .SetHash(ByteString.CopyFrom(VersionInfo.MooNet.Achievements.AchievementFileHash.ToByteArray())); + var reponse = bnet.protocol.achievements.InitializeResponse.CreateBuilder().SetContentHandle(contentHandle); + + done(reponse.Build()); + } + + } +} diff --git a/src/Mooege/Core/MooNet/Services/AuthenticationService.cs b/src/Mooege/Core/MooNet/Services/AuthenticationService.cs new file mode 100644 index 00000000..f05e871e --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/AuthenticationService.cs @@ -0,0 +1,91 @@ +/* + * 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.Globalization; +using System.Threading; +using Mooege.Common.Logging; +using Mooege.Common.Versions; +using Mooege.Core.MooNet.Authentication; +using Mooege.Core.MooNet.Online; +using Mooege.Net.MooNet; + +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 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); + this.Client.Connection.Disconnect(); // TODO: We should be actually notifying the client with wrong version message. /raist. + return; + } + + AuthManager.StartAuthentication(this.Client, request); + + var authenticationThread = new Thread(() => + { + this.Client.AuthenticationCompleteSignal.WaitOne(); // wait the signal; + + if(this.Client.AuthenticationErrorCode != AuthManager.AuthenticationErrorCodes.None) + { + Logger.Info("Authentication failed for {0} because of invalid credentals.", request.Email); + done(bnet.protocol.authentication.LogonResponse.DefaultInstance); + return; + } + + Logger.Info("User {0} authenticated successfuly.", request.Email); + var logonResponseBuilder = bnet.protocol.authentication.LogonResponse. + CreateBuilder() + .SetAccount(Client.Account.BnetAccountID) + .SetGameAccount(Client.Account.BnetGameAccountID); + + done(logonResponseBuilder.Build()); + + this.Client.EnableEncryption(); + + PlayerManager.PlayerConnected(this.Client); + + }) { IsBackground = true, CurrentCulture = CultureInfo.InvariantCulture }; ; + + authenticationThread.Start(); + } + + public override void ModuleMessage(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.authentication.ModuleMessageRequest request, Action done) + { + var moduleMessage = request.Message.ToByteArray(); + var command = moduleMessage[0]; + + Logger.Trace("ModuleMessage(): command: {0}", command); + + done(bnet.protocol.NoData.CreateBuilder().Build()); + + if(request.ModuleId==0 && command==2) + AuthManager.HandleAuthResponse(this.Client, request.ModuleId, moduleMessage); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/ChannelInvitationService.cs b/src/Mooege/Core/MooNet/Services/ChannelInvitationService.cs new file mode 100644 index 00000000..6f86c130 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/ChannelInvitationService.cs @@ -0,0 +1,160 @@ +/* + * 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.Extensions; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Channels; +using Mooege.Core.MooNet.Toons; +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; } + + 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) + { + Logger.Trace("{0} accepted invitation.", this.Client.CurrentToon); + + var channel = this._invitationManager.HandleAccept(this.Client, request); + + var response = bnet.protocol.channel_invitation.AcceptInvitationResponse.CreateBuilder().SetObjectId(channel.DynamicId).Build(); + done(response); + } + + public override void DeclineInvitation(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.invitation.GenericRequest request, Action done) + { + Logger.Trace("{0} declined invitation.", this.Client.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.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 = ToonManager.GetToonByLowID(request.TargetId.Low); + if (this.Client.CurrentChannel.HasToon(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.CurrentToon, invitee); + + // somehow protobuf lib doesnt handle this extension, so we're using a workaround to get that channelinfo. + var extensionBytes = request.UnknownFields.FieldDictionary[105].LengthDelimitedList[0].ToByteArray(); + var channelInvitationInfo = bnet.protocol.channel_invitation.SendInvitationRequest.ParseFrom(extensionBytes); + + var channelInvitation = bnet.protocol.channel_invitation.Invitation.CreateBuilder() + .SetChannelDescription(bnet.protocol.channel.ChannelDescription.CreateBuilder().SetChannelId(channelInvitationInfo.ChannelId).Build()) + .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().SetToonId(Client.CurrentToon.BnetEntityID).Build()) + .SetInviterName(Client.CurrentToon.Name) + .SetInviteeIdentity(bnet.protocol.Identity.CreateBuilder().SetToonId(request.TargetId).Build()) + .SetInviteeName(invitee.Name) + .SetInvitationMessage(request.InvitationMessage) + .SetCreationTime(DateTime.Now.ToExtendedEpoch()) + .SetExpirationTime(DateTime.Now.ToUnixTime() + request.ExpirationTime) + .SetExtension(bnet.protocol.channel_invitation.Invitation.ChannelInvitation, 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() + .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.CurrentToon.BnetEntityID) + .SetStateChange(bnet.protocol.channel.ChannelState.CreateBuilder().AddInvitation(invitation.Clone())); + + this.Client.MakeTargetedRPC(this.Client.CurrentChannel, () => + 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 = ToonManager.GetToonByLowID(request.TargetId.Low); //wants invite + var suggestee = ToonManager.GetToonByLowID(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.Name) + .SetSuggesteeId(suggester.BnetEntityID) + .SetSuggesteeName(suggester.Name) + .Build(); + + var notification = bnet.protocol.channel_invitation.SuggestionAddedNotification.CreateBuilder().SetSuggestion(suggestion); + + suggestee.Owner.LoggedInClient.MakeTargetedRPC(this._invitationManager, () => + bnet.protocol.channel_invitation.ChannelInvitationNotify.CreateStub(suggestee.Owner.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..8ca94f85 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/ChannelOwnerService.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 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 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); + + done(builder.Build()); + channel.SetOwner(Client); // Set the client that requested the creation of channel as the owner + + Logger.Trace("CreateChannel() {0} for {1}", channel, Client.CurrentToon); + } + + public override void FindChannel(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel.FindChannelRequest request, System.Action done) + { + throw new NotImplementedException(); + } + + 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.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.Warn("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..27904661 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/ChannelService.cs @@ -0,0 +1,195 @@ +/* + * 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.Core.MooNet.Channels; +using Mooege.Core.MooNet.Commands; +using Mooege.Net.MooNet; + +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 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()"); + + // TODO: we should be actually checking for which member has to be removed. /raist. + var builder = bnet.protocol.NoData.CreateBuilder(); + done(builder.Build()); + this.Client.CurrentChannel.RemoveMember(this.Client, Channel.GetRemoveReasonForRequest((Channel.RemoveRequestReason)request.Reason)); + } + + public override void SendMessage(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.channel.SendMessageRequest request, System.Action done) + { + Logger.Trace("{0} sent a message to channel {1}.", this.Client.CurrentToon, this.Client.CurrentChannel); + + 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 channel = ChannelManager.GetChannelByDynamicId(this.LastCallHeader.ObjectId); + 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) + { + Logger.Trace("UpdateChannelState()"); + + // 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); + + var attr = bnet.protocol.attribute.Attribute.CreateBuilder() + .SetName("D3.Party.GameCreateParams") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(gameCreateParams.ToByteString()).Build()); + channelState.AddAttribute(attr); + } + } + 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 newScreen = this.Client.Account.ScreenStatus; + + var attr = bnet.protocol.attribute.Attribute.CreateBuilder() + .SetName("D3.Party.ScreenStatus") + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(newScreen.ToByteString())); + channelState.AddAttribute(attr); + } + else + { + var oldScreen = D3.PartyMessage.ScreenStatus.ParseFrom(attribute.Value.MessageValue); + this.Client.Account.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.Debug("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); + } + 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); + } + 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); + } + + } + 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.CurrentToon.BnetEntityID) + .SetStateChange(channelState) + .Build(); + + // Send UpdateChannelStateNotification RPC call. + this.Client.MakeTargetedRPC(this.Client.CurrentChannel, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(this.Client).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..6b585860 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/ConnectionService.cs @@ -0,0 +1,103 @@ +/* + * 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.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 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); + + 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) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/ExchangeService.cs b/src/Mooege/Core/MooNet/Services/ExchangeService.cs new file mode 100644 index 00000000..0f29892e --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/ExchangeService.cs @@ -0,0 +1,218 @@ +/* + * 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 Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; + +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 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(720) + .AddAuctionDurations(1440) + .AddAuctionDurations(2880) + .AddAuctionStartDelays(5) + .SetAntiSnipingExtensionDelay(1) + .AddCurrencyConfig(bnet.protocol.exchange.CurrencyConfig.CreateBuilder() + .SetCurrency("D3_GOLD") + .SetTickSize(1) + .SetMinUnitPrice(5) + .SetMaxUnitPrice(4294967295) + .SetMaxTotalPrice(4294967295))); + done(builder.Build()); + } + + public override void SubscribeOrderStatusChange(IRpcController controller, bnet.protocol.exchange.SubscribeOrderStatusChangeRequest request, Action done) + { + Logger.Trace("SubscribeOrderStatusChange() Stub"); + var builder = bnet.protocol.NoData.CreateBuilder(); + done(builder.Build()); + } + + public override void UnsubscribeOrderStatusChange(IRpcController controller, bnet.protocol.exchange.UnsubscribeOrderStatusChangeRequest request, Action done) + { + Logger.Trace("UnsubscribeOrderStatusChange() 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) + { + throw new NotImplementedException(); + } + + 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(); + } + } +} 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..1d19fbfa --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/FriendsService.cs @@ -0,0 +1,146 @@ +/* + * 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 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 override void SubscribeToFriends(IRpcController controller, bnet.protocol.friends.SubscribeToFriendsRequest request, Action done) + { + Logger.Trace("Subscribe() {0}", this.Client); + + FriendManager.Instance.AddSubscriber(this.Client, request.ObjectId); + + var builder = bnet.protocol.friends.SubscribeToFriendsResponse.CreateBuilder() + .SetMaxFriends(127) + .SetMaxReceivedInvitations(127) + .SetMaxSentInvitations(127); + + foreach (var friend in FriendManager.Friends[this.Client.Account.BnetAccountID.Low]) // send friends list. + { + builder.AddFriends(friend); + } + + done(builder.Build()); + } + + public override void SendInvitation(IRpcController controller, bnet.protocol.invitation.SendInvitationRequest request, Action done) + { + // somehow protobuf lib doesnt handle this extension, so we're using a workaround to get that channelinfo. + var extensionBytes = request.UnknownFields.FieldDictionary[103].LengthDelimitedList[0].ToByteArray(); + var friendRequest = bnet.protocol.friends.SendInvitationRequest.ParseFrom(extensionBytes); + + if (friendRequest.TargetEmail.ToLower() == this.Client.Account.Email.ToLower()) return; // don't allow him to invite himself - and we should actually return an error! + // also he shouldn't be allowed to invite his current friends - put that check too!. /raist + var inviteee = AccountManager.GetAccountByEmail(friendRequest.TargetEmail); + if (inviteee == null) return; // we need send an error response here /raist. + + Logger.Trace("{0} sent {1} friend invitation.", this.Client.Account, inviteee); + + 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(inviteee.BnetAccountID)) + .SetInviteeName(inviteee.Email) // again we should be instead using invitee's name. + .SetInvitationMessage(request.InvitationMessage) + .SetCreationTime(DateTime.Now.ToUnixTime()) + .SetExpirationTime(86400); + + // Response is bnet.protocol.NoData as of 7728. /raist. + //var response = bnet.protocol.invitation.SendInvitationResponse.CreateBuilder() + // .SetInvitation(invitation.Clone()); + + var response = bnet.protocol.NoData.CreateBuilder(); + 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 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..54fbf901 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/GameMasterService.cs @@ -0,0 +1,187 @@ +/* + * 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 Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Core.MooNet.Games; +using Mooege.Core.MooNet.Toons; +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 override void JoinGame(IRpcController controller, bnet.protocol.game_master.JoinGameRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ListFactories(IRpcController controller, bnet.protocol.game_master.ListFactoriesRequest request, Action done) + { + Logger.Trace("ListFactories() {0}", this.Client); + + var description = bnet.protocol.game_master.GameFactoryDescription.CreateBuilder().SetId(14249086168335147635); + var attributes = new bnet.protocol.attribute.Attribute[4] + { + bnet.protocol.attribute.Attribute.CreateBuilder().SetName("min_players").SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(2)).Build(), + bnet.protocol.attribute.Attribute.CreateBuilder().SetName("max_players").SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(4)).Build(), + bnet.protocol.attribute.Attribute.CreateBuilder().SetName("num_teams").SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(1)).Build(), + bnet.protocol.attribute.Attribute.CreateBuilder().SetName("version").SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetStringValue("0.3.1")).Build() //This should be a static string so all versions are the same -Egris + }; + + description.AddRangeAttribute(attributes); + description.AddStatsBucket(bnet.protocol.game_master.GameStatsBucket.CreateBuilder() + .SetBucketMin(0) + .SetBucketMax(4267296) + .SetWaitMilliseconds(1354) + .SetGamesPerHour(0) + .SetActiveGames(69) + .SetActivePlayers(75) + .SetFormingGames(5) + .SetWaitingPlayers(0).Build()); + + var builder = bnet.protocol.game_master.ListFactoriesResponse.CreateBuilder().AddDescription(description).SetTotalResults(1); + 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); + + //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.CurrentToon.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 = new List(); + foreach (var player in request.PlayerList) + { + var toon = ToonManager.GetToonByLowID(player.ToonId.Low); + if (toon.Owner.LoggedInClient == null) continue; + clients.Add(toon.Owner.LoggedInClient); + } + + // send game found notification. + var notificationBuilder = bnet.protocol.game_master.GameFoundNotification.CreateBuilder() + .SetRequestId(gameFound.RequestId) + .SetGameHandle(gameFound.GameHandle); + + this.Client.MakeRPCWithListenerId(request.ObjectId, () => + bnet.protocol.game_master.GameFactorySubscriber.CreateStub(this.Client).NotifyGameFound(null, notificationBuilder.Build(), callback => { })); + + if(gameFound.Started) + { + Logger.Warn("Client {0} joining game with FactoryID:{1}", this.Client.CurrentToon.Name, gameFound.FactoryID); + gameFound.JoinGame(clients, request.ObjectId); + } + else + { + Logger.Warn("Client {0} creating new game", this.Client.CurrentToon.Name); + gameFound.StartGame(clients, request.ObjectId); + } + } + + public override void CancelFindGame(IRpcController controller, bnet.protocol.game_master.CancelFindGameRequest 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..f0157cf9 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/GameUtilitiesService.cs @@ -0,0 +1,100 @@ +/* + * 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 Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; + +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 override void ProcessClientRequest(IRpcController controller, bnet.protocol.game_utilities.ClientRequest request, Action done) + { + Logger.Trace("ProcessClientRequest()"); + + // TODO: handle the request. this is where banner changing happens (CustomMessageId 4) + // CustomMessage for banner change is a D3.GameMessages.SaveBannerConfiguration + //Logger.Debug("request:\n{0}", request.ToString()); + + var builder = bnet.protocol.game_utilities.ClientResponse.CreateBuilder(); + done(builder.Build()); + } + + public override void CreateToon(IRpcController controller, bnet.protocol.game_utilities.CreateToonRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void DeleteToon(IRpcController controller, bnet.protocol.game_utilities.DeleteToonRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void TransferToon(IRpcController controller, bnet.protocol.game_utilities.TransferToonRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void SelectToon(IRpcController controller, bnet.protocol.game_utilities.SelectToonRequest request, Action done) + { + throw new NotImplementedException(); + } + + 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 CreateToonEntity(IRpcController controller, bnet.protocol.toon.CreateToonEntityRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void FinalizeToonCreation(IRpcController controller, bnet.protocol.toon.FinalizeToonCreationRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ProcessServerRequest(IRpcController controller, bnet.protocol.game_utilities.ServerRequest request, Action done) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/IServerService.cs b/src/Mooege/Core/MooNet/Services/IServerService.cs new file mode 100644 index 00000000..c0016915 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/IServerService.cs @@ -0,0 +1,35 @@ +/* + * 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 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;} + } +} diff --git a/src/Mooege/Core/MooNet/Services/NotificationService.cs b/src/Mooege/Core/MooNet/Services/NotificationService.cs new file mode 100644 index 00000000..0b3240de --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/NotificationService.cs @@ -0,0 +1,85 @@ +/* + * 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.Core.MooNet.Commands; +using Mooege.Core.MooNet.Helpers; +using Mooege.Core.MooNet.Toons; +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 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). + + Logger.Trace(string.Format("NotificationRequest.Whisper by {0} to {1}", this.Client.CurrentToon, ToonManager.GetToonByLowID(request.TargetId.Low))); + + var targetAccount = ToonManager.GetOwnerAccountByToonLowId(request.TargetId.Low); + if (targetAccount.LoggedInClient == null) return; + + if (targetAccount == this.Client.Account) // 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.CurrentToon.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..c8c38852 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/PresenceService.cs @@ -0,0 +1,170 @@ +/* + * 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.Core.MooNet.Accounts; +using Mooege.Core.MooNet.Helpers; +using Mooege.Core.MooNet.Toons; +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 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.ToonId: + var toon = ToonManager.GetToonByLowID(request.EntityId.Low); + if (toon != null) + { + Logger.Trace("Subscribe() {0} {1}", this.Client, toon); + toon.AddSubscriber(this.Client, request.ObjectId); // The client will send us a Subscribe with ToonId of 0 the first time it tries to create a toon with a name that already exists. Let's handle that here. + } + break; + default: + Logger.Warn("Recieved an unhandled Presence.Subscribe request with type {0}", request.EntityId.GetHighIdType()); + 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) + { + Logger.Trace("Unsubscribe()"); + + 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.ToonId: + var toon = ToonManager.GetToonByLowID(request.EntityId.Low); + if (toon != null) + { + toon.RemoveSubscriber(this.Client); + Logger.Trace("Unsubscribe() {0} {1}", this.Client, toon); + } + break; + default: + Logger.Warn("Recieved an unhandled Presence.Unsubscribe request with type {0}", request.EntityId.GetHighIdType()); + 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}", this.Client, account); + break; + case EntityIdHelper.HighIdType.ToonId: + var toon = ToonManager.GetToonByLowID(request.EntityId.Low); + Logger.Trace("Update() {0} {1}", this.Client, toon); + foreach(var fieldOp in request.FieldOperationList) + { + toon.Update(fieldOp); + } + break; + default: + Logger.Warn("Recieved an unhandled Presence.Update request with type {0}", request.EntityId.GetHighIdType()); + 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); + Logger.Trace("Query() {0} {1}", this.Client, account); + foreach(var key in request.KeyList) + { + var field = account.QueryField(key); + if (field != null) builder.AddField(field); + } + + break; + case EntityIdHelper.HighIdType.ToonId: + var toon = ToonManager.GetToonByLowID(request.EntityId.Low); + Logger.Trace("Query() {0} {1}", this.Client, toon); + foreach (var key in request.KeyList) + { + var field = toon.QueryField(key); + if (field != null) builder.AddField(field); + } + + 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(); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/SearchService.cs b/src/Mooege/Core/MooNet/Services/SearchService.cs new file mode 100644 index 00000000..9e36b901 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/SearchService.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 Google.ProtocolBuffers; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; +using bnet.protocol; +using bnet.protocol.search; + +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 override void FindMatches(IRpcController controller, FindMatchesRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void SetObject(IRpcController controller, SetObjectRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void RemoveObjects(IRpcController controller, RemoveObjectsRequest request, Action done) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/Service.cs b/src/Mooege/Core/MooNet/Services/Service.cs new file mode 100644 index 00000000..14ef237e --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/Service.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.Reflection; +using Google.ProtocolBuffers; +using Mooege.Common.Helpers; +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/StorageService.cs b/src/Mooege/Core/MooNet/Services/StorageService.cs new file mode 100644 index 00000000..7a9c0ca5 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/StorageService.cs @@ -0,0 +1,206 @@ +/* + * 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.IO; +using System.Collections.Generic; +using Gibbed.IO; +using Mooege.Common.Logging; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x9, serviceName: "bnet.protocol.storage.StorageService")] + public class StorageService : bnet.protocol.storage.StorageService,IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + + public override void OpenTable(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.storage.OpenTableRequest request, System.Action done) + { + Logger.Trace("OpenTable() {0}", this.Client); + var builder = bnet.protocol.storage.OpenTableResponse.CreateBuilder(); + done(builder.Build()); + } + + public override void OpenColumn(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.storage.OpenColumnRequest request, System.Action done) + { + Logger.Trace("OpenColumn() {0}", this.Client); + var builder = bnet.protocol.storage.OpenColumnResponse.CreateBuilder(); + done(builder.Build()); + } + + public override void Execute(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.storage.ExecuteRequest request, System.Action done) + { + Logger.Trace("Execute() {0}", this.Client); + bnet.protocol.storage.ExecuteResponse response = null; + switch (request.QueryName) + { + case "GetGameAccountSettings": + response = GameAccountSettings(request); + break; + case "LoadAccountDigest": + response = LoadAccountDigest(Client, request); + break; + case "GetHeroDigests": + response = GetHeroDigest(Client, request); + break; + case "GetToonSettings": + response = GetToonSettings(request); + break; + default: + Logger.Warn("Unhandled query: {0}", request.QueryName); + response = bnet.protocol.storage.ExecuteResponse.CreateBuilder().Build(); + break; + } + + done(response); + } + + private static readonly Google.ProtocolBuffers.ByteString HeroDigestColumn = Google.ProtocolBuffers.ByteString.CopyFrom(new byte[] { 0xA1, 0x81, 0xA8, 0x35, 0x68, 0x24, 0x41, 0x60, 0x09, 0x7C, 0x05, 0x1B, 0x11, 0xA8, 0x7F, 0x04 }); + private static readonly Google.ProtocolBuffers.ByteString HeroNameColumn = Google.ProtocolBuffers.ByteString.CopyFrom(new byte[] { 0xE6, 0x7A, 0xC5, 0x2B, 0x8F, 0x5F, 0x83, 0x87, 0xA6, 0x68, 0xD7, 0x2C, 0x46, 0x74, 0xEC, 0xD3 }); + + private bnet.protocol.storage.ExecuteResponse GetHeroDigest(MooNetClient client, bnet.protocol.storage.ExecuteRequest request) + { + var results = new List(); + + foreach(var operation in request.OperationsList) + { + Google.ProtocolBuffers.ByteString data = null; + + // find the requested toons entity-id. + var stream = new MemoryStream(operation.RowId.Hash.ToByteArray()); + + // contains ToonHandle in field form with one unknown field (which is not in message definition): + // int16 unknown; uint8 realm; uint8 region; uint32 program; uint64 id; + stream.ReadValueU16(); // unknown + stream.ReadValueU8(); // realm + stream.ReadValueU8(); // region + stream.ReadValueU32(false); // program + + var toonId = stream.ReadValueU64(false); + + if (!client.Account.Toons.ContainsKey(toonId)) + { + Logger.Error("Can't find the requested toon: {0}", toonId); + continue; + } + + var toon = client.Account.Toons[toonId]; + + if (operation.ColumnId.Hash.Equals(HeroDigestColumn)) + data = toon.Digest.ToByteString(); + else if (operation.ColumnId.Hash.Equals(HeroNameColumn)) + data = toon.NameText.ToByteString(); + + var operationResult = bnet.protocol.storage.OperationResult.CreateBuilder().SetTableId(operation.TableId); + operationResult.AddData( + bnet.protocol.storage.Cell.CreateBuilder() + .SetColumnId(request.OperationsList[0].ColumnId) + .SetRowId(request.OperationsList[0].RowId) + .SetVersion(1) + .SetData(data) + .Build() + ); + results.Add(operationResult.Build()); + } + + var builder = bnet.protocol.storage.ExecuteResponse.CreateBuilder(); + foreach(var result in results) + { + builder.AddResults(result); + } + return builder.Build(); + } + + private bnet.protocol.storage.ExecuteResponse GetToonSettings(bnet.protocol.storage.ExecuteRequest request) + { + var results = new List(); + + foreach (var operation in request.OperationsList) + { + var operationResult = bnet.protocol.storage.OperationResult.CreateBuilder().SetTableId(operation.TableId); + operationResult.SetErrorCode(4); //this query returns error 4 in 7728 -Egris + operationResult.AddData( + bnet.protocol.storage.Cell.CreateBuilder() + .SetColumnId(request.OperationsList[0].ColumnId) + .SetRowId(request.OperationsList[0].RowId) + .SetVersion(1) + .Build() + ); + results.Add(operationResult.Build()); + } + + var builder = bnet.protocol.storage.ExecuteResponse.CreateBuilder(); + foreach (var result in results) + { + builder.AddResults(result); + } + return builder.Build(); + } + + private bnet.protocol.storage.ExecuteResponse LoadAccountDigest(MooNetClient client, bnet.protocol.storage.ExecuteRequest request) + { + var results = new List(); + + foreach (var operation in request.OperationsList) + { + var operationResult = bnet.protocol.storage.OperationResult.CreateBuilder().SetTableId(operation.TableId); + operationResult.AddData( + bnet.protocol.storage.Cell.CreateBuilder() + .SetColumnId(request.OperationsList[0].ColumnId) + .SetRowId(request.OperationsList[0].RowId) + .SetVersion(1) + .SetData(client.Account.Digest.ToByteString()) + .Build()); + results.Add(operationResult.Build()); + } + + var builder = bnet.protocol.storage.ExecuteResponse.CreateBuilder(); + foreach (var result in results) + { + builder.AddResults(result); + } + return builder.Build(); + } + + private bnet.protocol.storage.ExecuteResponse GameAccountSettings(bnet.protocol.storage.ExecuteRequest request) + { + var results = new List(); + + foreach (var operation in request.OperationsList) + { + var operationResult = bnet.protocol.storage.OperationResult.CreateBuilder().SetTableId(operation.TableId); + operationResult.SetErrorCode(4); //this query returns error 4 in 7728 -Egris + operationResult.AddData( + bnet.protocol.storage.Cell.CreateBuilder() + .SetColumnId(request.OperationsList[0].ColumnId) + .SetRowId(request.OperationsList[0].RowId) + .Build()); + results.Add(operationResult.Build()); + } + + var builder = bnet.protocol.storage.ExecuteResponse.CreateBuilder(); + foreach (var result in results) + { + builder.AddResults(result); + } + return builder.Build(); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/ToonExternalService.cs b/src/Mooege/Core/MooNet/Services/ToonExternalService.cs new file mode 100644 index 00000000..57250a6d --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/ToonExternalService.cs @@ -0,0 +1,92 @@ +/* + * 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.Core.MooNet.Toons; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Services +{ + [Service(serviceID: 0x2, serviceName: "bnet.protocol.toon.external.ToonServiceExternal")] + public class ToonExternalService : bnet.protocol.toon.external.ToonServiceExternal, IServerService + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public MooNetClient Client { get; set; } + public bnet.protocol.Header LastCallHeader { get; set; } + + public override void ToonList(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.toon.external.ToonListRequest request, Action done) + { + Logger.Trace("ToonList() {0}", this.Client.Account); + var builder = bnet.protocol.toon.external.ToonListResponse.CreateBuilder(); + + if (Client.Account.Toons.Count > 0) + { + foreach (var pair in Client.Account.Toons) + { + builder.AddToons(pair.Value.BnetEntityID); + } + } + + done(builder.Build()); + } + + public override void SelectToon(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.toon.external.SelectToonRequest request, Action done) + { + var builder = bnet.protocol.toon.external.SelectToonResponse.CreateBuilder(); + var toon = ToonManager.GetToonByLowID(request.Toon.Low); + this.Client.CurrentToon = toon; + done(builder.Build()); + + Logger.Trace("SelectToon() {0}", toon); + } + + public override void CreateToon(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.toon.external.CreateToonRequest request, Action done) + { + var heroCreateParams = D3.OnlineService.HeroCreateParams.ParseFrom(request.AttributeList[0].Value.MessageValue); + var builder = bnet.protocol.toon.external.CreateToonResponse.CreateBuilder(); + + int hashCode = ToonManager.GetUnusedHashCodeForToonName(request.Name); + var toon = new Toon(request.Name, hashCode, heroCreateParams.GbidClass, heroCreateParams.IsFemale ? ToonFlags.Female : ToonFlags.Male, 1, Client.Account); + if (ToonManager.SaveToon(toon)) + builder.SetToken((uint)toon.BnetEntityID.Low); + done(builder.Build()); + + var notification = bnet.protocol.toon.external.ToonCreatedNotification.CreateBuilder() + .SetToon(toon.BnetEntityID) + .SetToken((uint) toon.BnetEntityID.Low) + .SetErrorCode(0).Build(); + + this.Client.MakeRPC(() => bnet.protocol.toon.external.ToonNotifyExternal.CreateStub(this.Client).NotifyToonCreated(null, notification, callback => { })); + + Logger.Trace("CreateToon() {0}", toon); + } + + public override void DeleteToon(Google.ProtocolBuffers.IRpcController controller, bnet.protocol.toon.external.DeleteToonRequest request, Action done) + { + var id = request.Toon.Low; + var toon = ToonManager.GetToonByLowID(id); + ToonManager.DeleteToon(toon); + + var builder = bnet.protocol.toon.external.DeleteToonResponse.CreateBuilder(); + done(builder.Build()); + + Logger.Trace("DeleteToon() {0}",toon); + } + } +} diff --git a/src/Mooege/Core/MooNet/Services/UserManagerService.cs b/src/Mooege/Core/MooNet/Services/UserManagerService.cs new file mode 100644 index 00000000..e7921f76 --- /dev/null +++ b/src/Mooege/Core/MooNet/Services/UserManagerService.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 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 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(); + foreach (var client in PlayerManager.OnlinePlayers) + { + if (client == this.Client) continue; // Don't add the requester to the list + if (client.CurrentToon == null) continue; + + Logger.Debug("RecentPlayer => " + client.CurrentToon); + var recentPlayer = bnet.protocol.user_manager.RecentPlayer.CreateBuilder().SetPlayer(client.CurrentToon.BnetEntityID); + 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 RemoveRecentPlayers(IRpcController controller, bnet.protocol.user_manager.RemoveRecentPlayersRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ReportToon(IRpcController controller, bnet.protocol.user_manager.ReportToonRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void BlockToon(IRpcController controller, bnet.protocol.user_manager.BlockToonRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void UnblockToons(IRpcController controller, bnet.protocol.user_manager.UnblockToonsRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void ReportAccount(IRpcController controller, bnet.protocol.user_manager.ReportAccountRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void IgnoreInviter(IRpcController controller, bnet.protocol.user_manager.IgnoreInviterRequest request, Action done) + { + throw new NotImplementedException(); + } + + public override void UnignoreInviters(IRpcController controller, bnet.protocol.user_manager.UnignoreInvitersRequest 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..8a0c9939 --- /dev/null +++ b/src/Mooege/Core/MooNet/Toons/Toon.cs @@ -0,0 +1,584 @@ +/* + * 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.Data.SQLite; +using Mooege.Common.Helpers; +using Mooege.Common.Helpers.Hash; +using Mooege.Common.Storage; +using Mooege.Core.MooNet.Accounts; +using Mooege.Core.MooNet.Helpers; +using Mooege.Core.MooNet.Objects; +using Mooege.Core.MooNet.Channels; +using Mooege.Net.MooNet; + +namespace Mooege.Core.MooNet.Toons +{ + public class Toon : PersistentRPCObject + { + /// + /// D3 EntityID encoded id. + /// + public D3.OnlineService.EntityId D3EntityID { get; private set; } + + /// + /// Bnet EntityID encoded id. + /// + public bnet.protocol.EntityId BnetEntityID { get; private set; } + + /// + /// Toon handle struct. + /// + public ToonHandleHelper ToonHandle { get; private set; } + + /// + /// Toon's name. + /// + public string Name { get; private set; } + + /// + /// Toon's hash-code. + /// + public int HashCode { get; set; } + + /// + /// Toon's hash-code as string. + /// + public string HashCodeString { get; private set; } + + /// + /// NameText as name#hashcode. + /// + public D3.Hero.NameText NameText { get; private set; } + + /// + /// Toon's owner account. + /// + public Account Owner { get; set; } + + /// + /// Toon's class. + /// + public ToonClass Class { get; private set; } + + /// + /// Toon's flags. + /// + public ToonFlags Flags { get; private set; } + + /// + /// Toon's level. + /// + public byte Level { get; private set; } + + /// + /// Total time played for toon. + /// + public uint TimePlayed { get; set; } + + /// + /// Last login time for toon. + /// + public uint LoginTime { get; set; } + + /// + /// Away status for the toon? (shouldn't it be account stuff? /raist). + /// + public AwayStatus AwayStatus { get; private set; } + + /// + /// The visual equipment for toon. + /// + public D3.Hero.VisualEquipment Equipment { get; protected set; } + + /// + /// Toon digest. + /// + public D3.Hero.Digest Digest + { + get + { + return D3.Hero.Digest.CreateBuilder().SetVersion(891) + .SetHeroId(this.D3EntityID) + //.SetHeroName(this.Name) //no longer used in 7728, uses D3.Hero.NameText query -Egris + .SetGbidClass((int)this.ClassID) + .SetPlayerFlags((uint)this.Flags) + .SetLevel(this.Level) + .SetVisualEquipment(this.Equipment) + .SetLastPlayedAct(0) + .SetHighestUnlockedAct(0) + .SetLastPlayedDifficulty(0) + .SetHighestUnlockedDifficulty(0) + .SetLastPlayedQuest(-1) + .SetLastPlayedQuestStep(-1) + .SetTimePlayed(this.TimePlayed) + .Build(); + } + } + + public bool IsSelected + { + get + { + if (!this.Owner.IsOnline) return false; + else + { + if (this.Owner.LoggedInClient.CurrentToon != null) + return this.Owner.LoggedInClient.CurrentToon.BnetEntityID == this.BnetEntityID; + else + return false; + } + } + } + + public Toon(ulong persistentId, string name, int hashCode, byte @class, byte gender, byte level, long accountId, uint timePlayed) // Toon with given persistent ID + : base(persistentId) + { + this.SetFields(name, hashCode, (ToonClass)@class, (ToonFlags)gender, level, AccountManager.GetAccountByPersistentID((ulong)accountId),timePlayed); + } + + public Toon(string name, int hashCode, int classId, ToonFlags flags, byte level, Account account) // Toon with **newly generated** persistent ID + : base(StringHashHelper.HashIdentity(name + "#" + hashCode.ToString("D3"))) + { + this.SetFields(name, hashCode, GetClassByID(classId), flags, level, account, 0); + } + + 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 + } + } + + private void SetFields(string name, int hashCode, ToonClass @class, ToonFlags flags, byte level, Account owner,uint timePlayed) + { + this.ToonHandle = new ToonHandleHelper(this.PersistentID); + this.D3EntityID = this.ToonHandle.ToD3EntityID(); + this.BnetEntityID = this.ToonHandle.ToBnetEntityID(); + this.Name = name; + this.HashCode = hashCode; + this.HashCodeString = HashCode.ToString("D3"); + this.NameText = D3.Hero.NameText.CreateBuilder().SetName(string.Format("{0}#{1}", this.Name, this.HashCodeString)).Build(); + this.Class = @class; + this.Flags = flags; + this.Level = level; + this.Owner = owner; + this.TimePlayed = timePlayed; + + 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.Equipment = D3.Hero.VisualEquipment.CreateBuilder().AddRangeVisualItem(visualItems).Build(); + + } + + + public void LevelUp() + { + this.Level++; + } + + private static ToonClass GetClassByID(int classId) + { + switch (classId) + { + case 0x4FB91EE2: + return ToonClass.Barbarian; + case unchecked((int)0xC88B9649): + return ToonClass.DemonHunter; + case 0x3DAC15: + return ToonClass.Monk; + case 0x343C22A: + return ToonClass.WitchDoctor; + case 0x1D4681B1: + return ToonClass.Wizard; + } + + return ToonClass.Barbarian; + } + + 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 == 2 && queryKey.Field == 1) // Banner configuration + { + field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(this.Owner.BannerConfiguration.ToByteString()).Build()); + } + else if (queryKey.Group == 3 && queryKey.Field == 1) // Hero's class (GbidClass) + { + field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(this.ClassID).Build()); + } + else if (queryKey.Group == 3 && queryKey.Field == 2) // Hero's current level + { + field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(this.Level).Build()); + } + else if (queryKey.Group == 3 && queryKey.Field == 3) // Hero's visible equipment + { + field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(this.Equipment.ToByteString()).Build()); + } + else if (queryKey.Group == 3 && queryKey.Field == 4) // Hero's flags (gender and such) + { + field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue((uint)(this.Flags | ToonFlags.AllUnknowns)).Build()); + } + else if (queryKey.Group == 4 && queryKey.Field == 1) // Channel ID if the client is online + { + if (this.Owner.LoggedInClient != null && this.Owner.LoggedInClient.CurrentChannel != null) field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(this.Owner.LoggedInClient.CurrentChannel.D3EntityId.ToByteString()).Build()); + else field.SetValue(bnet.protocol.attribute.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(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(0).Build()); + } + else + { + Logger.Warn("Unknown query-key: {0}, {1}, {2}", queryKey.Program, queryKey.Group, queryKey.Field); + } + break; + case FieldKeyHelper.Program.BNet: + if (queryKey.Group == 3 && queryKey.Field == 2) // Toon name + { + field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetStringValue(this.Name + "#" + this.HashCodeString).Build()); + } + else if (queryKey.Group == 3 && queryKey.Field == 3) // Whether the toon is selected one for owner account. + { + field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetBoolValue(this.IsSelected).Build()); + } + else if (queryKey.Group == 3 && queryKey.Field == 5) // Away status - 0 for online + { + field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue((uint)this.AwayStatus).Build()); + } + else if (queryKey.Group == 3 && queryKey.Field == 9) // Program - always D3 + { + field.SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetFourccValue("D3").Build()); + } + else + { + Logger.Warn("Unknown query-key: {0}, {1}, {2}", queryKey.Program, queryKey.Group, queryKey.Field); + } + break; + } + + return field.HasValue ? field.Build() : null; + } + + public void Update(bnet.protocol.presence.FieldOperation operation) + { + switch (operation.Operation) + { + case bnet.protocol.presence.FieldOperation.Types.OperationType.SET: + DoSet(operation.Field); + break; + case bnet.protocol.presence.FieldOperation.Types.OperationType.CLEAR: + DoClear(operation.Field); + break; + } + } + + private void DoSet(bnet.protocol.presence.Field field) + { + switch ((FieldKeyHelper.Program)field.Key.Program) + { + case FieldKeyHelper.Program.D3: + if (field.Key.Group == 4 && field.Key.Field == 1) + { + if (field.Value.HasMessageValue) //7727 Sends empty SET instead of a CLEAR -Egris + { + var entityId = D3.OnlineService.EntityId.ParseFrom(field.Value.MessageValue); + var channel = ChannelManager.GetChannelByEntityId(entityId); + this.Owner.LoggedInClient.CurrentChannel = channel; + } + else + { + 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) + { + //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 + } + else if (field.Key.Group == 4 && field.Key.Field == 3) + { + //Looks to be the ToonFlags of the party leader/inviter when it is an int, OR the message set in an open to friends game when it is a string /dustinconrad + } + else + { + Logger.Warn("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 == 3 && field.Key.Field == 5) // Away status + { + AwayStatus = (AwayStatus)field.Value.IntValue; + } + else + { + Logger.Warn("Unknown set-field: {0}, {1}, {2} := {3}", field.Key.Program, field.Key.Group, field.Key.Field, field.Value); + } + break; + } + } + + private void DoClear(bnet.protocol.presence.Field field) + { + switch ((FieldKeyHelper.Program)field.Key.Program) + { + case FieldKeyHelper.Program.D3: + { + Logger.Warn("Unknown clear-field: {0}, {1}, {2}", field.Key.Program, field.Key.Group, field.Key.Field); + } + break; + case FieldKeyHelper.Program.BNet: + { + Logger.Warn("Unknown clear-field: {0}, {1}, {2}", field.Key.Program, field.Key.Group, field.Key.Field); + } + break; + } + } + + protected override void NotifySubscriptionAdded(MooNetClient client) + { + var operations = new List(); + + // Banner configuration + var fieldKey1 = FieldKeyHelper.Create(FieldKeyHelper.Program.D3, 2, 1, 0); + var field1 = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey1).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(client.Account.BannerConfiguration.ToByteString()).Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field1).Build()); + + // Class + var fieldKey2 = FieldKeyHelper.Create(FieldKeyHelper.Program.D3, 3, 1, 0); + var field2 = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey2).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(this.ClassID).Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field2).Build()); + + // Level + var fieldKey3 = FieldKeyHelper.Create(FieldKeyHelper.Program.D3, 3, 2, 0); + var field3 = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey3).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(this.Level).Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field3).Build()); + + // Equipment + var fieldKey4 = FieldKeyHelper.Create(FieldKeyHelper.Program.D3, 3, 3, 0); + var field4 = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey4).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetMessageValue(this.Equipment.ToByteString()).Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field4).Build()); + + // Flags + var fieldKey5 = FieldKeyHelper.Create(FieldKeyHelper.Program.D3, 3, 4, 0); + var field5 = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey5).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue((uint)(this.Flags | ToonFlags.AllUnknowns)).Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field5).Build()); + + // Name + var fieldKey6 = FieldKeyHelper.Create(FieldKeyHelper.Program.BNet, 3, 2, 0); + var field6 = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey6).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetStringValue(this.Name + "#" + this.HashCodeString).Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field6).Build()); + + // Is it selected toon? + var fieldKey7 = FieldKeyHelper.Create(FieldKeyHelper.Program.BNet, 3, 3, 0); + var field7 = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey7).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetBoolValue(this.IsSelected).Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field7).Build()); + + //AwayStatus - Available, Away, Busy + var fieldKey10 = FieldKeyHelper.Create(FieldKeyHelper.Program.BNet, 3, 5, 0); + var field10 = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey10).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue((uint)(this.AwayStatus)).Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field10).Build()); + + // Program - FourCC "D3" + var fieldKey8 = FieldKeyHelper.Create(FieldKeyHelper.Program.BNet, 3, 9, 0); + var field8 = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey8).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetFourccValue("D3").Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field8).Build()); + + // Unknown int - maybe highest completed act? /raist + var fieldKey9 = FieldKeyHelper.Create(FieldKeyHelper.Program.BNet, 3, 10, 0); + var field9 = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey9).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetIntValue(0).Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field9).Build()); + + //Unknown string = always "NICKTEMPNAME" -Egris + var fieldKey11 = FieldKeyHelper.Create(FieldKeyHelper.Program.BNet, 3, 12, 0); + var field11 = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey11).SetValue(bnet.protocol.attribute.Variant.CreateBuilder().SetStringValue("NICKTEMPNAME").Build()).Build(); + operations.Add(bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field11).Build()); + + // 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 + client.MakeTargetedRPC(this, () => + bnet.protocol.channel.ChannelSubscriber.CreateStub(client).NotifyAdd(null, builder.Build(), callback => { })); + } + + public override string ToString() + { + return String.Format("{{ Toon: {0} [lowId: {1}] }}", this.Name, this.BnetEntityID.Low); + } + + public void SaveToDB() + { + try + { + if (ExistsInDB()) + { + var query = + string.Format( + "UPDATE toons SET name='{0}', hashCode={1}, class={2}, gender={3}, level={4}, accountId={5}, timePlayed={6} WHERE id={7}", + Name, this.HashCode, (byte)this.Class, (byte)this.Gender, this.Level, this.Owner.PersistentID, this.TimePlayed, this.PersistentID); + + var cmd = new SQLiteCommand(query, DBManager.Connection); + cmd.ExecuteNonQuery(); + } + else + { + var query = + string.Format( + "INSERT INTO toons (id, name, hashCode, class, gender, level, timePlayed, accountId) VALUES({0},'{1}',{2},{3},{4},{5},{6},{7})", + this.PersistentID, this.Name, this.HashCode, (byte)this.Class, (byte)this.Gender, this.Level, this.TimePlayed, this.Owner.PersistentID); + + var cmd = new SQLiteCommand(query, DBManager.Connection); + cmd.ExecuteNonQuery(); + } + } + catch (Exception e) + { + Logger.ErrorException(e, "Toon.SaveToDB()"); + } + } + + public bool DeleteFromDB() + { + try + { + // Remove from DB + if (!ExistsInDB()) return false; + + var query = string.Format("DELETE FROM toons WHERE id={0}", this.PersistentID); + var cmd = new SQLiteCommand(query, DBManager.Connection); + cmd.ExecuteNonQuery(); + return true; + } + catch (Exception e) + { + Logger.ErrorException(e, "Toon.DeleteFromDB()"); + return false; + } + } + + private bool ExistsInDB() + { + var query = + string.Format( + "SELECT id from toons where id={0}", + this.PersistentID); + + var cmd = new SQLiteCommand(query, DBManager.Connection); + var reader = cmd.ExecuteReader(); + return reader.HasRows; + } + } + + public enum ToonClass + { + 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 = Unknown1 | Unknown2 | Unknown3 | Unknown4 + } + + //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 AwayStatus : uint + { + Available = 0x00, + UnknownStatus1 = 0x01, + Away = 0x02, + UnknownStatus2 = 0x03, + Busy = 0x04 + } + +} diff --git a/src/Mooege/Core/MooNet/Toons/ToonHandleHelper.cs b/src/Mooege/Core/MooNet/Toons/ToonHandleHelper.cs new file mode 100644 index 00000000..fc6ad9b3 --- /dev/null +++ b/src/Mooege/Core/MooNet/Toons/ToonHandleHelper.cs @@ -0,0 +1,69 @@ +/* + * 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 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..ebd8c6fe --- /dev/null +++ b/src/Mooege/Core/MooNet/Toons/ToonManager.cs @@ -0,0 +1,147 @@ +/* + * 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.Data.SQLite; +using System.Linq; +using Mooege.Common.Logging; +using Mooege.Common.Storage; +using Mooege.Core.MooNet.Accounts; + +namespace Mooege.Core.MooNet.Toons +{ + // Just a quick hack - not to be meant final + public static class ToonManager + { + private static readonly Dictionary Toons = + new Dictionary(); + + private static readonly Logger Logger = LogManager.CreateLogger(); + + static ToonManager() + { + LoadToons(); + } + + public static Account GetOwnerAccountByToonLowId(ulong id) + { + var toon = (from pair in Toons where pair.Value.PersistentID == id select pair.Value).FirstOrDefault(); + return (toon != null) ? toon.Owner : null; + } + + public static Toon GetToonByLowID(ulong id) + { + return (from pair in Toons where pair.Value.PersistentID == id select pair.Value).FirstOrDefault(); + } + + public static Dictionary GetToonsForAccount(Account account) + { + return Toons.Where(pair => pair.Value.Owner != null).Where(pair => pair.Value.Owner.PersistentID == account.PersistentID).ToDictionary(pair => pair.Key, pair => pair.Value); + } + + public static int TotalToons + { + get { return Toons.Count; } + } + + //Method only used when creating a Toon for the first time, ambiguous method name - Tharuler + public static bool SaveToon(Toon toon) + { + + if (Toons.ContainsKey(toon.PersistentID)) //this should never happen again thanks to hashcode, but lets leave it in for now - Tharuler + { + Logger.Error("Duplicate persistent toon id: {0}", toon.PersistentID); + return false; + } + + Toons.Add(toon.PersistentID, toon); + toon.SaveToDB(); //possible concurrency problem? 2 toon created with same name at same time could introduce a race condition for the same hashcode(chance of 1 in (1000-amount of toons with that name)) + + Logger.Trace("Character {0} with HashCode #{1} added to database", toon.Name, toon.HashCodeString); + + return true; + } + + public static void DeleteToon(Toon toon) + { + if (!Toons.ContainsKey(toon.PersistentID)) + { + Logger.Error("Attempting to delete toon that does not exist: {0}", toon.PersistentID); + return; + } + + if (toon.DeleteFromDB()) Toons.Remove(toon.PersistentID); + } + + private static void LoadToons() + { + var query = "SELECT * from toons"; + var cmd = new SQLiteCommand(query, DBManager.Connection); + var reader = cmd.ExecuteReader(); + + if (!reader.HasRows) return; + + while (reader.Read()) + { + var databaseId = (ulong)reader.GetInt64(0); + var toon = new Toon(databaseId, reader.GetString(1), reader.GetInt32(6), reader.GetByte(2), reader.GetByte(3), reader.GetByte(4), reader.GetInt64(5),(uint)reader.GetInt32(7)); + Toons.Add(databaseId, toon); + } + } + + public static int GetUnusedHashCodeForToonName(string name) + { + var query = string.Format("SELECT hashCode from toons WHERE name='{0}'", name); + Logger.Trace(query); + var cmd = new SQLiteCommand(query, DBManager.Connection); + var reader = cmd.ExecuteReader(); + if (!reader.HasRows) return GenerateHashCodeNotInList(null); + + var codes = new HashSet(); + while (reader.Read()) + { + var hashCode = reader.GetInt32(0); + codes.Add(hashCode); + } + return GenerateHashCodeNotInList(codes); + } + + public static void Sync() + { + foreach (var pair in Toons) + { + pair.Value.SaveToDB(); + } + } + + private static int GenerateHashCodeNotInList(HashSet codes) + { + Random rnd = new Random(); + if (codes == null) return rnd.Next(1, 1000); + + int hashCode; + do + { + hashCode = rnd.Next(1, 1000); + } while (codes.Contains(hashCode)) ; + return hashCode; + + } + } +} diff --git a/src/Mooege/Core/MooNet/Web/AccountWebService.cs b/src/Mooege/Core/MooNet/Web/AccountWebService.cs new file mode 100644 index 00000000..4fb681f6 --- /dev/null +++ b/src/Mooege/Core/MooNet/Web/AccountWebService.cs @@ -0,0 +1,89 @@ +/* + * 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.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) + { + 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.")); + + 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); + 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("Accout does not exist for email address {0}.", email))); + + return account.VerifyPassword(password); + } + + [OperationContract] + public int TotalAccounts() + { + return AccountManager.TotalAccounts; + } + + [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..a6e6dc77 --- /dev/null +++ b/src/Mooege/Core/MooNet/Web/MooNetWebService.cs @@ -0,0 +1,63 @@ +/* + * 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 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.CurrentToon != null select string.Format("{0}#{1}", client.CurrentToon.Name, client.CurrentToon.HashCode)).ToList(); + } + } +} diff --git a/src/Mooege/Core/Web/CoreWebService.cs b/src/Mooege/Core/Web/CoreWebService.cs new file mode 100644 index 00000000..0013708d --- /dev/null +++ b/src/Mooege/Core/Web/CoreWebService.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 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..0329ddc4 --- /dev/null +++ b/src/Mooege/Mooege-Mono.csproj @@ -0,0 +1,678 @@ + + + + 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 + + + + ..\..\dep\astar\AStar.dll + + + ..\..\dep\crystalmpq\CrystalMpq.dll + + + ..\..\dep\crystalmpq\CrystalMpq.Utility.dll + + + ..\..\dep\sharpziplib\ICSharpCode.SharpZipLib.dll + + + ..\..\dep\openssl\ManagedOpenSsl.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 + + + ..\..\dep\powercollections\PowerCollections.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + WorldVisualizer.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Assets\account.db + PreserveNewest + + + 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 + + + \ 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..7bb45945 --- /dev/null +++ b/src/Mooege/Mooege-VS2010.csproj @@ -0,0 +1,678 @@ + + + + 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 + + + + ..\..\dep\astar\AStar.dll + + + ..\..\dep\crystalmpq\CrystalMpq.dll + + + ..\..\dep\crystalmpq\CrystalMpq.Utility.dll + + + ..\..\dep\sharpziplib\ICSharpCode.SharpZipLib.dll + + + ..\..\dep\openssl\ManagedOpenSsl.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 + + + ..\..\dep\powercollections\PowerCollections.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + WorldVisualizer.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Assets\account.db + PreserveNewest + + + 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 + + + \ No newline at end of file diff --git a/source/D3Sharp/Net/Client.cs b/src/Mooege/Net/Connection.cs similarity index 59% rename from source/D3Sharp/Net/Client.cs rename to src/Mooege/Net/Connection.cs index f06633ec..35937f78 100644 --- a/source/D3Sharp/Net/Client.cs +++ b/src/Mooege/Net/Connection.cs @@ -1,34 +1,65 @@ -using System; -using System.Linq; +/* + * 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.Net; using System.Net.Sockets; -using D3Sharp.Net.Packets; +using Mooege.Common.Logging; +using Mooege.Net.MooNet.Packets; -namespace D3Sharp.Net +namespace Mooege.Net { - public sealed class Client : IClient + public class Connection : IConnection { + protected static readonly Logger Logger = LogManager.CreateLogger(); + private readonly Server _server; - private readonly Socket _socket; + public Socket _Socket { get; private set; } private readonly byte[] _recvBuffer = new byte[BufferSize]; - public static readonly int BufferSize = 16*1024; // 16 KB + public static readonly int BufferSize = 16 * 1024; // 16 KB + + public IClient Client { get; set; } - public Dictionary Services { get; private set; } + 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 public bool IsConnected { - get { return _socket.Connected; } + get { return _Socket.Connected; } } public IPEndPoint RemoteEndPoint { - get { return _socket.RemoteEndPoint as IPEndPoint; } + get { return _Socket.RemoteEndPoint as IPEndPoint; } } public IPEndPoint LocalEndPoint { - get { return _socket.LocalEndPoint as IPEndPoint; } + get { return _Socket.LocalEndPoint as IPEndPoint; } } public byte[] RecvBuffer @@ -38,39 +69,23 @@ public byte[] 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(); + get { return _Socket; } } - - #region recv-methods public IAsyncResult BeginReceive(AsyncCallback callback, object state) { - return _socket.BeginReceive(_recvBuffer, 0, BufferSize, SocketFlags.None, callback, state); + return _Socket.BeginReceive(_recvBuffer, 0, BufferSize, SocketFlags.None, callback, state); } public int EndReceive(IAsyncResult result) { - return _socket.EndReceive(result); + return _Socket.EndReceive(result); } - #endregion - - #region send methods - - public int Send(Packet packet) + public int Send(PacketOut packet) { if (packet == null) throw new ArgumentNullException("packet"); - return Send(packet.GetRawPacketData()); + return Send(packet.Data); } public int Send(IEnumerable data) @@ -109,8 +124,6 @@ public int Send(byte[] buffer, int start, int count, SocketFlags flags) return _server.Send(this, buffer, start, count, flags); } - #endregion - public void Disconnect() { if (this.IsConnected) @@ -119,10 +132,12 @@ public void Disconnect() public override string ToString() { - if (_socket.RemoteEndPoint != null) - return _socket.RemoteEndPoint.ToString(); + if (_Socket.RemoteEndPoint != null) + return _Socket.RemoteEndPoint.ToString(); else return "Not Connected"; } + + #endregion } } diff --git a/src/Mooege/Net/ConnectionDataEventArgs.cs b/src/Mooege/Net/ConnectionDataEventArgs.cs new file mode 100644 index 00000000..e0c80995 --- /dev/null +++ b/src/Mooege/Net/ConnectionDataEventArgs.cs @@ -0,0 +1,42 @@ +/* + * 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; + +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..946b281c --- /dev/null +++ b/src/Mooege/Net/ConnectionEventArgs.cs @@ -0,0 +1,42 @@ +/* + * 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 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..da4efd2a --- /dev/null +++ b/src/Mooege/Net/GS/ClientManager.cs @@ -0,0 +1,128 @@ +/* + * 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 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.Owner.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.Owner.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..6ba76705 --- /dev/null +++ b/src/Mooege/Net/GS/Config.cs @@ -0,0 +1,31 @@ +/* + * 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 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 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..1597df6d --- /dev/null +++ b/src/Mooege/Net/GS/GameClient.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; +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 + { + 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); + + Logger.LogIncoming(message); // change ConsoleTarget's level to Level.Dump in program.cs if u want to see messages on console. + } + 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.LogOutgoing(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..e2a9bbbc --- /dev/null +++ b/src/Mooege/Net/GS/GameServer.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 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() + { + if (!this.Listen(Config.Instance.BindIP, Config.Instance.Port)) return; + Logger.Info("Game-Server is listening on {0}:{1}...", Config.Instance.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..85214a0b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDChangeActorMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..74587f36 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDChangeGBHandleMessage.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; +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/ACDCollFlagsMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDCollFlagsMessage.cs new file mode 100644 index 00000000..c9cddbb8 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDCollFlagsMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..bcb53db1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDCreateActorMessage.cs @@ -0,0 +1,63 @@ +/* + * 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.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..3861d6a3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDDestroyActorMessage.cs @@ -0,0 +1,63 @@ +/* + * 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.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..31d5d0f0 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDEnterKnownMessage.cs @@ -0,0 +1,165 @@ +/* + * 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.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(5); + 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(5, 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..44c18b38 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDGroupMessage.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDGroupMessage)] + public class ACDGroupMessage : GameMessage + { + public uint ActorID; // Actor's DynamicID + public int Field1; + public int Field2; + + public ACDGroupMessage() : base(Opcodes.ACDGroupMessage) { } + + public override void Parse(GameBitBuffer buffer) + { + ActorID = buffer.ReadUInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ActorID); + buffer.WriteInt(32, Field1); + buffer.WriteInt(32, Field2); + } + + 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" + Field1.ToString("X8") + " (" + Field1 + ")"); + 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/ACDInventoryPositionMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDInventoryPositionMessage.cs new file mode 100644 index 00000000..6194ccdd --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDInventoryPositionMessage.cs @@ -0,0 +1,74 @@ +/* + * 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.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..a052b7fd --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDInventoryUpdateActorSNO.cs @@ -0,0 +1,57 @@ +/* + * 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.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..851fca7f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDLookAtMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..15d96179 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDPickupFailedMessage.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.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..e5ce03a6 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDShearMessage.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 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/ACDTranslateArcMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateArcMessage.cs new file mode 100644 index 00000000..639b66bf --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateArcMessage.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.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 i guess, exact math is unknown - farmy + public int Field3; + public int FlyingAnimationTagID; // TagID of the flying animation or -1 + public int LandingAnimationTagID; // TagID of the landing animation or -1 + public float Field6; // some sort of fallof / individual gravity..always < 0...math is unknown - farmy + public int /* sno */ Field7; // its a power sno, like in knockback.pow. but i dont know what its used for -farmy + public float Field8; + public float Field9; + + 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); + Field6 = buffer.ReadFloat32(); + Field7 = buffer.ReadInt(32); + Field8 = buffer.ReadFloat32(); + Field9 = 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(Field6); + buffer.WriteInt(32, Field7); + buffer.WriteFloat32(Field8); + buffer.WriteFloat32(Field9); + } + + 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("Field6: " + Field6.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field7: 0x" + Field7.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field8: " + Field8.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field9: " + Field9.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..46022d03 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateDetPathMessage.cs @@ -0,0 +1,118 @@ +/* + * 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.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..79976fbd --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateDetPathSinMessage.cs @@ -0,0 +1,116 @@ +/* + * 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.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..237118db --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateDetPathSpiralMessage.cs @@ -0,0 +1,82 @@ +/* + * 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.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..337cf9aa --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateFacingMessage.cs @@ -0,0 +1,76 @@ +/* + * 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.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..fa5ffcec --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateFixedMessage.cs @@ -0,0 +1,76 @@ +/* + * 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 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..9383c61b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateFixedUpdateMessage.cs @@ -0,0 +1,65 @@ +/* + * 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.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/ACDTranslateSnappedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateSnappedMessage.cs new file mode 100644 index 00000000..e2598f9e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateSnappedMessage.cs @@ -0,0 +1,70 @@ +/* + * 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 Mooege.Core.GS.Common.Types.Math; + +namespace Mooege.Net.GS.Message.Definitions.ACD +{ + [Message(Opcodes.ACDTranslateSnappedMessage)] + public class ACDTranslateSnappedMessage : GameMessage + { + public int Field0; + public Vector3D Field1; + public float /* angle */ Field2; + public bool Field3; + public int Field4; + + public ACDTranslateSnappedMessage() : base(Opcodes.ACDTranslateSnappedMessage) { } + + 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); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + buffer.WriteFloat32(Field2); + buffer.WriteBool(Field3); + buffer.WriteInt(25, Field4); + } + + 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" + Field0.ToString("X8")); + Field1.AsText(b, pad); + b.Append(' ', pad); b.AppendLine("Field2: " + Field2.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field3: " + (Field3 ? "true" : "false")); + 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/ACD/ACDTranslateSyncMessage.cs b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateSyncMessage.cs new file mode 100644 index 00000000..aa666dd7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDTranslateSyncMessage.cs @@ -0,0 +1,74 @@ +/* + * 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.ACD +{ + [Message(Opcodes.ACDTranslateSyncMessage)] + public class ACDTranslateSyncMessage : GameMessage + { + public int Field0; + public Vector3D Field1; + public bool? Field2; + + 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(); + } + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + buffer.WriteBool(Field2.HasValue); + if (Field2.HasValue) + { + buffer.WriteBool(Field2.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")); + } + 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..d4431cbb --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/ACD/ACDWorldPositionMessage.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; +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..0944d69b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Act/ActTransitionMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..31fb510a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Act/ActTransitionStartedMessage.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.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..7cf56244 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Actor/DebugActorTooltipMessage.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.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..f5976bb6 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Animation/LoopingAnimationPowerMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..0e262a4e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Animation/PlayAnimationMessage.cs @@ -0,0 +1,72 @@ +/* + * 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.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..4aff0106 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Animation/SecondaryAnimationPowerMessage.cs @@ -0,0 +1,71 @@ +/* + * 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.Common.Helpers; +using Mooege.Core.GS.Skills; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Animation +{ + [Message(Opcodes.SecondaryAnimationPowerMessage)] + public class SecondaryAnimationPowerMessage : GameMessage,ISelfHandler + { + public int /* sno */ PowerSNO; + public AnimPreplayData Field1; + + public void Handle(GameClient client) + { } + + 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..47aff95a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Animation/SetIdleAnimationMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..7c892296 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/ArtisanWindowClosedMessage.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.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..1afcac12 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/BlacksmithDataInitialMessage.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.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..69c175c5 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/BlacksmithDataProgressMessage.cs @@ -0,0 +1,52 @@ +/* + * 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 D3.Profile; +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..5cb67c95 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/CraftInteractionMessage.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +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..ae2f07c2 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/CrafterLevelUpMessage.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 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..fc4cee08 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/CraftingResultsMessage.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 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..0241dda4 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/EnchantItemMessage.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.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..4586df48 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/JewelerDataInitialMessage.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.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..c3e29a43 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/JewelerDataProgressMessage.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.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..537a192b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/MysticDataInitialMessage.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.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..95c3c4ee --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/MysticDataProgressMessage.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.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..2e0cb53e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/OpenArtisanWindowMessage.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.Collections.Generic; +using System.Linq; +using System.Text; +using Mooege.Net.GS.Message.Definitions.Misc; + +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..128847e1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/RequestAddSocketMessage.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +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..c1541e5c --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Artisan/TrainArtisanMessage.cs @@ -0,0 +1,46 @@ +/* + * 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.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..5ebaab85 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Attribute/AttributeSetValueMessage.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.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..eac0f9f1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Attribute/AttributesSetValuesMessage.cs @@ -0,0 +1,65 @@ +/* + * 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.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..a66654a3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Audio/PlayErrorSoundMessage.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.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..ed3a457e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Audio/PlayMusicMessage.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.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..2b7e5f50 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Audio/PlayNonPositionalSoundMessage.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.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..ce7bcc29 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Camera/BossZoomMessage.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.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..6699e2cb --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Camera/CameraFocusMessage.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 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..10b27038 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Camera/CameraYawMessage.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 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..ef85c886 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Camera/CameraZoomMessage.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 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..0d4b0fd6 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Chat/ChatMessage.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 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..56933f6e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Chat/TryChatMessage.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 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..9d0d62c2 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Combat/AimTargetMessage.cs @@ -0,0 +1,63 @@ +/* + * 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.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..79e68152 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Combat/DeathFadeTimeMessage.cs @@ -0,0 +1,63 @@ +/* + * 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.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..f63bccdf --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Combat/KillCountMessage.cs @@ -0,0 +1,63 @@ +/* + * 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.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..b73a4632 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Combat/KillCounterUpdateMessage.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.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..24d3497d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Combat/LowHealthCombatMessage.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.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..f287a556 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Combat/VictimMessage.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.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 */ snoKillerMonster; + 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); + snoKillerMonster = buffer.ReadInt(32); + 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, snoKillerMonster); + 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("snoKillerMonster: 0x" + snoKillerMonster.ToString("X8")); + 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..d2df723f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Connection/ConnectionEstablishedMessage.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.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..9706a9cf --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Connection/LogoutComplete.cs @@ -0,0 +1,56 @@ +/* + * 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.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..c3a000db --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Connection/LogoutContextMessage.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.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..6a90a66c --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Connection/LogoutTickTimeMessage.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.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..e6c28070 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Console/TryConsoleCommand.cs @@ -0,0 +1,65 @@ +/* + * 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.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Console +{ + [Message(new[]{Opcodes.TryConsoleCommand1, Opcodes.TryConsoleCommand2})] + public class TryConsoleCommand : GameMessage + { + public string Field0; + public int Field1; + public WorldPlace Field2; + public int Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadCharArray(512); + Field1 = buffer.ReadInt(4) + (-1); + Field2 = new WorldPlace(); + Field2.Parse(buffer); + Field3 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteCharArray(512, Field0); + buffer.WriteInt(4, Field1 - (-1)); + 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: \"" + Field0 + "\""); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + Field1.ToString("X8") + " (" + 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..3780073a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Conversation/AdvanceConvMessage.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.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..248dc308 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Conversation/EndConversationMessage.cs @@ -0,0 +1,69 @@ +/* + * 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.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..ca52d788 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Conversation/FinishConversationMessage.cs @@ -0,0 +1,65 @@ +/* + * 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.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..d779877b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Conversation/PlayConvLineMessage.cs @@ -0,0 +1,77 @@ +/* + * 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.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..2fda4594 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Conversation/RequestCloseConversationWindowMessage.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 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..d2cef1d8 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Conversation/StopConvLineMessage.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.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..b9d232f9 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Conversation/UpdateConvAutoAdvanceMessage.cs @@ -0,0 +1,74 @@ +/* + * 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.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..fef7b536 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Effect/PlayEffectMessage.cs @@ -0,0 +1,261 @@ +/* + * 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.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..0666a488 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Effect/PlayHitEffectMessage.cs @@ -0,0 +1,65 @@ +/* + * 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.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..c7241753 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Effect/PlayHitEffectOverrideMessage.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 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..6daf4513 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Encounter/BossEncounterMessage.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.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..db879e28 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Encounter/EncounterInviteStateMessage.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 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..04fe6766 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/BNetJoinGameRequestResultMessage.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.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..56a2e3f4 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/CreateBNetGameMessage.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.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..20a5265a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/CreateBNetGameResultMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..2b38fcc4 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/GameIdMessage.cs @@ -0,0 +1,53 @@ +/* + * 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.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..4ff894d6 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/GameSetupMessage.cs @@ -0,0 +1,52 @@ +/* + * 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.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..fbc7f581 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/GameSyncedDataMessage.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.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..fb34c31b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/GameTestingSamplingStartMessage.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.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..df75487c --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/JoinBNetGameMessage.cs @@ -0,0 +1,76 @@ +/* + * 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.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..d0a75ec5 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/JoinLANGameMessage.cs @@ -0,0 +1,63 @@ +/* + * 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.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..31ee0152 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/QuitGameMessage.cs @@ -0,0 +1,53 @@ +/* + * 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.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..4d5a5c91 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/RequestJoinBNetGameMessage.cs @@ -0,0 +1,62 @@ +/* + * 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.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..c2da5702 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Game/VersionsMessage.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.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..20e46cfd --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hero/CreateHeroMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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(29); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteCharArray(49, Name); + buffer.WriteInt(32, Field1); + buffer.WriteInt(29, 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..b759aba1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hero/CreateHeroResultMessage.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.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..b71d306b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hero/GoldModifiedMessage.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.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..5b698d65 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hero/HearthPortalInfoMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..3a46ff30 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hero/HeroStateMessage.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.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..ee30d92a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingDismissMessage.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +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..a2d7c146 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingHireMessage.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +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 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("}"); + } + } +} 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..99d6798d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingInfoUpdateMessage.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.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..fc337752 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingInventoryMessage.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +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..7e4ed078 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingRequestLearnSkillMessage.cs @@ -0,0 +1,58 @@ +/* + * 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.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/HirelingSwapMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingSwapMessage.cs new file mode 100644 index 00000000..9475552d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Hireling/HirelingSwapMessage.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.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..07092e92 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryDropItemMessage.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.Text; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Inventory +{ + [Message(Opcodes.ANNDataMessage9, 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..ffc0255f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryDropStackPortionMessage.cs @@ -0,0 +1,56 @@ +/* + * 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.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/InventoryRequestMoveMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestMoveMessage.cs new file mode 100644 index 00000000..c5faeca1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestMoveMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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/InventoryRequestSocketMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestSocketMessage.cs new file mode 100644 index 00000000..61aa025a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestSocketMessage.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.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..bcdfaa1f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryRequestUseMessage.cs @@ -0,0 +1,65 @@ +/* + * 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.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..301e9755 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventorySplitStackMessage.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; +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..3906a5ab --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/InventoryStackTransferMessage.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 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/RequestUseCauldronOfJordanMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/RequestUseCauldronOfJordanMessage.cs new file mode 100644 index 00000000..ee79e56d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/RequestUseCauldronOfJordanMessage.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + /// + /// Sent by the client, when the player uses cauldron of jordan on an item + /// + [Message(Opcodes.RequestUseCauldronOfJordanMessage, Consumers.Inventory)] + public class RequestUseCauldronOfJordanMessage : GameMessage + { + public uint ActorID; // Id of the target + + public RequestUseCauldronOfJordanMessage() : base(Opcodes.RequestUseCauldronOfJordanMessage) { } + + 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("RequestUseCauldronOfJordanMessage:"); + 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/RequestUseNephalemCubeMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Inventory/RequestUseNephalemCubeMessage.cs new file mode 100644 index 00000000..3a7c3569 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/RequestUseNephalemCubeMessage.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.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..5a3f069a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Inventory/VisualInventoryMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..cb27e470 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Map/MapMarkerInfoMessage.cs @@ -0,0 +1,105 @@ +/* + * 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.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 /* sno */ m_snoStringList; + public int Field4; + public float Field5; + public float Field6; + public float Field7; + public int Field8; + public bool Field9; + public bool Field10; + public bool 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); + m_snoStringList = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadFloat32(); + Field6 = buffer.ReadFloat32(); + Field7 = buffer.ReadFloat32(); + Field8 = buffer.ReadInt(32); + Field9 = buffer.ReadBool(); + Field10 = buffer.ReadBool(); + Field11 = buffer.ReadBool(); + Field12 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, m_snoStringList); + buffer.WriteInt(32, Field4); + buffer.WriteFloat32(Field5); + buffer.WriteFloat32(Field6); + buffer.WriteFloat32(Field7); + buffer.WriteInt(32, Field8); + buffer.WriteBool(Field9); + buffer.WriteBool(Field10); + buffer.WriteBool(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("m_snoStringList: 0x" + m_snoStringList.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field4: 0x" + Field4.ToString("X8") + " (" + Field4 + ")"); + b.Append(' ', pad); b.AppendLine("Field5: " + Field5.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field6: " + Field6.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field7: " + Field7.ToString("G")); + b.Append(' ', pad); b.AppendLine("Field8: 0x" + Field8.ToString("X8") + " (" + Field8 + ")"); + b.Append(' ', pad); b.AppendLine("Field9: " + (Field9 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field10: " + (Field10 ? "true" : "false")); + b.Append(' ', pad); b.AppendLine("Field11: " + (Field11 ? "true" : "false")); + 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..7ea23365 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Map/MapRevealSceneMessage.cs @@ -0,0 +1,71 @@ +/* + * 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; +using Mooege.Core.GS.Map; + +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 SceneMiniMapVisibility 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 = (SceneMiniMapVisibility)buffer.ReadInt(3); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, ChunkID); + buffer.WriteInt(32, SceneSNO); + Transform.Encode(buffer); + buffer.WriteUInt(32, WorldID); + buffer.WriteInt(3, (int)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: 0x" + ((int)MiniMapVisibility).ToString("X8") + " (" + MiniMapVisibility + ")"); + 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..f68f05ea --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/ANNDataMessage.cs @@ -0,0 +1,58 @@ +/* + * 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.Misc +{ + [Message(new[] { + Opcodes.ANNDataMessage8, Opcodes.ANNDataMessage10, Opcodes.ANNDataMessage11, Opcodes.ANNDataMessage13, Opcodes.ANNDataMessage15, + Opcodes.ANNDataMessage16, Opcodes.ANNDataMessage17, Opcodes.ANNDataMessage18, Opcodes.UseNephalemAltarMessage, 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..b486daad --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/AffixMessage.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.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..108b95c4 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/BlizzconCVarsMessage.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 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..bc1d9489 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/BoolDataMessage.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.BoolDataMessage2)] + 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..093c101d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/DWordDataMessage.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 Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(new[] { + Opcodes.DWordDataMessage1,Opcodes.DWordDataMessage2,Opcodes.DWordDataMessage3,Opcodes.DWordDataMessage4,Opcodes.DWordDataMessage5, + Opcodes.DWordDataMessage7,Opcodes.DWordDataMessage8,Opcodes.DWordDataMessage9,Opcodes.DWordDataMessage10,Opcodes.DWordDataMessage11})] + 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..0d18e955 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/DataIDDataMessage.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.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..7277ffe0 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/EntityIdMessage.cs @@ -0,0 +1,53 @@ +/* + * 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.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..1c7ef266 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/FlippyMessage.cs @@ -0,0 +1,71 @@ +/* + * 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.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..b41703e2 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/FloatingAmountMessage.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.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..429e0894 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/FloatingNumberMessage.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.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..5955f8c6 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/GBIDDataMessage.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(new[] {Opcodes.GBIDDataMessage1, Opcodes.GBIDDataMessage2})] + 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..c33ca48e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/GenericBlobMessage.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(new[] { + Opcodes.GenericBlobMessage1, Opcodes.GenericBlobMessage2, Opcodes.GenericBlobMessage3, Opcodes.GenericBlobMessage4, Opcodes.GenericBlobMessage5 + })] + 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/HelperDetachMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/HelperDetachMessage.cs new file mode 100644 index 00000000..5d05ff27 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/HelperDetachMessage.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.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..36318ed7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/IntDataMessage.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(new[] {Opcodes.IntDataMessage1, Opcodes.IntDataMessage2, 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..c6215042 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/InterstitialMessage.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.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..dc5506e2 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/Message.cs @@ -0,0 +1,74 @@ +/* + * 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.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Game +{ + [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/NephalemAltarWindowClosedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/NephalemAltarWindowClosedMessage.cs new file mode 100644 index 00000000..e763aa65 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/NephalemAltarWindowClosedMessage.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.Text; +using System; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.NephalemAltarWindowClosedMessage)] + public class NephalemAltarWindowClosedMessage : 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("NephalemAltarWindowClosedMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + 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..c377d764 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/NetworkAddressMessage.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.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..12c04661 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/PlayCutsceneMessage.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.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..ee20e759 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/PlayerBannerMessage.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.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("PlayCutsceneMessage:"); + 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..108f2c83 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/PlayerBusyMessage.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.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("BoolDataMessage:"); + 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..c585cbca --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/PortalSpecifierMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..a08d8940 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/ProjectileStickMessage.cs @@ -0,0 +1,62 @@ +/* + * 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.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..a8799c9b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/RareItemNameMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..ebc49cb9 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/RareMonsterNamesMessage.cs @@ -0,0 +1,69 @@ +/* + * 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.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..81498313 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/RemoveRagdollMessage.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.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..27f5b62d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/ReturnPointInfoMessage.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.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..0f039142 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/RopeEffectMessageACDToACD.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.RopeEffectMessageACDToACD)] + public class RopeEffectMessageACDToACD : GameMessage + { + public int /* sno */ Field0; + public int Field1; + public int Field2; + public int Field3; + public int Field4; + + 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 override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RopeEffectMessageACDToACD:"); + 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 + ")"); + 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..60c9441e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/RopeEffectMessageACDToPlace.cs @@ -0,0 +1,65 @@ +/* + * 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.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.RopeEffectMessageACDToPlace)] + public class RopeEffectMessageACDToPlace : GameMessage + { + public int /* sno */ Field0; + public int Field1; + public int Field2; + 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 override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("RopeEffectMessageACDToPlace:"); + 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 + ")"); + Field3.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..55d93bc3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/SNODataMessage.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.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..6fc86ae7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/SNONameDataMessage.cs @@ -0,0 +1,56 @@ +/* + * 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.SNO; +using Mooege.Net.GS.Message.Fields; + +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..f06241f1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/SalvageResultsMessage.cs @@ -0,0 +1,70 @@ +/* + * 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.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..83525026 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/SavePointInfoMessage.cs @@ -0,0 +1,53 @@ +/* + * 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.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..8034e045 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/SaviorMessage.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.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..74410a62 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/ShrineActivatedMessage.cs @@ -0,0 +1,52 @@ +/* + * 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.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..7a1b6703 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/SimpleMessage.cs @@ -0,0 +1,58 @@ +/* + * 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 Mooege.Core.GS.Common.Types.Math; +using Mooege.Net.GS.Message.Definitions.ACD; +using Mooege.Net.GS.Message.Definitions.Hireling; +using Mooege.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(new[]{ + Opcodes.SimpleMessage1, Opcodes.SimpleMessage2, Opcodes.SimpleMessage5, Opcodes.SimpleMessage6, Opcodes.SimpleMessage7, Opcodes.SimpleMessage8, + Opcodes.SimpleMessage10, Opcodes.SimpleMessage11, Opcodes.SimpleMessage12, Opcodes.SimpleMessage14, Opcodes.SimpleMessage16, + Opcodes.SimpleMessage18, Opcodes.SimpleMessage19, Opcodes.SimpleMessage20, Opcodes.SimpleMessage21, Opcodes.SimpleMessage22, Opcodes.SimpleMessage23, Opcodes.SimpleMessage24, + Opcodes.SimpleMessage25, Opcodes.SimpleMessage26, Opcodes.SimpleMessage27, Opcodes.SimpleMessage28, Opcodes.SimpleMessage29, Opcodes.SimpleMessage30, Opcodes.SimpleMessage31, + Opcodes.SimpleMessage32, Opcodes.SimpleMessage34, Opcodes.SimpleMessage35, Opcodes.SimpleMessage36, Opcodes.SimpleMessage37, Opcodes.SimpleMessage38, + Opcodes.SimpleMessage39, Opcodes.SimpleMessage40, Opcodes.SimpleMessage41, Opcodes.SimpleMessage42, + Opcodes.SimpleMessage46, Opcodes.SimpleMessage47})] + public class SimpleMessage : 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("SimpleMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Misc/SocketSpellMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Misc/SocketSpellMessage.cs new file mode 100644 index 00000000..0ac93dfe --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/SocketSpellMessage.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.Misc +{ + [Message(Opcodes.SocketSpellMessage, Consumers.Player)] + public class SocketSpellMessage : GameMessage + { + public int RuneDynamicId; + public int PowerSNOId; + + public override void Parse(GameBitBuffer buffer) + { + RuneDynamicId = buffer.ReadInt(32); + PowerSNOId = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, RuneDynamicId); + buffer.WriteInt(32, PowerSNOId); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("SocketSpellMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("RuneDynamicId: 0x" + RuneDynamicId.ToString("X8") + " (" + RuneDynamicId + ")"); + b.Append(' ', pad); b.AppendLine("PowerSNOId: 0x" + PowerSNOId.ToString("X8") + " (" + PowerSNOId + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} \ No newline at end of file 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..9cbf72f5 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/TimedEventStartedMessage.cs @@ -0,0 +1,53 @@ +/* + * 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.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..f7b0f5d6 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/TrickleMessage.cs @@ -0,0 +1,224 @@ +/* + * 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.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..ed8b0560 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/UInt64DataMessage.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.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..f10f6208 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Misc/VoteKickMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..57b391eb --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/NPC/NPCInteractOptionsMessage.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.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..70fe9410 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/NPC/NPCSelectConversationMessage.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +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..098e1223 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Pet/PetDetachMessage.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; +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..2ceac8de --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Pet/PetMessage.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.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/NewPlayerMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/NewPlayerMessage.cs new file mode 100644 index 00000000..a64254c8 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/NewPlayerMessage.cs @@ -0,0 +1,101 @@ +/* + * 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.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(101); + 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(101, 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..e7d79878 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerActorSetInitialMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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/PlayerChangeHotbarButtonMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerChangeHotbarButtonMessage.cs new file mode 100644 index 00000000..66852382 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerChangeHotbarButtonMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.Net.GS.Message.Fields; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + [Message(Opcodes.PlayerChangeHotbarButtonMessage, Consumers.Player)] + public class PlayerChangeHotbarButtonMessage : GameMessage + { + public int BarIndex; + public HotbarButtonData ButtonData; + + public override void Parse(GameBitBuffer buffer) + { + BarIndex = buffer.ReadInt(4) + (-1); + ButtonData = new HotbarButtonData(); + ButtonData.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, BarIndex - (-1)); + ButtonData.Encode(buffer); + } + + public override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerChangeHotbarButtonMessage:"); + b.Append(' ', pad++); + b.AppendLine("{"); + b.Append(' ', pad); b.AppendLine("Field0: 0x" + BarIndex.ToString("X8") + " (" + BarIndex + ")"); + ButtonData.AsText(b, pad); + 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..067c9100 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerDeSyncSnapMessage.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.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..f82bbd72 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerEnterKnownMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..6006edc9 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerIndexMessage.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + [Message(new[] {Opcodes.PlayerIndexMessage1, Opcodes.PlayerIndexMessage2, Opcodes.PlayerIndexMessage3, Opcodes.PlayerIndexMessage4, Opcodes.PlayerIndexMessage5, Opcodes.PlayerIndexMessage6})] + 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/PlayerLevel.cs b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerLevel.cs new file mode 100644 index 00000000..fb8f064b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerLevel.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + [Message(Opcodes.PlayerLevel)] + public class PlayerLevel : GameMessage + { + public int Field0; + public int Field1; + + 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 override void AsText(StringBuilder b, int pad) + { + b.Append(' ', pad); + b.AppendLine("PlayerLevel:"); + 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/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..0b78546f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerQuestMessage.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.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..3f248dd9 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerTranslateFacingMessage.cs @@ -0,0 +1,76 @@ +/* + * 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.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..f0c46e87 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/PlayerWarpedMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..a8fc9ba6 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/RequestBuffCancelMessage.cs @@ -0,0 +1,58 @@ +/* + * 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.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..1453ae13 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Player/RequestUsePowerMessage.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Mooege.Net.GS.Message.Definitions.Player +{ + /* 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/Quest/LoreMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Quest/LoreMessage.cs new file mode 100644 index 00000000..96364515 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Quest/LoreMessage.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.Quest +{ + [Message(Opcodes.LoreMessage)] + public class LoreMessage : GameMessage + { + public int LoreSNOId; + + 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..85895fb3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Quest/QuestCounterMessage.cs @@ -0,0 +1,77 @@ +/* + * 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.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..6917b749 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Quest/QuestMeterMessage.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 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..17336581 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Quest/QuestStepCompleteMessage.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.Text; +using Mooege.Net.GS.Message.Fields; +using Mooege.Core.GS.Items; +using D3.Quests; +using System.Reflection; +using System; + +namespace Mooege.Net.GS.Message.Definitions.Quests +{ + [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..ad66dab7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Quest/QuestUpdateMessage.cs @@ -0,0 +1,73 @@ +/* + * 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.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..1e98a6f7 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Scene/DestroySceneMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..a171db49 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Scene/RevealSceneMessage.cs @@ -0,0 +1,90 @@ +/* + * 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.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..9814dc3d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Scene/SwapSceneMessage.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 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..43d08439 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Skill/AssignActiveSkillMessage.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.Skill +{ + [Message(Opcodes.AssignSkillMessage1, Consumers.Player)] + public class AssignActiveSkillMessage : GameMessage + { + public int /* sno */ SNOSkill; + public int SkillIndex; + + public override void Parse(GameBitBuffer buffer) + { + SNOSkill = buffer.ReadInt(32); + SkillIndex = buffer.ReadInt(5); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, SNOSkill); + 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("snoPower: 0x" + SNOSkill.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field1: 0x" + SkillIndex.ToString("X8") + " (" + SkillIndex + ")"); + b.Append(' ', --pad); + b.AppendLine("}"); + } + + + } +} diff --git a/src/Mooege/Net/GS/Message/Definitions/Skill/AssignPassiveSkillMessage.cs b/src/Mooege/Net/GS/Message/Definitions/Skill/AssignPassiveSkillMessage.cs new file mode 100644 index 00000000..e2157b18 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Skill/AssignPassiveSkillMessage.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.Skill +{ + [Message(Opcodes.AssignSkillMessage2, Consumers.Player)] + public class AssignPassiveSkillMessage : GameMessage + { + public int /* sno */ SNOSkill; + public int SkillIndex; + + public override void Parse(GameBitBuffer buffer) + { + SNOSkill = buffer.ReadInt(32); + SkillIndex = buffer.ReadInt(5); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, SNOSkill); + 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("snoPower: 0x" + SNOSkill.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field1: 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..9fbc6726 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Skill/AssignSkillMessage.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.Skill +{ + [Message(new[] { Opcodes.AssignSkillMessage3, Opcodes.AssignSkillMessage4 })] + public class AssignSkillMessage : GameMessage + { + public int /* sno */ SNOSkill; + public int SkillIndex; + + public override void Parse(GameBitBuffer buffer) + { + SNOSkill = buffer.ReadInt(32); + SkillIndex = buffer.ReadInt(5); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, SNOSkill); + 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("snoPower: 0x" + SNOSkill.ToString("X8")); + b.Append(' ', pad); b.AppendLine("Field1: 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..621fb11e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Stash/OpenSharedStashMessage.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 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..24076549 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Stash/RequestBuySharedStashSlots.cs @@ -0,0 +1,56 @@ +/* + * 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.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..6f415d88 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Team/RevealTeamMessage.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 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..2759009e --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Text/BroadcastTextMessage.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.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..3ee5d9e3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Text/DisplayGameTextMessage.cs @@ -0,0 +1,79 @@ +/* + * 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.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..6ea37866 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Tick/EndOfTickMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..4e80233a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Tick/GameTickMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..8fbb14fa --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Trade/OpenTradeWindow.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.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..fbfda48d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Trade/RequestBuyItemMessage.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.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..619c35c1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Trade/RequestSellItemMessage.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.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..5c1793f1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Trade/TradeMessage.cs @@ -0,0 +1,76 @@ +/* + * 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.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..11df558d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Tutorial/TutorialMessage.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.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..89ac1766 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Tutorial/TutorialShownMessage.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.Tutorial +{ + /// + /// Sent by the client after it has shown a tutorial + /// + [Message(Opcodes.TutorialShownMessage)] + public class TutorialShownMessage : GameMessage, ISelfHandler + { + 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("}"); + } + + + /// + /// Server only has to save what tutorials are shown, so the player + /// does not have to see them over and over... + /// + /// + public void Handle(GameClient client) + { + for (int i = 0; i < client.Player.SeenTutorials.Length; i++) + if (client.Player.SeenTutorials[i] == -1) + { + client.Player.SeenTutorials[i] = SNOTutorial; + break; + } + } + } +} \ 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..1b09a83c --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/UI/UIElementMessage.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.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..18addcbf --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Waypoint/OpenWaypointSelectionWindowMessage.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.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..5c1670c8 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Waypoint/TryWaypointMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.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..3d5bd494 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/Waypoint/WaypointActivatedMessage.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 Mooege.Net.GS.Message.Definitions.Waypoint +{ + [Message(Opcodes.WaypointActivatedMessage)] + public class WaypointActivatedMessage : 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("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("}"); + } + + + } +} \ 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..7ede2428 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/World/EnterWorldMessage.cs @@ -0,0 +1,62 @@ +/* + * 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.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..1470b051 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/World/RevealWorldMessage.cs @@ -0,0 +1,57 @@ +/* + * 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.World +{ + [Message(Opcodes.RevealWorldMessage)] + public class RevealWorldMessage : GameMessage + { + public uint WorldID; // World's DynamicID + public int /* sno */ WorldSNO; + + public RevealWorldMessage() : base(Opcodes.RevealWorldMessage) {} + + public override void Parse(GameBitBuffer buffer) + { + WorldID = buffer.ReadUInt(32); + WorldSNO = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteUInt(32, WorldID); + buffer.WriteInt(32, WorldSNO); + } + + 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("}"); + } + + + } +} 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..f792e267 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/World/TargetMessage.cs @@ -0,0 +1,87 @@ +/* + * 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.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..bd1559d5 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/World/WeatherOverrideMessage.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.Text; + +namespace Mooege.Net.GS.Message.Definitions.World +{ + [Message(Opcodes.WeatherOverrideMessage)] + public class WeatherOverrideMessage : 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("WeatherOverrideMessage:"); + 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/World/WorldDeletedMessage.cs b/src/Mooege/Net/GS/Message/Definitions/World/WorldDeletedMessage.cs new file mode 100644 index 00000000..8aa32551 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/World/WorldDeletedMessage.cs @@ -0,0 +1,53 @@ +/* + * 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.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..217b6b63 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Definitions/World/WorldStatusMessage.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.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..8f610852 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/ActiveEvent.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.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/AnimPreplayData.cs b/src/Mooege/Net/GS/Message/Fields/AnimPreplayData.cs new file mode 100644 index 00000000..738e8df3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/AnimPreplayData.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.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..314706e0 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/DPathSinData.cs @@ -0,0 +1,76 @@ +/* + * 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.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..3f9fe523 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/EntityId.cs @@ -0,0 +1,56 @@ +/* + * 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.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..e7e7f0e1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/GBHandle.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.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..6621d0b1 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/GameId.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.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..0a36539a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/GameSyncedData.cs @@ -0,0 +1,123 @@ +/* + * 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.Fields +{ + public class GameSyncedData + { + public bool 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.ReadBool(); + 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.WriteBool(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: " + (Field0 ? "true" : "false")); + 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..df653b4b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/HeroStateData.cs @@ -0,0 +1,101 @@ +/* + * 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.Fields +{ + public class HeroStateData + { + public int Field0; + public int Field1; + public int Field2; + public int Gender; + 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); + Gender = buffer.ReadInt(29); + 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(29, Gender); + 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" + Gender.ToString("X8") + " (" + Gender + ")"); + 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..76c9c934 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/HirelingInfo.cs @@ -0,0 +1,89 @@ +/* + * 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.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..6d9b1a2b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/HirelingSavedData.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.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..48261416 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/HotbarButtonData.cs @@ -0,0 +1,56 @@ +/* + * 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.Fields +{ + public class HotbarButtonData + { + public int /* sno */ SNOSkill; + public int /* gbid */ ItemGBId; + + public void Parse(GameBitBuffer buffer) + { + SNOSkill = buffer.ReadInt(32); + ItemGBId = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, SNOSkill); + 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("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..245c886b --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/InvLoc.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.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..45e3025a --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/InventoryLocationMessageData.cs @@ -0,0 +1,62 @@ +/* + * 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; + +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..f0bb4d57 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/LearnedLore.cs @@ -0,0 +1,72 @@ +/* + * 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.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..4fb45c89 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/NPCInteraction.cs @@ -0,0 +1,87 @@ +/* + * 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.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..d47c3e6f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/NetAttributeKeyValue.cs @@ -0,0 +1,135 @@ +/* + * 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.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..508f4a3c --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/PlayAnimationMessageSpec.cs @@ -0,0 +1,82 @@ +/* + * 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.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..bed80a74 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/PlayLineParams.cs @@ -0,0 +1,193 @@ +/* + * 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.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; + + /// + /// 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(); + 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.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("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("Gender: 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..74bf4ea3 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/PlayerQuestRewardHistoryEntry.cs @@ -0,0 +1,70 @@ +/* + * 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.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..c112521d --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/PlayerSavedData.cs @@ -0,0 +1,187 @@ +/* + * 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.Fields +{ + public class PlayerSavedData + { + // MaxLength = 9 + public HotbarButtonData[] HotBarButtons; + // MaxLength = 15 + public SkillKeyMapping[] SkilKeyMappings; + public int PlaytimeTotal; + public int WaypointFlags; + public HirelingSavedData Field4; + public int Field5; + public LearnedLore LearnedLore; + // MaxLength = 6 + public int /* sno */[] snoActiveSkills; + // MaxLength = 3 + public int /* sno */[] snoTraits; + public SavePointData SavePointData; + // MaxLength = 64 + public int /* sno */[] m_SeenTutorials; + + public void Parse(GameBitBuffer buffer) + { + HotBarButtons = new HotbarButtonData[9]; + for (int i = 0; i < HotBarButtons.Length; i++) + { + HotBarButtons[i] = new HotbarButtonData(); + HotBarButtons[i].Parse(buffer); + } + SkilKeyMappings = new SkillKeyMapping[15]; + for (int i = 0; i < SkilKeyMappings.Length; i++) + { + SkilKeyMappings[i] = new SkillKeyMapping(); + SkilKeyMappings[i].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); + snoActiveSkills = new int /* sno */[6]; + for (int i = 0; i < snoActiveSkills.Length; i++) snoActiveSkills[i] = buffer.ReadInt(32); + snoTraits = new int /* sno */[3]; + for (int i = 0; i < snoTraits.Length; i++) snoTraits[i] = buffer.ReadInt(32); + SavePointData = new SavePointData(); + SavePointData.Parse(buffer); + m_SeenTutorials = new int /* sno */[64]; + for (int i = 0; i < m_SeenTutorials.Length; i++) m_SeenTutorials[i] = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + for (int i = 0; i < HotBarButtons.Length; i++) + { + HotBarButtons[i].Encode(buffer); + } + for (int i = 0; i < SkilKeyMappings.Length; i++) + { + SkilKeyMappings[i].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 < snoActiveSkills.Length; i++) buffer.WriteInt(32, snoActiveSkills[i]); + for (int i = 0; i < snoTraits.Length; i++) buffer.WriteInt(32, snoTraits[i]); + SavePointData.Encode(buffer); + for (int i = 0; i < m_SeenTutorials.Length; i++) buffer.WriteInt(32, m_SeenTutorials[i]); + } + + 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); + b.AppendLine("Field1:"); + b.Append(' ', pad); + b.AppendLine("{"); + for (int i = 0; i < SkilKeyMappings.Length; i++) + { + SkilKeyMappings[i].AsText(b, pad + 1); + b.AppendLine(); + } + b.Append(' ', pad); + b.AppendLine("}"); + b.AppendLine(); + b.Append(' ', pad); + b.AppendLine("PlaytimeTotal: 0x" + PlaytimeTotal.ToString("X8")); + 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 < snoActiveSkills.Length;) + { + b.Append(' ', pad + 1); + for (int j = 0; j < 8 && i < snoActiveSkills.Length; j++, i++) + { + b.Append("0x" + snoActiveSkills[i].ToString("X8") + ", "); + } + 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("m_SeenTutorials:"); + b.Append(' ', pad); + b.AppendLine("{"); + for (int i = 0; i < m_SeenTutorials.Length;) + { + b.Append(' ', pad + 1); + for (int j = 0; j < 8 && i < m_SeenTutorials.Length; j++, i++) + { + b.Append("0x" + m_SeenTutorials[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/RareItemName.cs b/src/Mooege/Net/GS/Message/Fields/RareItemName.cs new file mode 100644 index 00000000..8bcc43e9 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/RareItemName.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.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..bca16608 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/ResolvedPortalDestination.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.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..a504716c --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/SavePointData.cs @@ -0,0 +1,56 @@ +/* + * 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.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..d349845f --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/SkillKeyMapping.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.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..061c08e4 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/VisualEquipment.cs @@ -0,0 +1,70 @@ +/* + * 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.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..5e01b16c --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/VisualItem.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.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..4ebb3f65 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/WorldLocationMessageData.cs @@ -0,0 +1,62 @@ +/* + * 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; + +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..0fe45d20 --- /dev/null +++ b/src/Mooege/Net/GS/Message/Fields/WorldPlace.cs @@ -0,0 +1,57 @@ +/* + * 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; + +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..ece719ad --- /dev/null +++ b/src/Mooege/Net/GS/Message/GameAttribute.List.cs @@ -0,0 +1,757 @@ +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(); + } + + // 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 GameAttributeI Axe_Bad_Data = new GameAttributeI(0, 0, -1, 0, 0, "", "", "Axe_Bad_Data", GameAttributeEncoding.Int, 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, 350, 9); + public static readonly GameAttributeI Attack = new GameAttributeI(10, 0, -1, 0, 0, "", "((Attack.Agg + Stats_All_Bonus + Attack_Bonus) * (1 + Attack_Bonus_Percent)) * (1 - Attack_Reduction_Percent)", "Attack", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Precision = new GameAttributeI(11, 0, -1, 0, 0, "", "((Precision.Agg + Stats_All_Bonus + Precision_Bonus) * (1 + Precision_Bonus_Percent)) * (1 - Precision_Reduction_Percent)", "Precision", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Vitality = new GameAttributeI(12, 0, -1, 0, 0, "", "((Vitality.Agg + Stats_All_Bonus + Vitality_Bonus) * (1 + Vitality_Bonus_Percent)) * (1 - Vitality_Reduction_Percent)", "Vitality", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Defense = new GameAttributeI(13, 0, -1, 0, 0, "", "((Defense.Agg + Stats_All_Bonus + Defense_Bonus) * (1 + Defense_Bonus_Percent)) * (1 - Defense_Reduction_Percent)", "Defense", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeF Attack_Bonus = new GameAttributeF(14, 0, -1, 0, 0, "", "", "Attack_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Precision_Bonus = new GameAttributeF(15, 0, -1, 0, 0, "", "", "Precision_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Vitality_Bonus = new GameAttributeF(16, 0, -1, 0, 0, "", "", "Vitality_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Defense_Bonus = new GameAttributeF(17, 0, -1, 0, 0, "", "", "Defense_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attack_Bonus_Percent = new GameAttributeF(18, 0, -1, 0, 0, "", "", "Attack_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Precision_Bonus_Percent = new GameAttributeF(19, 0, -1, 0, 0, "", "", "Precision_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Vitality_Bonus_Percent = new GameAttributeF(20, 0, -1, 0, 0, "", "", "Vitality_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Defense_Bonus_Percent = new GameAttributeF(21, 0, -1, 0, 0, "", "", "Defense_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attack_Reduction_Percent = new GameAttributeF(22, 0, -1, 1, 0, "", "", "Attack_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Precision_Reduction_Percent = new GameAttributeF(23, 0, -1, 1, 0, "", "", "Precision_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Vitality_Reduction_Percent = new GameAttributeF(24, 0, -1, 1, 0, "", "", "Vitality_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Defense_Reduction_Percent = new GameAttributeF(25, 0, -1, 1, 0, "", "", "Defense_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Armor = new GameAttributeF(26, 0, -1, 0, 0, "", "", "Armor", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Armor_Bonus_Percent = new GameAttributeF(27, 0, -1, 0, 0, "", "", "Armor_Bonus_Percent", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Armor_Item = new GameAttributeF(28, 0, -1, 0, 0, "", "0", "Armor_Item", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Armor_Bonus_Item = new GameAttributeF(29, 0, -1, 0, 0, "", "", "Armor_Bonus_Item", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Armor_Item_Percent = new GameAttributeF(30, 0, -1, 0, 0, "", "0", "Armor_Item_Percent", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeF Armor_Item_SubTotal = new GameAttributeF(31, 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(32, 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(33, 0, -1, 0, 0, "", "FLOOR((Armor + Armor_Item_Total) * (Armor_Bonus_Percent + 1))", "Armor_Total", GameAttributeEncoding.Float32, 9, 0, 0, 32); + public static readonly GameAttributeI Experience_Granted = new GameAttributeI(34, 0, -1, 0, 1, "", "", "Experience_Granted", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Experience_Next = new GameAttributeI(35, 0, -1, 0, 1, "", "", "Experience_Next", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Gold_Granted = new GameAttributeI(36, 0, -1, 0, 1, "", "", "Gold_Granted", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Gold = new GameAttributeI(37, 0, -1, 0, 1, "", "", "Gold", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeF Gold_Find = new GameAttributeF(38, 0, -1, 0, 0, "", "", "Gold_Find", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Level = new GameAttributeI(39, 0, -1, 0, 1, "", "", "Level", GameAttributeEncoding.IntMinMax, 31, -1, 127, 8); + public static readonly GameAttributeI Level_Cap = new GameAttributeI(40, 0, -1, 0, 1, "", "", "Level_Cap", GameAttributeEncoding.IntMinMax, 1, -1, 127, 8); + public static readonly GameAttributeF Magic_Find = new GameAttributeF(41, 0, -1, 0, 0, "", "", "Magic_Find", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Treasure_Find = new GameAttributeF(42, 0, 14, 0, 0, "", "", "Treasure_Find", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Resource_Cost_Reduction_Amount = new GameAttributeI(43, 0, 10, 0, 1, "", "", "Resource_Cost_Reduction_Amount", GameAttributeEncoding.IntMinMax, 9, -4095, 16383, 15); + public static readonly GameAttributeF Resource_Cost_Reduction_Total = new GameAttributeF(44, 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(45, 0, 10, 0, 0, "", "", "Resource_Set_Point_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Faster_Healing_Percent = new GameAttributeF(46, 0, -1, 0, 0, "", "", "Faster_Healing_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Spending_Resource_Heals_Percent = new GameAttributeF(47, 0, 10, 0, 0, "", "", "Spending_Resource_Heals_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Bonus_Healing_Received_Percent = new GameAttributeF(48, 0, -1, 0, 0, "", "", "Bonus_Healing_Received_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Reduced_Healing_Received_Percent = new GameAttributeF(49, 0, -1, 0, 0, "", "", "Reduced_Healing_Received_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Experience_Bonus = new GameAttributeF(50, 0, -1, 0, 0, "", "", "Experience_Bonus", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Experience_Bonus_Percent = new GameAttributeF(51, 0, -1, 0, 0, "", "", "Experience_Bonus_Percent", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Health_Globe_Bonus_Chance = new GameAttributeF(52, 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(53, 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(54, 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(55, 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(56, 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(57, 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(58, 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(59, 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(60, 0, -1, 0, 0, "", "", "Mana_Gained_From_Globes", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance = new GameAttributeF(61, 0, 0, 0, 0, "", "", "Resistance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Percent = new GameAttributeF(62, 0, 0, 0, 0, "", "", "Resistance_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Total = new GameAttributeF(63, 0, 0, 0, 0, "", "(Resistance + Resistance_All#NONE) * ((Resistance_Percent_All#NONE + Resistance_Percent + 1))", "Resistance_Total", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Resistance_All = new GameAttributeF(64, 0, -1, 0, 0, "", "", "Resistance_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Percent_All = new GameAttributeF(65, 0, -1, 0, 0, "", "", "Resistance_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Skill = new GameAttributeI(66, 0, 4, 0, 1, "", "", "Skill", GameAttributeEncoding.IntMinMax, 9, 0, 4095, 12); + public static readonly GameAttributeI Skill_Total = new GameAttributeI(67, 0, 4, 0, 1, "", "Skill", "Skill_Total", GameAttributeEncoding.IntMinMax, 9, 0, 4095, 12); + public static readonly GameAttributeI TeamID = new GameAttributeI(68, -1, -1, 1, 1, "", "", "TeamID", GameAttributeEncoding.IntMinMax, 31, -1, 23, 5); + public static readonly GameAttributeI Team_Override = new GameAttributeI(69, -1, -1, 1, 1, "", "", "Team_Override", GameAttributeEncoding.IntMinMax, 31, -1, 23, 5); + public static readonly GameAttributeB Invulnerable = new GameAttributeB(70, 0, -1, 1, 1, "", "", "Invulnerable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Loading = new GameAttributeB(71, 0, -1, 1, 1, "", "", "Loading", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Loading_Player_ACD = new GameAttributeI(72, -1, -1, 3, 1, "", "", "Loading_Player_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Loading_Power_SNO = new GameAttributeI(73, -1, -1, 3, 1, "", "", "Loading_Power_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Loading_Anim_Tag = new GameAttributeI(74, -1, -1, 3, 1, "", "", "Loading_Anim_Tag", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeB Loading_NewGame = new GameAttributeB(75, 0, -1, 1, 1, "", "", "Loading_NewGame", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB No_Damage = new GameAttributeB(76, 0, -1, 1, 1, "", "", "No_Damage", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB No_AutoPickup = new GameAttributeB(77, 0, -1, 1, 1, "", "", "No_AutoPickup", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF Light_Radius_Percent_Bonus = new GameAttributeF(78, 0, 0, 0, 0, "", "", "Light_Radius_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Hitpoints_Cur = new GameAttributeF(79, 0, -1, 0, 0, "", "Min(Hitpoints_Cur.Agg, Hitpoints_Max_Total)", "Hitpoints_Cur", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Factor_Level = new GameAttributeF(80, 0, -1, 0, 0, "", "", "Hitpoints_Factor_Level", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Factor_Vitality = new GameAttributeF(81, 0, -1, 0, 0, "", "", "Hitpoints_Factor_Vitality", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Total_From_Vitality = new GameAttributeF(82, 0, -1, 0, 0, "", "Vitality * Hitpoints_Factor_Vitality", "Hitpoints_Total_From_Vitality", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Total_From_Level = new GameAttributeF(83, 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(84, 0, -1, 0, 0, "", "", "Hitpoints_Granted", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeI Hitpoints_Granted_Duration = new GameAttributeI(85, 0, -1, 0, 1, "", "", "Hitpoints_Granted_Duration", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeF Hitpoints_Max = new GameAttributeF(86, 0, -1, 0, 0, "", "", "Hitpoints_Max", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Max_Bonus = new GameAttributeF(87, 0, -1, 0, 0, "", "", "Hitpoints_Max_Bonus", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Max_Total = new GameAttributeF(88, 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.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Percent = new GameAttributeF(89, 0, -1, 0, 0, "", "", "Hitpoints_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF Hitpoints_Regen_Per_Second = new GameAttributeF(90, 0, -1, 0, 0, "", "", "Hitpoints_Regen_Per_Second", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_Max_Percent_Bonus = new GameAttributeF(91, 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(92, 0, -1, 0, 0, "", "", "Hitpoints_Max_Percent_Bonus_Item", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF Hitpoints_Healed_Target = new GameAttributeF(93, 0, -1, 0, 0, "", "", "Hitpoints_Healed_Target", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeI Resource_Type_Primary = new GameAttributeI(94, -1, -1, 3, 1, "", "", "Resource_Type_Primary", GameAttributeEncoding.IntMinMax, 1, -1, 7, 4); + public static readonly GameAttributeI Resource_Type_Secondary = new GameAttributeI(95, -1, -1, 3, 1, "", "", "Resource_Type_Secondary", GameAttributeEncoding.IntMinMax, 1, -1, 7, 4); + public static readonly GameAttributeF Resource_Cur = new GameAttributeF(96, 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(97, 0, 10, 0, 0, "", "", "Resource_Max", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Resource_Max_Bonus = new GameAttributeF(98, 0, 10, 0, 0, "", "", "Resource_Max_Bonus", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Resource_Max_Total = new GameAttributeF(99, 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(100, 0, 10, 0, 0, "", "", "Resource_Factor_Level", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Resource_Granted = new GameAttributeF(101, 0, 10, 0, 0, "", "", "Resource_Granted", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeI Resource_Granted_Duration = new GameAttributeI(102, 0, 10, 0, 1, "", "", "Resource_Granted_Duration", GameAttributeEncoding.IntMinMax, 9, 0, 16777215, 24); + public static readonly GameAttributeF Resource_Percent = new GameAttributeF(103, 0, 10, 0, 0, "", "", "Resource_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resource_Regen_Per_Second = new GameAttributeF(104, 0, 10, 0, 0, "", "", "Resource_Regen_Per_Second", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Resource_Regen_Bonus_Percent = new GameAttributeF(105, 0, 10, 0, 0, "", "", "Resource_Regen_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resource_Regen_Total = new GameAttributeF(106, 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(107, 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(108, 0, 10, 0, 0, "", "", "Resource_Capacity_Used", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Resource_Effective_Max = new GameAttributeF(109, 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(110, 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(111, 0, 10, 0, 0, "", "", "Resource_Degeneration_Stop_Point", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Movement_Scalar = new GameAttributeF(112, 0, -1, 0, 0, "", "", "Movement_Scalar", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Walking_Rate = new GameAttributeF(113, 0, -1, 0, 0, "", "", "Walking_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Running_Rate = new GameAttributeF(114, 0, -1, 0, 0, "", "", "Running_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Sprinting_Rate = new GameAttributeF(115, 0, -1, 0, 0, "", "", "Sprinting_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Strafing_Rate = new GameAttributeF(116, 0, -1, 0, 0, "", "", "Strafing_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Walking_Rate_Total = new GameAttributeF(117, 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(118, 0, -1, 0, 0, "", "Running_Rate * Movement_Scalar_Total", "Running_Rate_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Sprinting_Rate_Total = new GameAttributeF(119, 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(120, 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(121, 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(122, 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(123, 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(124, 0, -1, 0, 0, "", "", "Movement_Scalar_Uncapped_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Movement_Scalar_Total = new GameAttributeF(125, 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(126, 0, -1, 1, 0, "", "", "Movement_Bonus_Run_Speed", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Casting_Speed = new GameAttributeF(127, 0, -1, 0, 0, "", "", "Casting_Speed", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Casting_Speed_Bonus = new GameAttributeF(128, 0, -1, 0, 0, "", "", "Casting_Speed_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Casting_Speed_Total = new GameAttributeF(129, 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(130, 0, -1, 1, 1, "", "", "Always_Hits", GameAttributeEncoding.IntMinMax, 3, 0, 1, 1); + public static readonly GameAttributeF Hit_Chance = new GameAttributeF(131, 0, -1, 0, 0, "", "", "Hit_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attacks_Per_Second_Item = new GameAttributeF(132, 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(133, 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(134, 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(135, 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(136, 0, -1, 0, 0, "(Attacks_Per_Second_Item_Subtotal + Attacks_Per_Second_Item_Bonus)", "", "Attacks_Per_Second_Item_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attacks_Per_Second = new GameAttributeF(137, 0, -1, 0, 0, "0", "", "Attacks_Per_Second", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attacks_Per_Second_Bonus = new GameAttributeF(138, 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(139, 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.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Attacks_Per_Second_Percent = new GameAttributeF(140, 0, -1, 0, 0, "", "", "Attacks_Per_Second_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF AI_Cooldown_Reduction_Percent = new GameAttributeF(141, 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(142, 0, -1, 0, 0, "0", "", "Power_Cooldown_Reduction_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Damage_Delta = new GameAttributeF(143, 0, 0, 0, 0, "", "", "Damage_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Delta_Total = new GameAttributeF(144, 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(145, 0, 0, 0, 0, "", "", "Damage_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Bonus_Min = new GameAttributeF(146, 0, 0, 0, 0, "", "", "Damage_Bonus_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Min_Total = new GameAttributeF(147, 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(148, 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(149, 0, -1, 0, 0, "", "", "Damage_Percent_All_From_Skills", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Weapon_Delta = new GameAttributeF(150, 0, 0, 0, 0, "", "", "Damage_Weapon_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Delta_SubTotal = new GameAttributeF(151, 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(152, 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(153, 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_Delta_Total = new GameAttributeF(154, 0, 0, 0, 0, "Max((Damage_Weapon_Delta_SubTotal + Damage_Weapon_Bonus_Delta) * (1 + Damage_Weapon_Percent_Total), 0)", "", "Damage_Weapon_Delta_Total", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Delta_Total_All = new GameAttributeF(155, 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.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Bonus_Delta = new GameAttributeF(156, 0, 0, 0, 0, "", "", "Damage_Weapon_Bonus_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Min = new GameAttributeF(157, 0, 0, 0, 0, "", "", "Damage_Weapon_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Min_Total = new GameAttributeF(158, 0, 0, 0, 0, "(Damage_Weapon_Min + Damage_Weapon_Bonus_Min) * (1 + Damage_Weapon_Percent_Total)", "", "Damage_Weapon_Min_Total", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Min_Total_All = new GameAttributeF(159, 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.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Bonus_Min = new GameAttributeF(160, 0, 0, 0, 0, "", "", "Damage_Weapon_Bonus_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Weapon_Percent_Bonus = new GameAttributeF(161, 0, 0, 0, 0, "", "", "Damage_Weapon_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Weapon_Percent_All = new GameAttributeF(162, 0, -1, 0, 0, "", "", "Damage_Weapon_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Weapon_Percent_Total = new GameAttributeF(163, 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(164, 0, 0, 0, 0, "", "", "Damage_Type_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Percent_Bonus_Witchdoctor = new GameAttributeF(165, 0, -1, 0, 0, "", "", "Damage_Percent_Bonus_Witchdoctor", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Percent_Bonus_Wizard = new GameAttributeF(166, 0, -1, 0, 0, "", "", "Damage_Percent_Bonus_Wizard", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Crit_Percent_Base = new GameAttributeI(167, 0, -1, 0, 0, "", "", "Crit_Percent_Base", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Crit_Percent_Bonus_Capped = new GameAttributeI(168, 0, -1, 0, 0, "", "", "Crit_Percent_Bonus_Capped", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Crit_Percent_Bonus_Uncapped = new GameAttributeI(169, 0, -1, 0, 0, "", "", "Crit_Percent_Bonus_Uncapped", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Crit_Percent_Cap = new GameAttributeI(170, 0, -1, 0, 0, "", "", "Crit_Percent_Cap", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Crit_Damage_Percent = new GameAttributeI(171, 0, -1, 0, 0, "", "", "Crit_Damage_Percent", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Crit_Effect_Time = new GameAttributeI(172, 0, -1, 3, 1, "", "", "Crit_Effect_Time", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeF Pierce_Chance = new GameAttributeF(173, 0, -1, 0, 0, "", "", "Pierce_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Absorb_Percent = new GameAttributeF(174, 0, -1, 0, 0, "", "", "Damage_Absorb_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Reduction_Total = new GameAttributeF(175, 0, 0, 0, 0, "", "", "Damage_Reduction_Total", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Reduction_Current = new GameAttributeF(176, 0, 0, 0, 0, "", "", "Damage_Reduction_Current", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeI Damage_Reduction_Last_Tick = new GameAttributeI(177, 0, 0, 3, 1, "", "", "Damage_Reduction_Last_Tick", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeF Block_Chance = new GameAttributeF(178, 0, -1, 0, 0, "", "", "Block_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Block_Chance_Total = new GameAttributeF(179, 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(180, 0, -1, 0, 0, "", "", "Block_Chance_Bonus_Item", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Block_Chance_Item = new GameAttributeF(181, 0, -1, 0, 0, "", "0", "Block_Chance_Item", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Block_Chance_Item_Total = new GameAttributeF(182, 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(183, 0, -1, 0, 0, "", "", "Block_Amount", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Block_Amount_Bonus_Percent = new GameAttributeF(184, 0, -1, 0, 0, "", "", "Block_Amount_Bonus_Percent", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Block_Amount_Total_Min = new GameAttributeF(185, 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(186, 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(187, 0, -1, 0, 0, "", "", "Block_Amount_Item_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Block_Amount_Item_Delta = new GameAttributeF(188, 0, -1, 0, 0, "", "", "Block_Amount_Item_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Block_Amount_Item_Bonus = new GameAttributeF(189, 0, -1, 0, 0, "", "", "Block_Amount_Item_Bonus", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Dodge_Rating_Base = new GameAttributeF(190, 0, -1, 0, 0, "", "", "Dodge_Rating_Base", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Dodge_Rating = new GameAttributeF(191, 0, -1, 0, 0, "", "", "Dodge_Rating", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Dodge_Rating_Total = new GameAttributeF(192, 0, -1, 0, 0, "", "Dodge_Rating_Base + Dodge_Rating", "Dodge_Rating_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Dodge_Chance_Bonus = new GameAttributeF(193, 0, -1, 7, 0, "", "", "Dodge_Chance_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Dodge_Chance_Bonus_Melee = new GameAttributeF(194, 0, -1, 7, 0, "", "", "Dodge_Chance_Bonus_Melee", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Dodge_Chance_Bonus_Ranged = new GameAttributeF(195, 0, -1, 7, 0, "", "", "Dodge_Chance_Bonus_Ranged", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Get_Hit_Current = new GameAttributeF(196, 0, -1, 0, 0, "", "", "Get_Hit_Current", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Get_Hit_Max_Base = new GameAttributeF(197, 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(198, 0, -1, 0, 0, "", "", "Get_Hit_Max_Per_Level", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Get_Hit_Max = new GameAttributeF(199, 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(200, 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(201, 0, -1, 0, 0, "", "", "Get_Hit_Recovery_Per_Level", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Get_Hit_Recovery = new GameAttributeF(202, 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(203, 0, -1, 0, 0, "", "", "Get_Hit_Damage", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Get_Hit_Damage_Scalar = new GameAttributeF(204, 0, -1, 0, 0, "", "", "Get_Hit_Damage_Scalar", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeI Last_Damage_MainActor = new GameAttributeI(205, -1, -1, 3, 1, "", "", "Last_Damage_MainActor", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Last_ACD_Attacked = new GameAttributeI(206, -1, -1, 3, 1, "", "", "Last_ACD_Attacked", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeB Ignores_Critical_Hits = new GameAttributeB(207, 0, -1, 1, 1, "", "", "Ignores_Critical_Hits", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Immunity = new GameAttributeB(208, 0, -1, 1, 1, "", "", "Immunity", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Untargetable = new GameAttributeB(209, 0, -1, 1, 1, "", "", "Untargetable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Immobolize = new GameAttributeB(210, 0, -1, 1, 1, "", "", "Immobolize", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); + public static readonly GameAttributeB Immune_To_Knockback = new GameAttributeB(211, 0, -1, 1, 1, "", "", "Immune_To_Knockback", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Power_Immobilize = new GameAttributeB(212, 0, -1, 1, 1, "", "", "Power_Immobilize", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF Stun_Chance = new GameAttributeF(213, 0, -1, 0, 0, "", "", "Stun_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Stun_Length = new GameAttributeF(214, 0, -1, 0, 0, "", "", "Stun_Length", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Stun_Recovery = new GameAttributeF(215, 0, -1, 0, 0, "", "", "Stun_Recovery", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Stun_Recovery_Speed = new GameAttributeF(216, 0, -1, 0, 0, "", "", "Stun_Recovery_Speed", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeB Stunned = new GameAttributeB(217, 0, -1, 1, 1, "", "", "Stunned", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Stun_Immune = new GameAttributeB(218, 0, -1, 1, 1, "", "", "Stun_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF Poison_Length_Reduction = new GameAttributeF(219, 0, -1, 0, 0, "", "", "Poison_Length_Reduction", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeB Poisoned = new GameAttributeB(220, 0, -1, 1, 1, "", "", "Poisoned", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Bleeding = new GameAttributeB(221, 0, -1, 1, 1, "", "", "Bleeding", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeF Bleed_Duration = new GameAttributeF(222, 0, -1, 0, 0, "", "", "Bleed_Duration", GameAttributeEncoding.Float16, 1, 0, 0, 16); + public static readonly GameAttributeB Chilled = new GameAttributeB(223, 0, -1, 1, 1, "", "", "Chilled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeF Freeze_Length_Reduction = new GameAttributeF(224, 0, -1, 0, 0, "", "", "Freeze_Length_Reduction", GameAttributeEncoding.Float16, 1, 0, 0, 16); + public static readonly GameAttributeB Freeze_Immune = new GameAttributeB(225, 0, -1, 1, 1, "", "", "Freeze_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Webbed = new GameAttributeB(226, 0, -1, 1, 1, "", "", "Webbed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Slow = new GameAttributeB(227, 0, -1, 1, 1, "", "", "Slow", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB FireAura = new GameAttributeB(228, 0, -1, 1, 1, "", "", "FireAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB LightningAura = new GameAttributeB(229, 0, -1, 1, 1, "", "", "LightningAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB ColdAura = new GameAttributeB(230, 0, -1, 1, 1, "", "", "ColdAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB PoisonAura = new GameAttributeB(231, 0, -1, 1, 1, "", "", "PoisonAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Blind = new GameAttributeB(232, 0, -1, 1, 1, "", "", "Blind", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Enraged = new GameAttributeB(233, 0, -1, 1, 1, "", "", "Enraged", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Slowdown_Immune = new GameAttributeB(234, 0, -1, 1, 1, "", "", "Slowdown_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Gethit_Immune = new GameAttributeB(235, 0, -1, 1, 1, "", "", "Gethit_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF Suffocation_Per_Second = new GameAttributeF(236, 0, -1, 0, 0, "", "", "Suffocation_Per_Second", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Suffocation_Unit_Value = new GameAttributeF(237, 0, -1, 1, 0, "", "", "Suffocation_Unit_Value", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); + public static readonly GameAttributeF Thorns_Percent = new GameAttributeF(238, 0, 0, 0, 0, "", "", "Thorns_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Thorns_Percent_All = new GameAttributeF(239, 0, -1, 0, 0, "", "", "Thorns_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Thorns_Percent_Total = new GameAttributeF(240, 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(241, 0, 0, 0, 0, "", "", "Thorns_Fixed", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Steal_Health_Percent = new GameAttributeF(242, 0, -1, 0, 0, "", "", "Steal_Health_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Steal_Mana_Percent = new GameAttributeF(243, 0, -1, 0, 0, "", "", "Steal_Mana_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resource_On_Hit = new GameAttributeF(244, 0, 10, 0, 0, "", "", "Resource_On_Hit", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Resource_On_Kill = new GameAttributeF(245, 0, 10, 0, 0, "", "", "Resource_On_Kill", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Resource_On_Crit = new GameAttributeF(246, 0, 10, 0, 0, "", "", "Resource_On_Crit", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_On_Hit = new GameAttributeF(247, 0, -1, 0, 0, "", "", "Hitpoints_On_Hit", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Hitpoints_On_Kill = new GameAttributeF(248, 0, -1, 0, 0, "", "", "Hitpoints_On_Kill", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_To_Mana = new GameAttributeF(249, 0, -1, 0, 0, "", "", "Damage_To_Mana", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeI Last_Proc_Time = new GameAttributeI(250, 0, -1, 3, 1, "", "", "Last_Proc_Time", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeF Damage_Power_Delta = new GameAttributeF(251, 0, 0, 0, 0, "", "", "Damage_Power_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeF Damage_Power_Min = new GameAttributeF(252, 0, 0, 0, 0, "", "", "Damage_Power_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); + public static readonly GameAttributeI Rope_Overlay = new GameAttributeI(253, -1, -1, 3, 1, "", "", "Rope_Overlay", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI General_Cooldown = new GameAttributeI(254, -1, -1, 3, 1, "", "", "General_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Power_Cooldown = new GameAttributeI(255, -1, 4, 1, 1, "", "", "Power_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Power_Cooldown_Start = new GameAttributeI(256, -1, 4, 1, 1, "", "", "Power_Cooldown_Start", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Proc_Cooldown = new GameAttributeI(257, 0, 8, 1, 1, "", "", "Proc_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Emote_Cooldown = new GameAttributeI(258, 0, -1, 1, 1, "", "", "Emote_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeF Projectile_Speed = new GameAttributeF(259, 0, -1, 0, 0, "", "", "Projectile_Speed", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF Projectile_Speed_Increase_Percent = new GameAttributeF(260, 0, -1, 0, 0, "", "", "Projectile_Speed_Increase_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeB Destroy_When_Path_Blocked = new GameAttributeB(261, 0, -1, 1, 1, "", "", "Destroy When Path Blocked", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Skill_Toggled_State = new GameAttributeB(262, 0, 4, 1, 1, "", "", "Skill_Toggled_State", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); + public static readonly GameAttributeI Act = new GameAttributeI(263, -1, -1, 3, 1, "", "", "Act", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Difficulty = new GameAttributeI(264, -1, -1, 3, 1, "", "", "Difficulty", GameAttributeEncoding.IntMinMax, 9, -1, 4, 3); + public static readonly GameAttributeF Last_Damage_Amount = new GameAttributeF(265, -1, -1, 3, 0, "", "", "Last_Damage_Amount", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); + public static readonly GameAttributeB In_Knockback = new GameAttributeB(266, 0, -1, 1, 1, "", "", "In_Knockback", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF Amplify_Damage_Type_Percent = new GameAttributeF(267, 0, 0, 0, 0, "", "", "Amplify_Damage_Type_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Amplify_Damage_Percent = new GameAttributeF(268, 0, -1, 0, 0, "", "", "Amplify_Damage_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Durability_Cur = new GameAttributeI(269, 0, -1, 0, 1, "", "", "Durability_Cur", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI Durability_Max = new GameAttributeI(270, 0, -1, 0, 1, "", "", "Durability_Max", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI Durability_Last_Damage = new GameAttributeI(271, 0, -1, 0, 1, "", "", "Durability_Last_Damage", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Item_Quality_Level = new GameAttributeI(272, -1, -1, 1, 1, "", "", "Item_Quality_Level", GameAttributeEncoding.IntMinMax, 8, -1, 11, 4); + public static readonly GameAttributeF Item_Cost_Percent_Bonus = new GameAttributeF(273, 0, -1, 0, 0, "", "", "Item_Cost_Percent_Bonus", GameAttributeEncoding.Float16, 8, 0, 0, 16); + public static readonly GameAttributeB Item_Equipped = new GameAttributeB(274, 0, -1, 1, 1, "", "", "Item_Equipped", GameAttributeEncoding.IntMinMax, 8, 0, 1, 1); + public static readonly GameAttributeF Requirement = new GameAttributeF(275, 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(276, 0, -1, 0, 0, "", "0", "Requirements_Ease_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Requirement_When_Equipped = new GameAttributeF(277, 0, 1, 1, 0, "", "", "Requirement_When_Equipped", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Sockets = new GameAttributeI(278, 0, -1, 0, 1, "", "0", "Sockets", GameAttributeEncoding.IntMinMax, 8, 0, 3, 2); + public static readonly GameAttributeI Sockets_Filled = new GameAttributeI(279, 0, -1, 0, 1, "", "0", "Sockets_Filled", GameAttributeEncoding.IntMinMax, 8, 0, 3, 2); + public static readonly GameAttributeF Stats_All_Bonus = new GameAttributeF(280, 0, -1, 0, 0, "", "", "Stats_All_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Item_Bound_To_ACD = new GameAttributeI(281, -1, -1, 3, 1, "", "0", "Item_Bound_To_ACD", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI Item_Binding_Level_Override = new GameAttributeI(282, 0, -1, 1, 1, "", "0", "Item_Binding_Level_Override", GameAttributeEncoding.IntMinMax, 8, 0, 5, 3); + public static readonly GameAttributeI ItemStackQuantityHi = new GameAttributeI(283, 0, -1, 4, 1, "", "", "ItemStackQuantityHi", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI ItemStackQuantityLo = new GameAttributeI(284, 0, -1, 4, 1, "", "", "ItemStackQuantityLo", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeF Run_Speed_Granted = new GameAttributeF(285, 0, -1, 0, 0, "", "", "Run_Speed_Granted", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Run_Speed_Duration = new GameAttributeI(286, 0, -1, 0, 1, "", "", "Run_Speed_Duration", GameAttributeEncoding.IntMinMax, 9, 0, 16777215, 24); + public static readonly GameAttributeI IdentifyCost = new GameAttributeI(287, 0, -1, 0, 1, "", "", "IdentifyCost", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI Seed = new GameAttributeI(288, 0, -1, 4, 1, "", "0", "Seed", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeB IsCrafted = new GameAttributeB(289, 0, -1, 4, 1, "", "0", "IsCrafted", GameAttributeEncoding.IntMinMax, 8, 0, 1, 1); + public static readonly GameAttributeI DyeType = new GameAttributeI(290, 0, -1, 1, 1, "", "0", "DyeType", GameAttributeEncoding.IntMinMax, 8, -1, 30, 5); + public static readonly GameAttributeI SocketAffix = new GameAttributeI(291, -1, -1, 3, 1, "", "0", "SocketAffix", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI EnchantAffix = new GameAttributeI(292, -1, -1, 3, 1, "", "0", "EnchantAffix", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI HighlySalvageable = new GameAttributeI(293, 0, -1, 1, 1, "", "0", "HighlySalvageable", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI ItemUnlockTimeHi = new GameAttributeI(294, 0, -1, 4, 1, "", "", "ItemUnlockTimeHi", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI ItemUnlockTimeLo = new GameAttributeI(295, 0, -1, 4, 1, "", "", "ItemUnlockTimeLo", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeB Always_Plays_GetHit = new GameAttributeB(296, 0, -1, 1, 1, "", "", "Always_Plays_GetHit", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Hidden = new GameAttributeB(297, 0, -1, 1, 1, "", "", "Hidden", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI RActor_Fade_Group = new GameAttributeI(298, -1, -1, 1, 1, "", "", "RActor_Fade_Group", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Quest_Range = new GameAttributeI(299, -1, -1, 3, 1, "", "", "Quest Range", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Attack_Cooldown_Min = new GameAttributeI(300, 0, -1, 0, 1, "", "", "Attack_Cooldown_Min", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI Attack_Cooldown_Delta = new GameAttributeI(301, 0, -1, 0, 1, "", "", "Attack_Cooldown_Delta", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI InitialCooldownMinTotal = new GameAttributeI(302, 0, -1, 0, 1, "", "InitialCooldownMin / Attacks_Per_Second_Total", "InitialCooldownMinTotal", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI InitialCooldownDeltaTotal = new GameAttributeI(303, 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(304, 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(305, 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(306, 0, -1, 0, 1, "", "", "Closing_Cooldown_Min_Total", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI Closing_Cooldown_Delta_Total = new GameAttributeI(307, 0, -1, 0, 1, "", "", "Closing_Cooldown_Delta_Total", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeB Quest_Monster = new GameAttributeB(308, 0, -1, 0, 1, "", "", "Quest_Monster", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Quest_Monster_Effect = new GameAttributeI(309, -1, -1, 3, 1, "", "", "Quest_Monster Effect", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Treasure_Class = new GameAttributeI(310, -1, -1, 3, 1, "", "", "Treasure_Class", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Removes_Body_On_Death = new GameAttributeB(311, 0, -1, 1, 1, "", "", "Removes_Body_On_Death", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI InitialCooldownMin = new GameAttributeI(312, 0, -1, 0, 1, "", "", "InitialCooldownMin", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI InitialCooldownDelta = new GameAttributeI(313, 0, -1, 0, 1, "", "", "InitialCooldownDelta", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeF Knockback_Weight = new GameAttributeF(314, 0, -1, 0, 0, "", "", "Knockback_Weight", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeB UntargetableByPets = new GameAttributeB(315, 0, -1, 1, 1, "", "", "UntargetableByPets", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Damage_State_Current = new GameAttributeI(316, 0, -1, 0, 1, "", "", "Damage_State_Current", GameAttributeEncoding.IntMinMax, 31, 0, 15, 4); + public static readonly GameAttributeI Damage_State_Max = new GameAttributeI(317, 0, -1, 0, 1, "", "", "Damage_State_Max", GameAttributeEncoding.IntMinMax, 31, 0, 15, 4); + public static readonly GameAttributeB Is_Player_Decoy = new GameAttributeB(318, 0, -1, 1, 1, "", "", "Is_Player_Decoy", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeF Custom_Target_Weight = new GameAttributeF(319, 0, 3, 0, 0, "", "", "Custom_Target_Weight", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Gizmo_State = new GameAttributeI(320, -1, -1, 3, 1, "", "", "Gizmo_State", GameAttributeEncoding.IntMinMax, 4, -1, 30, 5); + public static readonly GameAttributeI Gizmo_Charges = new GameAttributeI(321, 0, -1, 1, 1, "", "", "Gizmo_Charges", GameAttributeEncoding.IntMinMax, 4, -1, 30, 5); + public static readonly GameAttributeB Chest_Open = new GameAttributeB(322, 0, 3, 0, 1, "", "", "Chest_Open", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); + public static readonly GameAttributeB Door_Locked = new GameAttributeB(323, 0, -1, 1, 1, "", "", "Door_Locked", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); + public static readonly GameAttributeI Door_Timer = new GameAttributeI(324, -1, -1, 3, 1, "", "", "Door_Timer", GameAttributeEncoding.Int, 4, 0, 0, 32); + public static readonly GameAttributeB Gizmo_Disabled_By_Script = new GameAttributeB(325, 0, -1, 1, 1, "", "", "Gizmo_Disabled_By_Script", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); + public static readonly GameAttributeI Gizmo_Operator_ACDID = new GameAttributeI(326, -1, -1, 3, 1, "", "", "Gizmo_Operator_ACDID", GameAttributeEncoding.Int, 4, 0, 0, 32); + public static readonly GameAttributeI Triggering_Count = new GameAttributeI(327, 0, -1, 0, 1, "", "", "Triggering_Count", GameAttributeEncoding.Int, 4, 0, 0, 32); + public static readonly GameAttributeI Last_Altar_ANN = new GameAttributeI(328, -1, -1, 3, 1, "", "", "Last_Altar_ANN", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeB New_Skill_Since_Last_Altar = new GameAttributeB(329, 0, 3, 0, 1, "", "", "New_Skill_Since_Last_Altar", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); + public static readonly GameAttributeF Gate_Position = new GameAttributeF(330, 0, -1, 0, 0, "", "", "Gate_Position", GameAttributeEncoding.Float16, 4, 0, 0, 16); + public static readonly GameAttributeF Gate_Velocity = new GameAttributeF(331, 0, -1, 0, 0, "", "", "Gate_Velocity", GameAttributeEncoding.Float16, 4, 0, 0, 16); + public static readonly GameAttributeB Gizmo_Has_Been_Operated = new GameAttributeB(332, 0, -1, 1, 1, "", "", "Gizmo_Has_Been_Operated", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); + public static readonly GameAttributeI Pet_Owner = new GameAttributeI(333, -1, -1, 3, 1, "", "", "Pet_Owner", GameAttributeEncoding.IntMinMax, 31, -1, 8, 4); + public static readonly GameAttributeI Pet_Creator = new GameAttributeI(334, -1, -1, 3, 1, "", "", "Pet_Creator", GameAttributeEncoding.IntMinMax, 31, -1, 8, 4); + public static readonly GameAttributeI Pet_Type = new GameAttributeI(335, -1, -1, 3, 1, "", "", "Pet_Type", GameAttributeEncoding.IntMinMax, 31, -1, 24, 5); + public static readonly GameAttributeB DropsNoLoot = new GameAttributeB(336, 0, -1, 1, 1, "", "", "DropsNoLoot", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB GrantsNoXP = new GameAttributeB(337, 0, -1, 1, 1, "", "", "GrantsNoXP", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Hireling_Class = new GameAttributeI(338, 0, -1, 1, 1, "", "", "Hireling_Class", GameAttributeEncoding.IntMinMax, 31, 0, 4, 3); + public static readonly GameAttributeI Summoned_By_SNO = new GameAttributeI(339, -1, -1, 3, 1, "", "", "Summoned_By_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Is_NPC = new GameAttributeB(340, 0, -1, 1, 1, "", "", "Is_NPC", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB NPC_Is_Operatable = new GameAttributeB(341, 0, -1, 1, 1, "", "", "NPC_Is_Operatable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB NPC_Is_Escorting = new GameAttributeB(342, 0, -1, 1, 1, "", "", "NPC_Is_Escorting", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB NPC_Has_Interact_Options = new GameAttributeB(343, 0, 12, 1, 1, "", "", "NPC_Has_Interact_Options", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Conversation_Icon = new GameAttributeI(344, -1, 12, 3, 1, "", "", "Conversation_Icon", GameAttributeEncoding.IntMinMax, 31, -1, 6, 3); + public static readonly GameAttributeI Callout_Cooldown = new GameAttributeI(345, -1, 16, 1, 1, "", "", "Callout_Cooldown", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Banter_Cooldown = new GameAttributeI(346, -1, 16, 1, 1, "", "", "Banter_Cooldown", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Conversation_Heard_Count = new GameAttributeI(347, 0, 16, 1, 1, "", "", "Conversation_Heard_Count", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Last_Tick_Shop_Entered = new GameAttributeI(348, -1, -1, 3, 1, "", "", "Last_Tick_Shop_Entered", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Is_Helper = new GameAttributeB(349, 0, -1, 1, 1, "", "", "Is_Helper", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Axe = new GameAttributeI(350, 0, -1, 0, 0, "", "", "Axe", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Axe2H = new GameAttributeI(351, 0, -1, 0, 0, "", "", "Axe2H", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI ThrowingAxe = new GameAttributeI(352, 0, -1, 0, 0, "", "", "ThrowingAxe", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI AxeAny = new GameAttributeI(353, 0, -1, 0, 0, "Pin(Axe + Axe2H + ThrowingAxe, 0, 1)", "Pin(Axe + Axe2H + ThrowingAxe, 0, 1)", "AxeAny", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Bow = new GameAttributeI(354, 0, -1, 0, 0, "", "", "Bow", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Crossbow = new GameAttributeI(355, 0, -1, 0, 0, "", "", "Crossbow", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI BowAny = new GameAttributeI(356, 0, -1, 0, 0, "Pin(Bow + Crossbow, 0, 1)", "Pin(Bow + Crossbow, 0, 1)", "BowAny", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Club = new GameAttributeI(357, 0, -1, 0, 0, "", "", "Club", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Club2H = new GameAttributeI(358, 0, -1, 0, 0, "", "", "Club2H", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI ClubAny = new GameAttributeI(359, 0, -1, 0, 0, "Pin(Club + Club2H, 0, 1)", "Pin(Club + Club2H, 0, 1)", "ClubAny", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Dagger = new GameAttributeI(360, 0, -1, 0, 0, "", "", "Dagger", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Mace = new GameAttributeI(361, 0, -1, 0, 0, "", "", "Mace", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Mace2H = new GameAttributeI(362, 0, -1, 0, 0, "", "", "Mace2H", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI MaceAny = new GameAttributeI(363, 0, -1, 0, 0, "Pin(Mace + Mace2H, 0, 1)", "Pin(Mace + Mace2H, 0, 1)", "MaceAny", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Sword = new GameAttributeI(364, 0, -1, 0, 0, "", "", "Sword", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Sword2H = new GameAttributeI(365, 0, -1, 0, 0, "", "", "Sword2H", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI SwordAny = new GameAttributeI(366, 0, -1, 0, 0, "Pin(Sword + Sword2H, 0, 1)", "Pin(Sword + Sword2H, 0, 1)", "SwordAny", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Polearm = new GameAttributeI(367, 0, -1, 0, 0, "", "", "Polearm", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Spear = new GameAttributeI(368, 0, -1, 0, 0, "", "", "Spear", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Wand = new GameAttributeI(369, 0, -1, 0, 0, "", "", "Wand", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI ColdStaff = new GameAttributeI(370, 0, -1, 0, 0, "", "", "ColdStaff", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI FireStaff = new GameAttributeI(371, 0, -1, 0, 0, "", "", "FireStaff", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI LightningStaff = new GameAttributeI(372, 0, -1, 0, 0, "", "", "LightningStaff", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI PoisonStaff = new GameAttributeI(373, 0, -1, 0, 0, "", "", "PoisonStaff", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI StaffAny = new GameAttributeI(374, 0, -1, 0, 0, "Pin(ColdStaff + FireStaff + LightningStaff + PoisonStaff, 0, 1)", "Pin(ColdStaff + FireStaff + LightningStaff + PoisonStaff, 0, 1)", "StaffAny", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Weapon1H = new GameAttributeI(375, 0, -1, 0, 0, "Pin(Axe + Club + Dagger + Mace + Sword + Wand, 0, 1)", "Pin(Axe + Club + Dagger + Mace + Sword + Wand, 0, 1)", "Weapon1H", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Weapon2H = new GameAttributeI(376, 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.Int, 9, 0, 0, 32); + public static readonly GameAttributeI WeaponMelee = new GameAttributeI(377, 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.Int, 9, 0, 0, 32); + public static readonly GameAttributeI WeaponRanged = new GameAttributeI(378, 0, -1, 0, 0, "Pin(ThrowingAxe + BowAny, 0, 1)", "Pin(ThrowingAxe + BowAny, 0, 1)", "WeaponRanged", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Quiver = new GameAttributeI(379, 0, -1, 0, 0, "", "", "Quiver", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeI Reincarnation_Buff = new GameAttributeI(380, -1, -1, 3, 1, "", "", "Reincarnation_Buff", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Dead_Body_AnimTag = new GameAttributeI(381, -1, -1, 3, 1, "", "", "Dead_Body_AnimTag", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Spawned_by_ACDID = new GameAttributeI(382, -1, -1, 3, 1, "", "", "Spawned_by_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Summoned_By_ACDID = new GameAttributeI(383, -1, -1, 3, 1, "", "", "Summoned_By_ACDID", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Summoner_ID = new GameAttributeI(384, -1, -1, 3, 1, "", "", "Summoner_ID", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Banner_ACDID = new GameAttributeI(385, -1, -1, 3, 1, "", "", "Banner_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF Breakable_Shield_HP = new GameAttributeF(386, 0, -1, 0, 0, "", "", "Breakable_Shield_HP", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); + public static readonly GameAttributeI Current_WeaponClass = new GameAttributeI(387, -1, -1, 3, 1, "", "", "Current_WeaponClass", GameAttributeEncoding.IntMinMax, 31, -1, 19, 5); + public static readonly GameAttributeB Weapons_Sheathed = new GameAttributeB(388, 0, -1, 1, 1, "", "", "Weapons_Sheathed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Held_In_OffHand = new GameAttributeB(389, 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(390, 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(391, 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(392, 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(393, 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(394, 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(395, 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(396, 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(397, 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(398, 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(399, 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(400, 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(401, -1, -1, 1, 1, "", "", "Has_Special_Death_AnimTag", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Death_Type_Override = new GameAttributeI(402, -1, -1, 3, 1, "", "", "Death_Type_Override", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB In_Combat = new GameAttributeB(403, 0, -1, 1, 1, "", "", "In_Combat", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); + public static readonly GameAttributeB In_Conversation = new GameAttributeB(404, 0, -1, 3, 1, "", "", "In_Conversation", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Last_Tick_Potion_Used = new GameAttributeI(405, -1, -1, 3, 1, "", "", "Last_Tick_Potion_Used", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF Potion_Dilution_Percent = new GameAttributeF(406, 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(407, 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(408, 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(409, -1, -1, 3, 1, "", "", "Potion_Dilution_Duration", GameAttributeEncoding.IntMinMax, 0, -1, 16777214, 24); + public static readonly GameAttributeF Potion_Dilution_Scalar = new GameAttributeF(410, 0, -1, 0, 0, "", "", "Potion_Dilution_Scalar", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeB Feared = new GameAttributeB(411, 0, -1, 1, 1, "", "", "Feared", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Fear_Immune = new GameAttributeB(412, 0, -1, 1, 1, "", "", "Fear_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Last_Damage_ACD = new GameAttributeI(413, -1, -1, 3, 1, "", "", "Last_Damage_ACD", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Attached_To_ACD = new GameAttributeI(414, -1, -1, 3, 1, "", "", "Attached_To_ACD", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Attachment_ACD = new GameAttributeI(415, -1, -1, 3, 1, "", "", "Attachment_ACD", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Normal_Attack_Replacement_Power_SNO = new GameAttributeI(416, -1, -1, 3, 1, "", "", "Normal_Attack_Replacement_Power_SNO", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeF Damage_Type_Override = new GameAttributeF(417, 0, 0, 0, 0, "", "", "Damage_Type_Override", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); + public static readonly GameAttributeF Minion_Count_Bonus_Percent = new GameAttributeF(418, 0, -1, 0, 0, "", "", "Minion_Count_Bonus_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Champion_Teleport_Next_Tick = new GameAttributeI(419, 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(420, 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(421, 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(422, 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(423, 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(424, 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(425, 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(426, 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(427, 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(428, 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(429, 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(430, 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(431, 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(432, 0, -1, 0, 0, "", "", "Champion_Ghostly_Saved_Dodge_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeB Champion_Ghostly = new GameAttributeB(433, 0, -1, 1, 1, "", "", "Champion_Ghostly", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Base_Element = new GameAttributeI(434, -1, -1, 1, 1, "", "", "Base_Element", GameAttributeEncoding.IntMinMax, 0, -1, 7, 4); + public static readonly GameAttributeF Projectile_Amount_Bonus_Percent = new GameAttributeF(435, 0, -1, 0, 0, "", "", "Projectile_Amount_Bonus_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Projectile_Reflect_Chance = new GameAttributeF(436, 0, 0, 0, 0, "", "", "Projectile_Reflect_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Attack_Fear_Chance = new GameAttributeF(437, 0, -1, 0, 0, "", "", "Attack_Fear_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Attack_Fear_Time_Min = new GameAttributeF(438, 0, -1, 0, 0, "", "", "Attack_Fear_Time_Min", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Attack_Fear_Time_Delta = new GameAttributeF(439, 0, -1, 0, 0, "", "", "Attack_Fear_Time_Delta", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeB Buff_Visual_Effect = new GameAttributeB(440, 0, 9, 1, 1, "", "", "Buff_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Buff_Icon_Start_Tick0 = new GameAttributeI(441, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick0", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_Start_Tick1 = new GameAttributeI(442, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick1", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_Start_Tick2 = new GameAttributeI(443, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick2", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_Start_Tick3 = new GameAttributeI(444, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick3", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick0 = new GameAttributeI(445, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick0", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick1 = new GameAttributeI(446, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick1", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick2 = new GameAttributeI(447, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick2", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick3 = new GameAttributeI(448, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick3", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeB Could_Have_Ragdolled = new GameAttributeB(449, 0, -1, 1, 1, "", "", "Could_Have_Ragdolled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Ambient_Damage_Effect_Last_Time = new GameAttributeI(450, 0, -1, 1, 1, "", "", "Ambient_Damage_Effect_Last_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF Scale_Bonus = new GameAttributeF(451, 0, -1, 0, 0, "", "", "Scale_Bonus", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeB Deleted_On_Server = new GameAttributeB(452, 0, -1, 1, 1, "", "", "Deleted_On_Server", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Scripted_Fade_Time = new GameAttributeI(453, 0, -1, 1, 1, "", "", "Scripted_Fade_Time", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeB Does_No_Damage = new GameAttributeB(454, 0, -1, 1, 1, "", "", "Does_No_Damage", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Does_Fake_Damage = new GameAttributeB(455, 0, -1, 1, 1, "", "", "Does_Fake_Damage", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF SlowTime_Debuff = new GameAttributeF(456, 0, -1, 0, 0, "", "", "SlowTime_Debuff", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeB Blocks_Projectiles = new GameAttributeB(457, 0, -1, 1, 1, "", "", "Blocks_Projectiles", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Frozen = new GameAttributeB(458, 0, -1, 1, 1, "", "", "Frozen", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeF Freeze_Damage_Percent_Bonus = new GameAttributeF(459, 0, -1, 0, 0, "", "", "Freeze_Damage_Percent_Bonus", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeB Buff_Active = new GameAttributeB(460, 0, 4, 1, 1, "", "", "Buff_Active", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeF DualWield_BothAttack_Chance = new GameAttributeF(461, 0, -1, 0, 0, "", "", "DualWield_BothAttack_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Summon_Expiration_Tick = new GameAttributeI(462, 0, -1, 0, 1, "", "", "Summon_Expiration_Tick", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Summon_Count = new GameAttributeI(463, 0, -1, 0, 1, "", "", "Summon_Count", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Uninterruptible = new GameAttributeB(464, 0, -1, 1, 1, "", "", "Uninterruptible", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Queue_Death = new GameAttributeB(465, 0, -1, 1, 1, "", "", "Queue Death", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB CantStartDisplayedPowers = new GameAttributeB(466, 0, -1, 1, 1, "", "", "CantStartDisplayedPowers", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Wizard_Slowtime_Proxy_ACD = new GameAttributeI(467, -1, -1, 3, 1, "", "", "Wizard_Slowtime_Proxy_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF DPS = new GameAttributeF(468, 0, -1, 1, 0, "", "", "DPS", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeI Resurrection_Power = new GameAttributeI(469, -1, -1, 3, 1, "", "", "Resurrection_Power", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF Freeze_Damage = new GameAttributeF(470, 0, -1, 1, 0, "", "", "Freeze_Damage", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF Freeze_Capacity = new GameAttributeF(471, 0, -1, 0, 0, "", "", "Freeze_Capacity", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); + public static readonly GameAttributeF Thaw_Rate = new GameAttributeF(472, 0, -1, 0, 0, "", "", "Thaw_Rate", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); + public static readonly GameAttributeF Chilled_Dur_Bonus_Percent = new GameAttributeF(473, 0, -1, 0, 0, "", "", "Chilled_Dur_Bonus_Percent", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); + public static readonly GameAttributeF DOT_DPS = new GameAttributeF(474, 0, -1, 0, 0, "", "", "DOT_DPS", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); + public static readonly GameAttributeF DamageCap_Percent = new GameAttributeF(475, 0, -1, 1, 0, "", "", "DamageCap_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeI Item_Time_Sold = new GameAttributeI(476, 0, -1, 1, 1, "", "", "Item_Time_Sold", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI Forced_Hireling_Power = new GameAttributeI(477, -1, -1, 3, 1, "", "", "Forced_Hireling_Power", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB IsRooted = new GameAttributeB(478, 0, -1, 1, 1, "", "", "IsRooted", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI RootTargetACD = new GameAttributeI(479, -1, -1, 3, 1, "", "", "RootTargetACD", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeF RootAutoDecayPerSecond = new GameAttributeF(480, 0, -1, 1, 0, "", "", "RootAutoDecayPerSecond", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF RootUnitValue = new GameAttributeF(481, 0, -1, 1, 0, "", "", "RootUnitValue", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeI RootTotalTicks = new GameAttributeI(482, 0, -1, 1, 1, "", "", "RootTotalTicks", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Hide_Affixes = new GameAttributeB(483, 0, -1, 1, 1, "", "", "Hide_Affixes", GameAttributeEncoding.IntMinMax, 8, 0, 1, 1); + public static readonly GameAttributeI Skill_Socket_Bonus = new GameAttributeI(484, 0, -1, 1, 1, "", "", "Skill_Socket_Bonus", GameAttributeEncoding.IntMinMax, 8, 0, 31, 5); + public static readonly GameAttributeI Rune_Rank = new GameAttributeI(485, 0, 11, 0, 1, "", "", "Rune_Rank", GameAttributeEncoding.IntMinMax, 8, 0, 255, 8); + public static readonly GameAttributeI Rune_Attuned_Power = new GameAttributeI(486, -1, -1, 1, 1, "", "", "Rune_Attuned_Power", GameAttributeEncoding.Int, 8, 0, 0, 32); + public static readonly GameAttributeI Rune_A = new GameAttributeI(487, 0, 11, 0, 1, "", "", "Rune_A", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); + public static readonly GameAttributeI Rune_B = new GameAttributeI(488, 0, 11, 0, 1, "", "", "Rune_B", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); + public static readonly GameAttributeI Rune_C = new GameAttributeI(489, 0, 11, 0, 1, "", "", "Rune_C", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); + public static readonly GameAttributeI Rune_D = new GameAttributeI(490, 0, 11, 0, 1, "", "", "Rune_D", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); + public static readonly GameAttributeI Rune_E = new GameAttributeI(491, 0, 11, 0, 1, "", "", "Rune_E", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); + public static readonly GameAttributeF Resistance_Stun = new GameAttributeF(492, 0, -1, 0, 0, "", "", "Resistance_Stun", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Stun_Total = new GameAttributeF(493, 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(494, 0, -1, 0, 0, "", "", "Resistance_Root", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Root_Total = new GameAttributeF(495, 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(496, 0, -1, 0, 0, "", "", "Resistance_Freeze", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Freeze_Total = new GameAttributeF(497, 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(498, 0, -1, 0, 0, "", "", "Resistance_StunRootFreeze", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF CrowdControl_Reduction = new GameAttributeF(499, 0, -1, 7, 0, "", "", "CrowdControl_Reduction", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeB Displays_Team_Effect = new GameAttributeB(500, 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(501, 0, -1, 1, 1, "", "", "Cannot_Be_Added_To_AI_Target_List", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI SkillKit = new GameAttributeI(502, -1, -1, 3, 1, "", "", "SkillKit", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeB Immune_To_Charm = new GameAttributeB(503, 0, -1, 1, 1, "", "", "Immune_To_Charm", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Immune_To_Blind = new GameAttributeB(504, 0, -1, 1, 1, "", "", "Immune_To_Blind", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Damage_Shield = new GameAttributeB(505, 0, -1, 1, 1, "", "", "Damage_Shield", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Silenced = new GameAttributeB(506, 0, -1, 1, 1, "", "", "Silenced", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Diseased = new GameAttributeB(507, 0, -1, 1, 1, "", "", "Diseased", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Guard_Object_ACDID = new GameAttributeI(508, -1, -1, 3, 1, "", "", "Guard_Object_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Follow_Target_ACDID = new GameAttributeI(509, -1, -1, 3, 1, "", "", "Follow_Target_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Follow_Target_Type = new GameAttributeI(510, 0, -1, 3, 1, "", "", "Follow_Target_Type", GameAttributeEncoding.IntMinMax, 0, 0, 2, 2); + public static readonly GameAttributeI Forced_Enemy_ACDID = new GameAttributeI(511, -1, -1, 1, 1, "", "", "Forced_Enemy_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI NPC_Talk_Target_ANN = new GameAttributeI(512, -1, -1, 3, 1, "", "", "NPC_Talk_Target_ANN", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI NPC_Conv_Target_ANN = new GameAttributeI(513, -1, -1, 3, 1, "", "", "NPC_Conv_Target_ANN", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Script_Target_ACDID = new GameAttributeI(514, -1, 3, 3, 1, "", "", "Script_Target_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Look_Target_Server_ANN = new GameAttributeI(515, -1, -1, 1, 1, "", "", "Look_Target_Server_ANN", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeF Look_Target_Broadcast_Intensity = new GameAttributeF(516, 0, -1, 0, 0, "", "", "Look_Target_Broadcast_Intensity", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF Look_Target_Broadcast_Radius = new GameAttributeF(517, 0, -1, 0, 0, "", "", "Look_Target_Broadcast_Radius", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeB Stealthed = new GameAttributeB(518, 0, -1, 1, 1, "", "", "Stealthed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI GemQuality = new GameAttributeI(519, 0, -1, 4, 1, "", "", "GemQuality", GameAttributeEncoding.IntMinMax, 8, 0, 10, 4); + public static readonly GameAttributeB SalvageUnlocked = new GameAttributeB(520, 0, -1, 1, 1, "", "", "SalvageUnlocked", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI TalismanLevel = new GameAttributeI(521, 0, -1, 1, 1, "", "", "TalismanLevel", GameAttributeEncoding.IntMinMax, 31, 0, 4, 3); + public static readonly GameAttributeI Talisman_Slots = new GameAttributeI(522, 0, -1, 0, 1, "", "", "Talisman_Slots", GameAttributeEncoding.IntMinMax, 31, 0, 9, 4); + public static readonly GameAttributeI UpgradeLevelA = new GameAttributeI(523, 0, -1, 1, 1, "", "", "UpgradeLevelA", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); + public static readonly GameAttributeI UpgradeLevelB = new GameAttributeI(524, 0, -1, 1, 1, "", "", "UpgradeLevelB", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); + public static readonly GameAttributeI UpgradeLevelC = new GameAttributeI(525, 0, -1, 1, 1, "", "", "UpgradeLevelC", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); + public static readonly GameAttributeI UpgradeLevelD = new GameAttributeI(526, 0, -1, 1, 1, "", "", "UpgradeLevelD", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); + public static readonly GameAttributeI ItemBuffIcon = new GameAttributeI(527, 0, 4, 1, 1, "", "0", "ItemBuffIcon", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeF ScrollDuration = new GameAttributeF(528, 0, -1, 1, 0, "", "0", "ScrollDuration", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Gizmo_Actor_SNO_To_Spawn = new GameAttributeI(529, -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(530, 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(531, -1, -1, 3, 1, "", "", "Death_Replacement_Power_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Attachment_Handled_By_Client = new GameAttributeB(532, 0, -1, 1, 1, "", "", "Attachment_Handled_By_Client", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB AI_In_Special_State = new GameAttributeB(533, 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(534, 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(535, 0, -1, 1, 1, "", "", "AI_Spawned_By_Inactive_Marker", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Headstone_Player_ANN = new GameAttributeI(536, -1, -1, 3, 1, "", "", "Headstone_Player_ANN", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeF Resource_Cost_Reduction_Percent = new GameAttributeF(537, 0, 10, 0, 0, "", "", "Resource_Cost_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Resistance_Penetration = new GameAttributeF(538, 0, 0, 0, 0, "", "", "Resistance_Penetration", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Resistance_Penetration_Total = new GameAttributeF(539, 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(540, 0, -1, 0, 0, "", "", "Resistance_Penetration_All", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Resistance_Penetration_Percent_All = new GameAttributeF(541, 0, -1, 0, 0, "", "", "Resistance_Penetration_Percent_All", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Fury_Effect_Level = new GameAttributeI(542, 0, -1, 0, 1, "", "", "Fury_Effect_Level", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeF Health_Potion_Bonus_Heal_Percent = new GameAttributeF(543, 0, -1, 0, 0, "", "", "Health_Potion_Bonus_Heal_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Free_Cast = new GameAttributeI(544, 0, 4, 1, 1, "", "", "Free_Cast", GameAttributeEncoding.Int, 9, 0, 0, 32); + public static readonly GameAttributeB Free_Cast_All = new GameAttributeB(545, 0, -1, 1, 1, "", "", "Free_Cast_All", GameAttributeEncoding.IntMinMax, 9, 0, 1, 1); + public static readonly GameAttributeF Movement_Scalar_Reduction_Percent = new GameAttributeF(546, 0, -1, 1, 0, "", "", "Movement_Scalar_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Movement_Scalar_Reduction_Resistance = new GameAttributeF(547, 0, -1, 0, 0, "", "", "Movement_Scalar_Reduction_Resistance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Absorb_Percent_All = new GameAttributeF(548, 0, -1, 0, 0, "", "", "Damage_Absorb_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI World_Seed = new GameAttributeI(549, 0, -1, 0, 1, "", "", "World_Seed", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI Kill_Count_Record = new GameAttributeI(550, 0, -1, 1, 1, "", "", "Kill_Count_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI Object_Destruction_Record = new GameAttributeI(551, 0, -1, 1, 1, "", "", "Object_Destruction_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI Single_Attack_Record = new GameAttributeI(552, 0, -1, 1, 1, "", "", "Single_Attack_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeI Environment_Attack_Record = new GameAttributeI(553, 0, -1, 1, 1, "", "", "Environment_Attack_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); + public static readonly GameAttributeB Root_Immune = new GameAttributeB(554, 0, -1, 1, 1, "", "", "Root_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeF Monster_Play_Get_Hit_Bonus = new GameAttributeF(555, 0, -1, 0, 0, "", "", "Monster_Play_Get_Hit_Bonus", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); + public static readonly GameAttributeI Stored_Contact_Frame = new GameAttributeI(556, 0, -1, 1, 1, "", "", "Stored_Contact_Frame", GameAttributeEncoding.IntMinMax, 0, 0, 4, 3); + public static readonly GameAttributeI Buff_Icon_Count0 = new GameAttributeI(557, 0, 4, 0, 1, "", "", "Buff_Icon_Count0", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeI Buff_Icon_Count1 = new GameAttributeI(558, 0, 4, 0, 1, "", "", "Buff_Icon_Count1", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeI Buff_Icon_Count2 = new GameAttributeI(559, 0, 4, 0, 1, "", "", "Buff_Icon_Count2", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeI Buff_Icon_Count3 = new GameAttributeI(560, 0, 4, 0, 1, "", "", "Buff_Icon_Count3", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeB Observer = new GameAttributeB(561, 0, -1, 1, 1, "", "", "Observer", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Resurrect_As_Observer = new GameAttributeB(562, 0, -1, 1, 1, "", "", "Resurrect_As_Observer", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Combo_Level = new GameAttributeI(563, 0, -1, 1, 1, "", "", "Combo_Level", GameAttributeEncoding.IntMinMax, 0, 0, 3, 2); + public static readonly GameAttributeI Combo_Time_Last_Move = new GameAttributeI(564, 0, -1, 1, 1, "", "", "Combo_Time_Last_Move", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Burrowed = new GameAttributeB(565, 0, -1, 1, 1, "", "", "Burrowed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Death_Replacement_Effect_Group_SNO = new GameAttributeI(566, -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(567, 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(568, 0, -1, 0, 1, "", "", "Checkpoint_Resurrection_Forced_Game_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Controlling_TimedEvent_SNO = new GameAttributeI(569, -1, -1, 3, 1, "", "", "Controlling_TimedEvent_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF Casting_Speed_Percent = new GameAttributeF(570, 0, -1, 0, 0, "", "", "Casting_Speed_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeB Using_Bossbar = new GameAttributeB(571, 0, -1, 1, 1, "", "", "Using_Bossbar", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_0_Visual_Effect = new GameAttributeB(572, 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(573, 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(574, 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(575, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Store_SNO = new GameAttributeI(576, 0, 0, 3, 1, "", "", "Store SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeB Busy = new GameAttributeB(577, 0, -1, 1, 1, "", "", "Busy", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Afk = new GameAttributeB(578, 0, -1, 1, 1, "", "", "Afk", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Last_Action_Timestamp = new GameAttributeI(579, 0, -1, 1, 1, "", "", "Last Action Timestamp", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Portal_Next_Time = new GameAttributeI(580, 0, -1, 1, 1, "", "", "Portal Next Time", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeF Repair_Discount_Percent = new GameAttributeF(581, 0, -1, 0, 0, "", "", "Repair_Discount_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeB Resource_Degeneration_Prevented = new GameAttributeB(582, 0, -1, 1, 1, "", "", "Resource_Degeneration_Prevented", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Operatable = new GameAttributeB(583, 0, -1, 4, 1, "", "", "Operatable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Look_Override = new GameAttributeI(584, 0, -1, 0, 1, "", "", "Look_Override", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Spawner_Concurrent_Count_ID = new GameAttributeI(585, -1, -1, 3, 1, "", "", "Spawner_Concurrent_Count_ID", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Disabled = new GameAttributeB(586, 0, -1, 1, 1, "", "", "Disabled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Skill_Override = new GameAttributeI(587, -1, 3, 1, 1, "", "", "Skill_Override", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeB Skill_Override_Active = new GameAttributeB(588, 0, -1, 1, 1, "", "", "Skill_Override_Active", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Skill_Override_Ended = new GameAttributeB(589, 0, 4, 1, 1, "", "", "Skill_Override_Ended", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Skill_Override_Ended_Active = new GameAttributeB(590, 0, -1, 1, 1, "", "", "Skill_Override_Ended_Active", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Is_Power_Proxy = new GameAttributeB(591, 0, -1, 1, 1, "", "", "Is_Power_Proxy", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Force_No_Death_Animation = new GameAttributeB(592, 0, -1, 1, 1, "", "", "Force_No_Death_Animation", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Player_WeaponClass_Anim_Override = new GameAttributeI(593, -1, -1, 1, 1, "", "", "Player_WeaponClass_Anim_Override", GameAttributeEncoding.IntMinMax, 31, -1, 19, 5); + public static readonly GameAttributeB Operatable_Story_Gizmo = new GameAttributeB(594, 0, -1, 1, 1, "", "", "Operatable_Story_Gizmo", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_0_Visual_Effect_None = new GameAttributeB(595, 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(596, 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(597, 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(598, 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(599, 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(600, 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(601, 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(602, 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(603, 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(604, 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(605, 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(606, 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(607, 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(608, 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(609, 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(610, 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(611, 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(612, 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(613, 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(614, 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(615, 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(616, 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(617, 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(618, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Walk_Passability_Power_SNO = new GameAttributeI(619, -1, -1, 1, 1, "", "", "Walk_Passability_Power_SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Passability_Power_SNO = new GameAttributeI(620, -1, -1, 1, 1, "", "", "Passability_Power_SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Flippy_ID = new GameAttributeI(621, -1, -1, 3, 1, "", "", "Flippy_ID", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Summoning_Machine_Num_Casters = new GameAttributeI(622, 0, -1, 0, 1, "", "", "Summoning_Machine_Num_Casters", GameAttributeEncoding.IntMinMax, 0, 0, 255, 8); + public static readonly GameAttributeI Summoning_Machine_Spawn_Count = new GameAttributeI(623, 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(624, 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(625, -1, -1, 1, 1, "", "", "Summoning_Machine_Spawn_Team", GameAttributeEncoding.IntMinMax, 0, -1, 23, 5); + public static readonly GameAttributeF Screen_Attack_Radius_Constant = new GameAttributeF(626, 1114636288, -1, 3, 0, "", "", "Screen_Attack_Radius_Constant", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeF Damage_Done_Reduction_Percent = new GameAttributeF(627, 0, -1, 1, 0, "", "", "Damage_Done_Reduction_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeI Set_Item_Count = new GameAttributeI(628, 0, 17, 0, 1, "", "", "Set_Item_Count", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeF Spawner_Countdown_Percent = new GameAttributeF(629, 0, -1, 1, 0, "", "", "Spawner_Countdown_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeB Attack_Slow = new GameAttributeB(630, 0, -1, 1, 1, "", "", "Attack_Slow", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Power_Disabled = new GameAttributeB(631, 0, 4, 1, 1, "", "", "Power_Disabled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Weapon_Effect_Override = new GameAttributeI(632, 0, -1, 1, 1, "", "", "Weapon_Effect_Override", GameAttributeEncoding.IntMinMax, 31, 0, 14, 4); + public static readonly GameAttributeF Debuff_Duration_Reduction_Percent = new GameAttributeF(633, 0, -1, 0, 0, "", "", "Debuff_Duration_Reduction_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); + public static readonly GameAttributeB Uses_PvP_Power_Tags = new GameAttributeB(634, 0, -1, 1, 1, "", "", "Uses_PvP_Power_Tags", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Trait = new GameAttributeI(635, 0, 4, 1, 1, "", "", "Trait", GameAttributeEncoding.IntMinMax, 31, -1, 30, 5); + public static readonly GameAttributeI Last_ACD_Attacked_By = new GameAttributeI(636, -1, -1, 3, 1, "", "", "Last_ACD_Attacked_By", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB ItemMeltUnlocked = new GameAttributeB(637, 0, -1, 1, 1, "", "", "ItemMeltUnlocked", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeF Gold_PickUp_Radius = new GameAttributeF(638, 0, -1, 0, 0, "", "", "Gold_PickUp_Radius", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeI Client_Only_Effect = new GameAttributeI(639, 0, 12, 1, 1, "", "", "Client Only Effect", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeB Has_Doppelganger_Cloned = new GameAttributeB(640, 0, -1, 1, 1, "", "", "Has_Doppelganger_Cloned", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Buff_Icon_Start_Tick4 = new GameAttributeI(641, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick4", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_Start_Tick5 = new GameAttributeI(642, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick5", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_Start_Tick6 = new GameAttributeI(643, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick6", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_Start_Tick7 = new GameAttributeI(644, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick7", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick4 = new GameAttributeI(645, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick4", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick5 = new GameAttributeI(646, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick5", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick6 = new GameAttributeI(647, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick6", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_End_Tick7 = new GameAttributeI(648, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick7", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Buff_Icon_Count4 = new GameAttributeI(649, 0, 4, 0, 1, "", "", "Buff_Icon_Count4", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeI Buff_Icon_Count5 = new GameAttributeI(650, 0, 4, 0, 1, "", "", "Buff_Icon_Count5", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeI Buff_Icon_Count6 = new GameAttributeI(651, 0, 4, 0, 1, "", "", "Buff_Icon_Count6", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeI Buff_Icon_Count7 = new GameAttributeI(652, 0, 4, 0, 1, "", "", "Buff_Icon_Count7", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); + public static readonly GameAttributeB Power_Buff_4_Visual_Effect = new GameAttributeB(653, 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(654, 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(655, 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(656, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Power_Buff_4_Visual_Effect_None = new GameAttributeB(657, 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(658, 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(659, 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(660, 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(661, 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(662, 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(663, 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(664, 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(665, 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(666, 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(667, 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(668, 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(669, 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(670, 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(671, 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(672, 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(673, 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(674, 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(675, 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(676, 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(677, 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(678, 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(679, 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(680, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeF Resource_Gain_Bonus_Percent = new GameAttributeF(681, 0, 10, 0, 0, "", "", "Resource_Gain_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Looping_Animation_Start_Time = new GameAttributeI(682, 0, -1, 1, 1, "", "", "Looping_Animation_Start_Time", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Looping_Animation_End_Time = new GameAttributeI(683, 0, -1, 1, 1, "", "", "Looping_Animation_End_Time", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeI Heal_Effect_Last_Played_Tick = new GameAttributeI(684, -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(685, -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(686, -1, -1, 3, 1, "", "", "Thorns_Effect_Last_Played_tick", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI PVP_Kills = new GameAttributeI(687, 0, -1, 0, 1, "", "", "PVP_Kills", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI PVP_Deaths = new GameAttributeI(688, 0, -1, 0, 1, "", "", "PVP_Deaths", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI PVP_Assists = new GameAttributeI(689, 0, -1, 0, 1, "", "", "PVP_Assists", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI PVP_Progression_Points_Gained = new GameAttributeI(690, 0, -1, 0, 1, "", "", "PVP_Progression_Points_Gained", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI PVP_Current_Kill_Streak = new GameAttributeI(691, 0, -1, 0, 1, "", "", "PVP_Current_Kill_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI PVP_Current_Death_Streak = new GameAttributeI(692, 0, -1, 0, 1, "", "", "PVP_Current_Death_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI PVP_Longest_Kill_Streak = new GameAttributeI(693, 0, -1, 0, 1, "", "", "PVP_Longest_Kill_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeI PVP_Longest_Death_Streak = new GameAttributeI(694, 0, -1, 0, 1, "", "", "PVP_Longest_Death_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); + public static readonly GameAttributeF Turn_Rate_Scalar = new GameAttributeF(695, 1065353216, -1, 5, 0, "", "", "Turn_Rate_Scalar", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF Turn_Accel_Scalar = new GameAttributeF(696, 1065353216, -1, 5, 0, "", "", "Turn_Accel_Scalar", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeF Turn_Deccel_Scalar = new GameAttributeF(697, 1065353216, -1, 5, 0, "", "", "Turn_Deccel_Scalar", GameAttributeEncoding.Float16, 31, 0, 0, 16); + public static readonly GameAttributeB No_Health_Drop = new GameAttributeB(698, 0, -1, 1, 1, "", "", "No_Health_Drop", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Leader = new GameAttributeB(699, 0, -1, 1, 1, "", "", "Leader", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB IsTrialActor = new GameAttributeB(700, 0, -1, 1, 1, "", "", "IsTrialActor", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB InBossEncounter = new GameAttributeB(701, 0, -1, 1, 1, "", "", "InBossEncounter", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB God = new GameAttributeB(702, 0, -1, 1, 1, "", "", "God", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB MinimapActive = new GameAttributeB(703, 0, -1, 1, 1, "", "", "MinimapActive", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI MinimapIconOverride = new GameAttributeI(704, -1, -1, 0, 1, "", "", "MinimapIconOverride", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeB MinimapDisableArrow = new GameAttributeB(705, 0, -1, 1, 1, "", "", "MinimapDisableArrow", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeI Last_Blocked_ACD = new GameAttributeI(706, -1, -1, 3, 1, "", "", "Last_Blocked_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Last_Blocked_Time = new GameAttributeI(707, 0, -1, 1, 1, "", "", "Last_Blocked_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeB Deactivate_Lure = new GameAttributeB(708, 0, -1, 1, 1, "", "", "Deactivate Lure", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeB Weapons_Hidden = new GameAttributeB(709, 0, -1, 1, 1, "", "", "Weapons_Hidden", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); + public static readonly GameAttributeB Actor_Updates_Attributes_From_Owner = new GameAttributeB(710, 0, -1, 1, 1, "", "", "Actor_Updates_Attributes_From_Owner", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); + public static readonly GameAttributeI Taunt_Target_ACD = new GameAttributeI(711, -1, -1, 1, 1, "", "", "Taunt_Target_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeF UI_Only_Percent_Damage_Increase = new GameAttributeF(712, 0, -1, 0, 0, "", "", "UI_Only_Percent_Damage_Increase", GameAttributeEncoding.Float16, 1, 0, 0, 16); + public static readonly GameAttributeI Projectile_Effect_SNO = new GameAttributeI(713, -1, -1, 3, 1, "", "", "Projectile_Effect_SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); + public static readonly GameAttributeF On_Hit_Fear_Proc_Chance = new GameAttributeF(714, 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(715, 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(716, 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(717, 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(718, 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(719, 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(720, 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(721, 0, -1, 7, 0, "", "", "On_Hit_Knockback_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Percent_Reduction_From_Ranged = new GameAttributeF(722, 0, -1, 7, 0, "", "", "Damage_Percent_Reduction_From_Ranged", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Percent_Reduction_From_Melee = new GameAttributeF(723, 0, -1, 7, 0, "", "", "Damage_Percent_Reduction_From_Melee", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Percent_Reduction_Turns_Into_Heal = new GameAttributeF(724, 0, -1, 7, 0, "", "", "Damage_Percent_Reduction_Turns_Into_Heal", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeF Damage_Percent_Percent_Bonus_Vs_Monster_Type = new GameAttributeF(725, 0, 18, 7, 0, "", "", "Damage_Percent_Percent_Bonus_Vs_Monster_Type", GameAttributeEncoding.Float16, 9, 0, 0, 16); + public static readonly GameAttributeI Item_Manipulation_Timeout = new GameAttributeI(726, 0, -1, 4, 1, "", "", "Item_Manipulation_Timeout", GameAttributeEncoding.Int, 0, 0, 0, 32); + public static readonly GameAttributeI Picked_Up_Time = new GameAttributeI(727, 0, -1, 4, 1, "", "", "Picked_Up_Time", GameAttributeEncoding.Int, 9, 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..92dd71ab --- /dev/null +++ b/src/Mooege/Net/GS/Message/GameAttribute.cs @@ -0,0 +1,148 @@ +/* + * 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.Runtime.InteropServices; +namespace Mooege.Net.GS.Message +{ + 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; } } + + 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..033905d6 --- /dev/null +++ b/src/Mooege/Net/GS/Message/GameBitBuffer.cs @@ -0,0 +1,326 @@ +/* + * 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.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..054b2f8b --- /dev/null +++ b/src/Mooege/Net/GS/Message/GameMessage.cs @@ -0,0 +1,107 @@ +/* + * 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 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) + { + 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..481c06dc --- /dev/null +++ b/src/Mooege/Net/GS/Message/IMessageConsumer.cs @@ -0,0 +1,18 @@ +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..334f0758 --- /dev/null +++ b/src/Mooege/Net/GS/Message/ISelfHandler.cs @@ -0,0 +1,7 @@ +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..f9ad703e --- /dev/null +++ b/src/Mooege/Net/GS/Message/MessageAttribute.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; + +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..a745856c --- /dev/null +++ b/src/Mooege/Net/GS/Message/Opcodes.cs @@ -0,0 +1,336 @@ +/* + * 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 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 + RequestUseCauldronOfJordanMessage = 37, // len: 12 former ANNDataMessage5 + 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 + ConnectionEstablishedMessage = 47, // len: 20 + GameSetupMessage = 48, // len: 20 + SimpleMessage7 = 49, // len: 8 + NewPlayerMessage = 50, // len: 16916 + PlayerBannerMessage = 51, // len: former GenericBlobMessage7 + //HeroStateData = 50, // len: + EnterWorldMessage = 52, // len: 28 + RevealSceneMessage = 53, // len: 1292 + DestroySceneMessage = 54, // len: 16 + SwapSceneMessage = 55, // len: 20 + RevealWorldMessage = 56, // len: 16 + RevealTeamMessage = 57, // len: 20 + PlayerActorSetInitialMessage = 58, // len: 16 + HeroStateMessage = 59, // len: 16652 + ACDEnterKnownMessage = 60, // len: 132 + ACDDestroyActorMessage = 61, // len: 12 former ANNDataMessage + PlayerEnterKnownMessage = 62, // len: 16 + ACDCreateActorMessage = 63, // len: 12 former ANNDataMessage + ACDWorldPositionMessage = 64, // len: 48 + ACDInventoryPositionMessage = 65, // len: 32 + ACDInventoryUpdateActorSNO = 66, // len: 16 + TrickleMessage = 67, // len: 116 + ANNDataMessage8 = 68, // len: 12 + MapRevealSceneMessage = 69, // len: 52 + SavePointInfoMessage = 70, // len: 12 + HearthPortalInfoMessage = 71, // len: 16 + ReturnPointInfoMessage = 72, // len: 12 + AffixMessage = 73, // len: 148 + RareMonsterNamesMessage = 74, // len: 52 + RareItemNameMessage = 75, // len: 28 + PortalSpecifierMessage = 76, // len: 24 + AttributeSetValueMessage = 77, // len: 28 + AttributesSetValuesMessage = 78, // len: 256 + VisualInventoryMessage = 79, // len: 140 + ProjectileStickMessage = 80, // len: 28 + TargetMessage = 81, // len: 60 + SecondaryAnimationPowerMessage = 82, // len: 28 + LoopingAnimationPowerMessage = 83, // len: 20 + //SNODataMessage1 = 82, // len: 12 removed 7728 + DWordDataMessage2 = 84, // len: 12 + DWordDataMessage3 = 85, // len: 12 + DWordDataMessage4 = 86, // len: 12 + DWordDataMessage5 = 87, // len: 12 + TryChatMessage = 88, // len: 528 + ChatMessage = 89, // len: 528 + ANNDataMessage9 = 90, // len: 12 + InventoryRequestMoveMessage1 = 91, // len: 28 + InventoryRequestSocketMessage = 92, // len: 16 + InventoryRequestMoveMessage2 = 93, // len: 28 + InventorySplitStackMessage = 94, // len: 40 + InventoryDropStackPortionMessage = 95, //len: 24 + InventoryStackTransferMessage = 96, // len: 24 + ANNDataMessage10 = 97, // len: 12 + SimpleMessage47 = 98, //len 8 added in 7841 + ANNDataMessage11 = 99, // len: 12 + InventoryRequestUseMessage = 100, // len: 36 + SocketSpellMessage = 101, // len: 16 + HelperDetachMessage = 102, // len: 12 + AssignSkillMessage1 = 103, // len: 16 + AssignSkillMessage2 = 104, // len: 16 + AssignSkillMessage3 = 105, // len: 16 + AssignSkillMessage4 = 106, // len: 16 + HirelingRequestLearnSkillMessage = 107, // len: 20 + HotbarButtonData = 108, // len: 12 former ANNDataMessage12 + PlayerChangeHotbarButtonMessage = 109, // len: 20 + IntDataMessage2 = 110, // len: 12 dont know why someone renamed it PlayAnimationMessageSpec + PlayAnimationMessage = 111, // len: 72 + ANNDataMessage13 = 112, // len: 12 + NotifyActorMovementMessage = 113, // len: 76 former ACDTranslateNormalMessage1 + ACDTranslateSnappedMessage = 114, // len: 36 + ACDTranslateFacingMessage = 115, // len: 20 + ACDTranslateFixedMessage = 116, // len: 36 + ACDTranslateArcMessage = 117, // len: 60 + ACDTranslateDetPathMessage = 118, // len: 88 + ACDTranslateDetPathSinMessage = 119, // len: 104 + ACDTranslateDetPathSpiralMessage = 120, // len: 72 + ACDTranslateSyncMessage = 121, // len: 32 + ACDTranslateFixedUpdateMessage = 122, // len: 36 + PlayerMovementMessage = 123, //len: 75 former ACDTranslateNormalMessage2 + PlayerTranslateFacingMessage = 124, // len: 20 + PlayEffectMessage = 125, // len: 24 + PlayHitEffectMessage = 126, // len: 24 + PlayHitEffectOverrideMessage = 127, // len: 20 + PlayNonPositionalSoundMessage = 128, // len: 12 + PlayErrorSoundMessage = 129, // len: 12 + PlayMusicMessage = 130, // len: 12 + PlayCutsceneMessage = 131, // len: 12 + ComplexEffectAddMessage = 132, // len: 36 + FlippyMessage = 133, // len: 32 + WaypointActivatedMessage = 134, // len: 20 + OpenWaypointSelectionWindowMessage = 135, // len: 12 former ANNDataMessage + ANNDataMessage15 = 136, // len: 12 + ANNDataMessage16 = 137, // len: 12 + AimTargetMessage = 138, // len: 36 + ACDChangeGBHandleMessage = 139, // len: 20 + GameTickMessage = 140, // len: 12 former DWordDataMessage + //LearnedSkillMessage = 138, // len: 524 removed 7728 + DataIDDataMessage1 = 141, // len: 12 + DataIDDataMessage2 = 142, // len: 12 + EndOfTickMessage = 143, // len: 16 + TryWaypointMessage = 144, // len: 16 + NPCInteractOptionsMessage = 145, // len: 340 + ANNDataMessage17 = 146, // len: 12 + ANNDataMessage18 = 147, // len: 12 + SimpleMessage8 = 148, // len: 8 + QuestUpdateMessage = 149, // len: 28 + QuestMeterMessage = 150, // len: 20 + QuestCounterMessage = 151, // len: 20 + QuestStepCompleteMessage = 152, // len: // former BlobDataMessage8 + //PlayerInteractMessage = 151, // len: 16 removed 7728 + PlayerIndexMessage3 = 153, // len: 12 + PlayerLevel = 154, // len: 16 + OpenSharedStashMessage = 155, // len: 12, former ANNDataMessage19 + UseNephalemAltarMessage = 156, //len: 12 added 7728 + NephalemAltarWindowClosedMessage = 157, // len: 8 former SimpleMessage9 + ACDPickupFailedMessage = 158, // len: 16 + PetMessage = 159, // len: 24 + //ANNDataMessage20 = 159, // len: 12 removed 7841 + PetDetachMessage = 160, // len: 16 + HirelingInfoUpdateMessage = 161, // len: 24 + UIElementMessage = 162, // len: 16 + PlayerBusyMessage = 163, // len: 12 // former: BoolDataMessage + TradeMessage1 = 164, // len: 56 + TradeMessage2 = 165, // len: 56 + PlayerIndexMessage4 = 166, // len: 12 + SimpleMessage10 = 167, // len: 8 + PlayerIndexMessage5 = 168, // len: 12 + SetIdleAnimationMessage = 169, // len: 16 + ACDCollFlagsMessage = 170, // len: 16 + GoldModifiedMessage = 171, // len: 12 + ActTransitionMessage = 172, // len: 16 + InterstitialMessage = 173, // len: 16 + EffectGroupACDToACDMessage = 174, // len: 20 + RopeEffectMessageACDToACD = 175, // len: 28 + RopeEffectMessageACDToPlace = 176, // len: 36 + ANNDataMessage21 = 177, // len: 12 + ShrineActivatedMessage = 178, // len: 12 former ANNDataMessage22 + GameSyncedDataMessage = 179, // len: 96 + ACDChangeActorMessage = 180, // len: 16 + PlayerWarpedMessage = 181, // len: 16 + VictimMessage = 182, // len: 48 + KillCountMessage = 183, // len: 24 + WorldStatusMessage = 184, // len: 16 + WeatherOverrideMessage = 185, // len: 16 + SimpleMessage11 = 186, // len: 8 + ACDShearMessage = 187, // len: 16 + ACDGroupMessage = 188, // len: 20 + SimpleMessage12 = 189, // len: 8 + PlayConvLineMessage = 190, // len: 172 + StopConvLineMessage = 191, // len: 16 + AdvanceConvMessage = 192, //len : 16 + UpdateConvAutoAdvanceMessage = 193, // len: 20 + RequestCloseConversationWindowMessage = 194, // len: 8 former SimpleMessage13 + EndConversationMessage = 195, // len: 20 + SNODataMessage2 = 196, // len: 12 + FinishConversationMessage = 197, // len: 12 + HirelingSwapMessage1 = 198, // len: 12 + HirelingSwapMessage2 = 199, // len: 12 + SimpleMessage14 = 200, // len: 8 + DeathFadeTimeMessage = 201, // len: 24 + ANNDataMessage23 = 202, // len: 12 + ANNDataMessage24 = 203, // len: 12 + DisplayGameTextMessage = 204, // len: 536 + IntDataMessage4 = 205, // len: 12 + DWordDataMessage7 = 206, // len: 12 + GBIDDataMessage1 = 207, // len: 12 + ANNDataMessage25 = 208, // len: 12 + ANNDataMessage26 = 209, // len: 12 + ACDLookAtMessage = 210, // len: 16 + KillCounterUpdateMessage = 211, // len: 24 + LowHealthCombatMessage = 212, // len: 16 + SaviorMessage = 213, // len: 16 + FloatingNumberMessage = 214, // len: 20 + FloatingAmountMessage = 215, // len: 40 + RemoveRagdollMessage = 216, // len: 16 + SNONameDataMessage = 217, // len: 16 + LoreMessage = 218, // len: 16 + //SimpleMessage15 = 220, // len: 8 //Removed 7841 + WorldDeletedMessage = 222, // len: 12 + SimpleMessage16 = 223, // len: 8 + IntDataMessage5 = 224, // len: 12 + TimedEventStartedMessage = 225, // len: 20 + SNODataMessage4 = 226, // len: 12 + ActTransitionStartedMessage = 227, // len: 16 + RequestBuySharedStashSlotsMessage = 228, // len: 8 former SimpleMessage17 + SimpleMessage17 = 229, // len: 8 //added in 7728 + PlayerQuestMessage1 = 230, // len: 16 + PlayerQuestMessage2 = 231, // len: 16 + PlayerDeSyncSnapMessage = 232, // len: 28 + RequestUseNephalemCubeMessage = 233, // len: 12 former ANNDataMessage27 + SalvageResultsMessage = 234, // len: 60 + SimpleMessage18 = 235, // len: 8 + Message = 236, //len: 36 + //ChatMessage2 = 231, // len: 528 remove 7728 + SimpleMessage19 = 237, // len: 8 + MapMarkerInfoMessage = 238, // len: 72 + BlacksmithDataProgressMessage = 239, // len: former GenericBlobMessage9 + JewelerDataProgressMessage = 240, // len: former GenericBlobMessage10 + MysticDataProgressMessage = 241, // len: + BlacksmithDataInitialMessage = 242, // len: former genericBlobMessage 12 + JewelerDataInitialMessage = 243, // len: former GenericBlobMessage13 + MysticDataInitialMessage = 244, // len: former GenericBlobMessage14 + ANNDataMessage28 = 245, // len: 12 + DebugActorTooltipMessage = 246, // len: 524 + BossEncounterMessage1 = 247, // len: 16 + SimpleMessage20 = 248, // len: 8 + SimpleMessage21 = 249, // len: 8 + BossEncounterMessage2 = 250, // len: 16 + SimpleMessage22 = 251, // len: 8 + SimpleMessage23 = 252, // len: 8 + EncounterInviteStateMessage = 253, // len: 12 + SimpleMessage24 = 254, // len: 8 + SimpleMessage25 = 255, // len: 8 + PlayerIndexMessage6 = 256, // len: 12 + SimpleMessage26 = 257, // len: 8 + SimpleMessage27 = 258, // len: 8 + SimpleMessage28 = 259, // len: 8 + SimpleMessage29 = 260, // len: 8 + CameraFocusMessage = 261, // len: 20 + CameraZoomMessage = 262, // len: 20 + CameraYawMessage = 263, // len: 20 + SimpleMessage30 = 264, // len: 8 + BoolDataMessage2 = 265, // len: 12 + BossZoomMessage = 266, // len: 16 + EnchantItemMessage = 267, // len: 16 + ANNDataMessage29 = 268, // len: 12 + SimpleMessage31 = 269, // len: 8 + SimpleMessage32 = 270, // len: 8 + RequestAddSocketMessage = 271, // len: 12 former ANNDataMessage30 + RequestTrainArtisanMessage = 272, // len: 8 former SimpleMessage33 + IntDataMessage6 = 273, // len: 12 + DebugDrawPrimMessage = 274, // len: 188 + GBIDDataMessage2 = 275, // len: 12 + CraftingResultsMessage = 276, // len: 20 + CrafterLevelUpMessage = 277, // len: 20 + SimpleMessage34 = 278, // len: 8 + ANNDataMessage31 = 279, // len: 12 + ANNDataMessage32 = 280, // len: 12 + IntDataMessage7 = 281, // len: 12 + IntDataMessage8 = 282, // len: 12 + SimpleMessage35 = 283, // len: 8 + SimpleMessage36 = 284, // len: 8 + GameTestingSamplingStartMessage = 285, // len: 16 + SimpleMessage37 = 286, // len: 8 + TutorialShownMessage = 287, // len: 12 former SNODataMessage + RequestBuffCancelMessage = 288, // len: 16 + SimpleMessage38 = 289, // len: 8 + PlayerIndexMessage7 = 290, // len: 12 + SimpleMessage39 = 291, // len: 8 + SimpleMessage40 = 292, // len: 8 + DWordDataMessage8 = 293, // len: 12 + DWordDataMessage9 = 294, // len: 12 + DWordDataMessage10 = 295, // len: 12 + DWordDataMessage11 = 296, // len: 12 + BroadcastTextMessage = 297, // len: 520 + SimpleMessage41 = 298, // len: 8 + SimpleMessage42 = 299, // len: 8 + NPCSelectConversationMessage = 300, // len: 12 former SNODataMessage6 + HirelingDismissMessage = 301, // len: 12 former ANNDataMessage33 + CraftInteractionMessage = 302, // len: 8 former SimpleMessage43 + HirelingHireMessage = 303, // len: 8 former SimpleMessage44 + HirelingInventoryMessage = 304, // len: 8 former SimpleMessage45 + SNODataMessage7 = 305, // len: 12 + SimpleMessage46 = 306, // len: 8 + VoteKickMessage1 = 307, //len: 528 + PlayerIndexMessage8 = 308, // len: 12 + PlayerIndexMessage9 = 309, // len: 12 + VoteKickMessage2 = 310, //len: 528 + BoolDataMessage3 = 311, // len: 12 + PlayerIndexMessage10 = 312, // len: 12 + PlayerIndexMessage11 = 313, // len: 12 + } +} diff --git a/src/Mooege/Net/IClient.cs b/src/Mooege/Net/IClient.cs new file mode 100644 index 00000000..130fdb30 --- /dev/null +++ b/src/Mooege/Net/IClient.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 Mooege.Net +{ + public interface IClient + { + IConnection Connection { get; set; } + } +} diff --git a/src/Mooege/Net/IConnection.cs b/src/Mooege/Net/IConnection.cs new file mode 100644 index 00000000..d98ff32a --- /dev/null +++ b/src/Mooege/Net/IConnection.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.Collections.Generic; +using System.Net; +using System.Net.Sockets; +using Mooege.Net.MooNet.Packets; + +namespace Mooege.Net +{ + public interface IConnection + { + bool IsConnected { get; } + IPEndPoint RemoteEndPoint { get; } + IPEndPoint LocalEndPoint { get; } + IClient Client { get; set; } + Socket _Socket { get; } + + int Send(PacketOut 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/src/Mooege/Net/MooNet/Config.cs b/src/Mooege/Net/MooNet/Config.cs new file mode 100644 index 00000000..0ae9e9d0 --- /dev/null +++ b/src/Mooege/Net/MooNet/Config.cs @@ -0,0 +1,31 @@ +/* + * 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 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 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/MooNetClient.cs b/src/Mooege/Net/MooNet/MooNetClient.cs new file mode 100644 index 00000000..65a060e2 --- /dev/null +++ b/src/Mooege/Net/MooNet/MooNetClient.cs @@ -0,0 +1,437 @@ +/* + * 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.Net.Sockets; +using System.Threading; +using Google.ProtocolBuffers; +using Google.ProtocolBuffers.Descriptors; +using Mooege.Common.Helpers.Hash; +using Mooege.Common.Logging; +using Mooege.Core.Cryptography.SSL; +using Mooege.Core.MooNet.Accounts; +using Mooege.Core.MooNet.Authentication; +using Mooege.Core.MooNet.Channels; +using Mooege.Core.MooNet.Helpers; +using Mooege.Core.MooNet.Objects; +using Mooege.Core.MooNet.Toons; +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(); + + /// + /// 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; } + + /// + /// Logged in gs client if any. + /// + public GameClient InGameClient { get; set; } + + /// + /// Account for logged in client. + /// + public Account Account { get; set; } + + /// + /// Selected toon for current account. + /// + public Toon CurrentToon { 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; } + + /// + /// Allows AuthenticationService.LogonResponse to be post-poned until authentication process is done. + /// + public readonly AutoResetEvent AuthenticationCompleteSignal = new AutoResetEvent(false); + + /// + /// Resulting error code for the authentication process. + /// + public AuthManager.AuthenticationErrorCodes AuthenticationErrorCode; + + /// + /// 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 MooNetClient(IConnection connection) + { + this.Platform = ClientPlatform.Unknown; + this.Locale = ClientLocale.Unknown; + this.MOTDSent = false; + + this.Connection = connection; + if (this.Connection != null) + this.NetworkStream = new NetworkStream(this.Connection._Socket, true); + + 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.BnetAccountID); + if (gameacct) identityBuilder.SetGameAccountId(this.Account.BnetGameAccountID); + if (toon && this.CurrentToon != null) + identityBuilder.SetToonId(this.CurrentToon.BnetEntityID); + return identityBuilder.Build(); + } + + #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++; + + 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() + { + // enable the encryption. + var encryptRequest = bnet.protocol.connection.EncryptRequest.CreateBuilder().Build(); + this.MakeRPC(() => bnet.protocol.connection.ConnectionService.CreateStub(this).Encrypt(null, encryptRequest, callback => StartupTSLHandshake())); + } + + private void StartupTSLHandshake() + { + this.TLSStream = new SslStream(this.NetworkStream, false); + + try + { + this.TLSStream.BeginAuthenticateAsServer(CertificateHelper.Certificate, true, null, SslProtocols.Tls, SslStrength.All, false, this.OnTSLAuthentication, this.TLSStream); + } + catch(Exception e) + { + Logger.FatalException(e, "Certificate exception: "); + } + } + + void OnTSLAuthentication(IAsyncResult result) + { + try + { + this.TLSStream.EndAuthenticateAsServer(result); + } + catch(Exception e) + { + Logger.FatalException(e, "OnTSLAuthentication() exception: "); + } + + 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); + + //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); + } + + #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.CurrentToon.BnetEntityID) + .SetType("WHISPER") + .SetSenderId(this.CurrentToon.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 + + private Channel _currentChannel; + public Channel CurrentChannel + { + get + { + return _currentChannel; + } + set + { + this._currentChannel = value; + if (value == null) return; + + var fieldKey = FieldKeyHelper.Create(FieldKeyHelper.Program.D3, 4, 1, 0); + var field = bnet.protocol.presence.Field.CreateBuilder().SetKey(fieldKey) + .SetValue(bnet.protocol.attribute.Variant.CreateBuilder() + .SetMessageValue(this.CurrentChannel.D3EntityId.ToByteString()).Build()).Build(); + + var operation = bnet.protocol.presence.FieldOperation.CreateBuilder().SetField(field).Build(); + var state = bnet.protocol.presence.ChannelState.CreateBuilder().SetEntityId(this.CurrentToon.BnetEntityID).AddFieldOperation(operation).Build(); + + this.SendStateChangeNotification(this.CurrentToon, state); + } + } + + #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, + Invalid, + enUS + } + } +} diff --git a/src/Mooege/Net/MooNet/MooNetRouter.cs b/src/Mooege/Net/MooNet/MooNetRouter.cs new file mode 100644 index 00000000..8a6ad21c --- /dev/null +++ b/src/Mooege/Net/MooNet/MooNetRouter.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.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 stream = CodedInputStream.CreateInstance(e.Data.ToArray()); + while (!stream.IsAtEnd) + { + Identify(e.Connection, stream); + } + } + + public static void Identify(IConnection connection, CodedInputStream stream) + { + var client = (MooNetClient) connection.Client; + var packet = new PacketIn(client, stream); + + if (packet.Header.ServiceId == ServiceReply) + ProcessReply(client, packet); + else + ProcessMessage(client, stream, 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, CodedInputStream stream, 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 = builder.WeakMergeFrom(CodedInputStream.CreateInstance(packet.GetPayload(stream))).WeakBuild(); //var message = packet.ReadMessage(proto.WeakToBuilder()); // this method doesn't seem to work with 7728. /raist. + Logger.LogIncoming(message); + + 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; + service.CallMethod(method, null, message, (msg => SendRPCResponse(client.Connection, packet.Header.Token, msg))); + } + } + 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) + { + var packet = new PacketOut(ServiceReply, 0x0, token, message); + 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..1d9e548b --- /dev/null +++ b/src/Mooege/Net/MooNet/MooNetServer.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 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.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 + + if (!this.Listen(Config.Instance.BindIP, Config.Instance.Port)) return; + Logger.Info("MooNet-Server is listening on {0}:{1}...", Config.Instance.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..611be6f8 --- /dev/null +++ b/src/Mooege/Net/MooNet/Packets/PacketIn.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.Linq; +using Google.ProtocolBuffers; +using Gibbed.IO; + +namespace Mooege.Net.MooNet.Packets +{ + public class PacketIn + { + public MooNetClient Client {get; private set;} + public CodedInputStream Stream {get; private set;} + + public bnet.protocol.Header Header {get; private set;} + + public PacketIn(MooNetClient client, CodedInputStream stream) + { + this.Client = client; + this.Stream = stream; + + this.Read(); + } + + private void Read() + { + var size = (this.Stream.ReadRawByte() << 8) | this.Stream.ReadRawByte(); // header size. + var headerData = this.Stream.ReadRawBytes(size); // header data. + this.Header = bnet.protocol.Header.ParseFrom(headerData); // parse header. + } + + public IMessage ReadMessage(IBuilder builder) + { + return builder.WeakMergeFrom(CodedInputStream.CreateInstance(this.GetPayload(Stream))).WeakBuild(); + + // this._stream.ReadMessage(builder, ExtensionRegistry.Empty); // this method doesn't seem to work with 7728. /raist. + // return builder.WeakBuild(); + } + + public byte[] GetPayload(CodedInputStream stream) + { + return stream.ReadRawBytes((int)this.Header.Size); + } + + public override string ToString() + { + return this.Header.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")); + } + } +} diff --git a/src/Mooege/Net/MooNet/Packets/PacketOut.cs b/src/Mooege/Net/MooNet/Packets/PacketOut.cs new file mode 100644 index 00000000..6e9a17dc --- /dev/null +++ b/src/Mooege/Net/MooNet/Packets/PacketOut.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.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) + : this(serviceId, methodId, token, 0x0, message) + { + } + + public PacketOut(byte serviceId, uint methodId, uint token, ulong objectId, IMessage message) + { + var builder = bnet.protocol.Header.CreateBuilder() + .SetServiceId(serviceId) + .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.LogOutgoing(message); + } + } + } +} diff --git a/src/Mooege/Net/MooNet/RPC/RPCCallback.cs b/src/Mooege/Net/MooNet/RPC/RPCCallback.cs new file mode 100644 index 00000000..e90a9762 --- /dev/null +++ b/src/Mooege/Net/MooNet/RPC/RPCCallback.cs @@ -0,0 +1,35 @@ +/* + * 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 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..7dffe566 --- /dev/null +++ b/src/Mooege/Net/NATConfig.cs @@ -0,0 +1,32 @@ +/* + * 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 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/source/D3Sharp/Net/Server.cs b/src/Mooege/Net/Server.cs similarity index 57% rename from source/D3Sharp/Net/Server.cs rename to src/Mooege/Net/Server.cs index 01424253..ffb959ca 100644 --- a/source/D3Sharp/Net/Server.cs +++ b/src/Mooege/Net/Server.cs @@ -1,37 +1,56 @@ +/* + * 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.Net; using System.Net.Sockets; -using D3Sharp.Core.Storage; -using D3Sharp.Utils; -using D3Sharp.Utils.Extensions; +using Mooege.Common.Extensions; +using Mooege.Common.Logging; -namespace D3Sharp.Net +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 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 delegate void ConnectionEventHandler(object sender, ConnectionEventArgs e); + public delegate void ConnectionDataEventHandler(object sender, ConnectionDataEventArgs e); - public event ConnectionEventHandler ClientConnected; - public event ConnectionEventHandler ClientDisconnected; + public event ConnectionEventHandler OnConnect; + public event ConnectionEventHandler OnDisconnect; public event ConnectionDataEventHandler DataReceived; public event ConnectionDataEventHandler DataSent; - private static readonly Logger Logger = LogManager.CreateLogger(); + protected static readonly Logger Logger = LogManager.CreateLogger(); private bool _disposed; + public virtual void Run() { } + #region listener - public virtual void Listen(int port) + 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."); @@ -41,17 +60,25 @@ public virtual void Listen(int port) // 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"); - } + + // Setup our options: + // * NoDelay - don't use packet coalescing + // * DontLinger - don't keep sockets around once they've been disconnected + Listener.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, true); Listener.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.DontLinger, true); - // Bind. - Listener.Bind(new IPEndPoint(IPAddress.Any, port)); - this.Port = port; + try + { + // Bind. + Listener.Bind(new IPEndPoint(IPAddress.Parse(bindIP), port)); + this.Port = port; + } + catch (SocketException) + { + Logger.Fatal(string.Format("{0} can't bind on {1}, server shutting down..", this.GetType().Name, bindIP)); + this.Shutdown(); + return false; + } // Start listening for incoming connections. Listener.Listen(10); @@ -59,22 +86,27 @@ public virtual void Listen(int port) // 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 client. - var connection = new Client(this, socket); // Add the new connection to the dictionary. + 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[socket] = connection; // add the client to list. + lock (ConnectionLock) Connections[socket] = connection; // add the connection to list. - OnClientConnection(new ClientEventArgs(connection)); // Raise the ClientConnected event. + OnClientConnection(new ConnectionEventArgs(connection)); // Raise the OnConnect event. - connection.BeginReceive(ReceiveCallback, connection); // Begin receiving on the new client connection. - Listener.BeginAccept(AcceptCallback, null); // Continue receiving other incoming clients asynchronously. + 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"); @@ -83,7 +115,7 @@ private void AcceptCallback(IAsyncResult result) private void ReceiveCallback(IAsyncResult result) { - var connection = result.AsyncState as Client; // Get the client connection passed to the callback. + var connection = result.AsyncState as Connection; // Get the connection connection passed to the callback. if (connection == null) return; try @@ -92,16 +124,16 @@ private void ReceiveCallback(IAsyncResult result) if (bytesRecv > 0) { - OnDataReceived(new ClientDataEventArgs(connection, connection.RecvBuffer.Enumerate(0, bytesRecv))); // Raise the DataReceived event. + OnDataReceived(new ConnectionDataEventArgs(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); // else remove it from connection list. } else RemoveConnection(connection, true); // Connection was lost. } catch (SocketException) { - RemoveConnection(connection, true); // An error occured while receiving, client has disconnected. + RemoveConnection(connection, true); // An error occured while receiving, connection has disconnected. } catch (Exception e) { @@ -109,7 +141,7 @@ private void ReceiveCallback(IAsyncResult result) } } - public virtual int Send(Client connection, IEnumerable data, SocketFlags flags) + public virtual int Send(Connection connection, IEnumerable data, SocketFlags flags) { if (connection == null) throw new ArgumentNullException("connection"); if (data == null) throw new ArgumentNullException("data"); @@ -118,7 +150,7 @@ public virtual int Send(Client connection, IEnumerable data, SocketFlags f return Send(connection, buffer, 0, buffer.Length, SocketFlags.None); } - public virtual int Send(Client connection, byte[] buffer, int start, int count, SocketFlags flags) + 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"); @@ -130,9 +162,9 @@ public virtual int Send(Client connection, byte[] buffer, int start, int count, { while (bytesRemaining > 0) // Ensure we send every byte. { - var bytesSent = connection.Socket.Send(buffer, totalBytesSent, bytesRemaining, flags); // Send the remaining data. + 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. + OnDataSent(new ConnectionDataEventArgs(connection, buffer.Enumerate(totalBytesSent, bytesSent))); // Raise the Data Sent event. // Decrement bytes remaining and increment bytes sent. bytesRemaining -= bytesSent; @@ -141,7 +173,7 @@ public virtual int Send(Client connection, byte[] buffer, int start, int count, } catch (SocketException) { - RemoveConnection(connection, true); // An error occured while sending, client has disconnected. + RemoveConnection(connection, true); // An error occured while sending, connection has disconnected. } catch (Exception e) { @@ -155,42 +187,42 @@ public virtual int Send(Client connection, byte[] buffer, int start, int count, #region service methods - public IEnumerable GetClients() + public IEnumerable GetConnections() { lock (ConnectionLock) - foreach (IClient client in Connections.Values) - yield return client; + foreach (IConnection connection in Connections.Values) + yield return connection; } #endregion #region events - protected virtual void OnClientConnection(ClientEventArgs e) + protected virtual void OnClientConnection(ConnectionEventArgs e) { - var handler = ClientConnected; + var handler = OnConnect; if (handler != null) handler(this, e); } - protected virtual void OnClientDisconnect(ClientEventArgs e) + protected virtual void OnClientDisconnect(ConnectionEventArgs e) { - var handler = ClientDisconnected; + var handler = OnDisconnect; if (handler != null) handler(this, e); } - protected virtual void OnDataReceived(ClientDataEventArgs e) + protected virtual void OnDataReceived(ConnectionDataEventArgs e) { var handler = DataReceived; if (handler != null) handler(this, e); } - protected virtual void OnDataSent(ClientDataEventArgs e) + protected virtual void OnDataSent(ConnectionDataEventArgs e) { var handler = DataSent; if (handler != null) handler(this, e); } - #endregion + #endregion #region disconnect & shutdown handlers @@ -198,32 +230,32 @@ public virtual void DisconnectAll() { lock (ConnectionLock) { - foreach (var connection in Connections.Values.Cast().Where(client => client.IsConnected)) // Check if the client is connected. + foreach (var connection in Connections.Values.Cast().Where(conn => conn.IsConnected)) // Check if the connection is connected. { - // Disconnect and raise the ClientDisconnected event. + // Disconnect and raise the OnDisconnect event. connection.Socket.Disconnect(false); - OnClientDisconnect(new ClientEventArgs(connection)); + OnClientDisconnect(new ConnectionEventArgs(connection)); } Connections.Clear(); } } - public virtual void Disconnect(Client connection) + public virtual void Disconnect(Connection 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) + } + + private void RemoveConnection(Connection connection, bool raiseEvent) { // Remove the connection from the dictionary and raise the OnDisconnection event. - lock (ConnectionLock) + lock (ConnectionLock) if (Connections.Remove(connection.Socket) && raiseEvent) - OnClientDisconnect(new ClientEventArgs(connection)); + OnClientDisconnect(new ConnectionEventArgs(connection)); } public virtual void Shutdown() @@ -235,7 +267,17 @@ public virtual void Shutdown() if (!IsListening) return; // Close the listener socket. - if (Listener != null) Listener.Close(); + 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.Value.Disconnect(); + } Listener = null; IsListening = false; @@ -257,7 +299,7 @@ protected virtual void Dispose(bool disposing) if (disposing) { - Shutdown(); // Close the listener socket. + Shutdown(); // Close the listener socket. DisconnectAll(); // Disconnect all users. } diff --git a/src/Mooege/Net/Utils.cs b/src/Mooege/Net/Utils.cs new file mode 100644 index 00000000..7085a5cb --- /dev/null +++ b/src/Mooege/Net/Utils.cs @@ -0,0 +1,43 @@ +/* + * 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.Net; +using Mooege.Net.MooNet; + +namespace Mooege.Net +{ + public static class Utils + { + public static readonly IPAddress LocalHost = IPAddress.Parse("127.0.0.1"); + + public static string GetGameServerIPForClient(MooNetClient client) + { + if (!NATConfig.Instance.Enabled) // if NAT is not enabled, just return bnetclient's localendpoint address. + 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..2cfa4784 --- /dev/null +++ b/src/Mooege/Net/WebServices/Config.cs @@ -0,0 +1,30 @@ +/* + * 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 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..66b085fe --- /dev/null +++ b/src/Mooege/Net/WebServices/IWebService.cs @@ -0,0 +1,32 @@ +/* + * 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.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..e346b482 --- /dev/null +++ b/src/Mooege/Net/WebServices/ServiceManager.cs @@ -0,0 +1,73 @@ +/* + * 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.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..3ef7e2cf --- /dev/null +++ b/src/Mooege/Program.cs @@ -0,0 +1,222 @@ +/* + * 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.Globalization; +using System.Reflection; +using System.Threading; +using Mooege.Common.Logging; +using Mooege.Common.MPQ; +using Mooege.Core.GS.Items; +using Mooege.Core.MooNet.Commands; +using Mooege.Net.GS; +using Mooege.Net.MooNet; +using Mooege.Core.MooNet.Achievement; +using Mooege.Net.WebServices; +using Environment = System.Environment; + +namespace Mooege +{ + internal class Program + { + private static readonly Logger Logger = LogManager.CreateLogger(); + public static readonly DateTime StartupTime = DateTime.Now; + + public static MooNetServer MooNetServer; + public static GameServer GameServer; + + public static Thread MooNetServerThread; + public static Thread GameServerThread; + + public static void Main(string[] args) + { + // Watch for unhandled exceptions + AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler; + + Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; // Use invariant culture - we have to set it explicitly for every thread we create. + + Console.ForegroundColor = ConsoleColor.Yellow; + PrintBanner(); + PrintLicense(); + Console.ResetColor(); + + InitLoggers(); // init logging facility. + + Logger.Info("mooege v{0} warming-up..", Assembly.GetExecutingAssembly().GetName().Version); + + if (!MPQStorage.Initialized) + { + Logger.Fatal("Cannot run servers as MPQStorage failed initialization."); + Console.ReadLine(); + return; + } + + Logger.Info("Item database loaded with a total of {0} item definitions.", ItemGenerator.TotalItems); + + Logger.Info("Achievement file parsed with a total of {0} achievements and {1} criteria in {2} categories.", + AchievementManager.TotalAchievements, AchievementManager.TotalCriteria, AchievementManager.TotalCategories); + + StartupServers(); + } + + private static void InitLoggers() + { + LogManager.Enabled = true; + + 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); + } + } + + private static void PrintBanner() + { + Console.WriteLine(@" _ __ ___ ___ ___ ___ __ _ ___ "); + Console.WriteLine(@" | '_ ` _ \ / _ \ / _ \ / _ \ / _` | / _ \"); + Console.WriteLine(@" | | | | | || (_) || (_) || __/| (_| || __/"); + Console.WriteLine(@" |_| |_| |_| \___/ \___/ \___| \__, | \___|"); + Console.WriteLine(@" |___/ "); + Console.WriteLine(); + } + + 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(); + } + + private static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e) + { + if (e.IsTerminating) + Logger.FatalException((e.ExceptionObject as Exception), "Mooege terminating because of unhandled exception."); + else + Logger.ErrorException((e.ExceptionObject as Exception), "Caught unhandled exception."); + Console.ReadLine(); + } + + #region server-control + + private static void StartupServers() + { + StartMooNet(); + StartGS(); + + if(Net.WebServices.Config.Instance.Enabled) + StartWebServices(); + + while (true) + { + 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 + } +} diff --git a/src/Mooege/Properties/AssemblyInfo.cs b/src/Mooege/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..0d7ea19f --- /dev/null +++ b/src/Mooege/Properties/AssemblyInfo.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.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")] +#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(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..b4361fd8 --- /dev/null +++ b/src/Mooege/app.config @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/tools/GameServer/GSPacketDumper/.gitignore b/src/tools/GameServer/GSPacketDumper/.gitignore new file mode 100644 index 00000000..e1bff5c1 --- /dev/null +++ b/src/tools/GameServer/GSPacketDumper/.gitignore @@ -0,0 +1,6 @@ +*.suo +bin/ +obj/ +*.user +*.cachefile +/*.pidb 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..cfcdbe64 --- /dev/null +++ b/src/tools/GameServer/GSPacketDumper/PacketReader.cs @@ -0,0 +1,111 @@ +/* + * 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.LogIncoming(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.LogOutgoing(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..2d78cb98 --- /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.Dump, Logger.Level.Dump, 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..898d376c --- /dev/null +++ b/src/tools/GameServer/MessageViewer/.gitignore @@ -0,0 +1,7 @@ + +*.manifest +*.pdb +*.exe +*.dll +bin/Debug/ +/obj/ 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..ebce212c --- /dev/null +++ b/src/tools/GameServer/MessageViewer/BufferNode.cs @@ -0,0 +1,400 @@ +/* + * 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 NotifyActorMovementMessage) + { + actorMap[(uint)(message as NotifyActorMovementMessage).ActorId].Nodes.Add(node.Clone()); + continue; + } + if (message is PlayerMovementMessage) + { + // 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) + if (!actorMap.ContainsKey((uint)(message as PlayerMovementMessage).ActorId)) + { + String hex = (message as PlayerMovementMessage).ActorId.ToString("X8"); + + if (!actors.ContainsKey(hex)) + { + TreeNode actorNode = new TreeNode(hex + " Capper"); + actorMap.Add((uint)(message as PlayerMovementMessage).ActorId, actorNode); + actorNode.Tag = hex; + actors.Add(hex, actorNode); + } + } + + actorMap[(uint)(message as PlayerMovementMessage).ActorId].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..623405f9 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/GameMessageViewer.csproj @@ -0,0 +1,162 @@ + + + + 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 + + + + + + + + + + + + AboutBox.cs + + + CustomLinqQuery.cs + + + Find.cs + + + MessageViewer.cs + + + MessageFilter.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + 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..5b4fd4e3 --- /dev/null +++ b/src/tools/GameServer/MessageViewer/MessageViewer.Loading.cs @@ -0,0 +1,498 @@ +/* + * 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.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"; + } + + + + //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 => GetVersion(x).Equals(Mooege.Common.Versions.VersionInfo.Ingame.VersionString)); + + if (correct.Count() == 1) + LoadDump(correct.First()); + else + { + if (gsStreams.Count() == 1) + LoadDump(gsStreams.First()); + else + { + if (DialogResult.Yes == MessageBox.Show("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)", "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, stream); + + 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..44774611 --- /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/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/.gitignore b/src/tools/GameServer/TypeExtractor/.gitignore new file mode 100644 index 00000000..87969337 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/.gitignore @@ -0,0 +1,3 @@ +/*.suo +/_ReSharper.D3Types/ +/*.6.0.ReSharper.user diff --git a/src/tools/GameServer/TypeExtractor/D3ClassGenerator/.gitignore b/src/tools/GameServer/TypeExtractor/D3ClassGenerator/.gitignore new file mode 100644 index 00000000..0f40b6f2 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3ClassGenerator/.gitignore @@ -0,0 +1,4 @@ +/bin/ +/obj/ +/*.csproj.user +/*.pidb 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/.gitignore b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/.gitignore new file mode 100644 index 00000000..0f40b6f2 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/.gitignore @@ -0,0 +1,4 @@ +/bin/ +/obj/ +/*.csproj.user +/*.pidb 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..7cb73c3c --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDescriptor/NetAttribute.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.Text; +using System.Xml.Linq; + +namespace D3TypeDescriptor +{ + + public enum NetAttributeEncoding + { + Int, + IntMinMax, + //FloatMinMax, + Float16, + Float16Or32, + } + + 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/.gitignore b/src/tools/GameServer/TypeExtractor/D3TypeDump/.gitignore new file mode 100644 index 00000000..0f40b6f2 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDump/.gitignore @@ -0,0 +1,4 @@ +/bin/ +/obj/ +/*.csproj.user +/*.pidb 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..7e889c3e --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/D3TypeDump/TypeDump.cs @@ -0,0 +1,322 @@ +/* + * 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 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 + + // TODO: Add patterns + + 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; + NetAttribute.Attributes[id] = new NetAttribute(id, u2, u3, u4, u5, scriptA, scriptB, name, NetAttributeEncoding.Int, 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..343d141a --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/attributes-output.cs @@ -0,0 +1,731 @@ +public partial class GameAttribute +{ + +public static readonly GameAttributeI Axe_Bad_Data = new GameAttributeI(0, 0, -1, 0, 0, "", "", "Axe_Bad_Data", GameAttributeEncoding.Int, 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, 350, 9); +public static readonly GameAttributeI Attack = new GameAttributeI(10, 0, -1, 0, 0, "", "((Attack.Agg + Stats_All_Bonus + Attack_Bonus) * (1 + Attack_Bonus_Percent)) * (1 - Attack_Reduction_Percent)", "Attack", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Precision = new GameAttributeI(11, 0, -1, 0, 0, "", "((Precision.Agg + Stats_All_Bonus + Precision_Bonus) * (1 + Precision_Bonus_Percent)) * (1 - Precision_Reduction_Percent)", "Precision", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Vitality = new GameAttributeI(12, 0, -1, 0, 0, "", "((Vitality.Agg + Stats_All_Bonus + Vitality_Bonus) * (1 + Vitality_Bonus_Percent)) * (1 - Vitality_Reduction_Percent)", "Vitality", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Defense = new GameAttributeI(13, 0, -1, 0, 0, "", "((Defense.Agg + Stats_All_Bonus + Defense_Bonus) * (1 + Defense_Bonus_Percent)) * (1 - Defense_Reduction_Percent)", "Defense", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeF Attack_Bonus = new GameAttributeF(14, 0, -1, 0, 0, "", "", "Attack_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Precision_Bonus = new GameAttributeF(15, 0, -1, 0, 0, "", "", "Precision_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Vitality_Bonus = new GameAttributeF(16, 0, -1, 0, 0, "", "", "Vitality_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Defense_Bonus = new GameAttributeF(17, 0, -1, 0, 0, "", "", "Defense_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attack_Bonus_Percent = new GameAttributeF(18, 0, -1, 0, 0, "", "", "Attack_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Precision_Bonus_Percent = new GameAttributeF(19, 0, -1, 0, 0, "", "", "Precision_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Vitality_Bonus_Percent = new GameAttributeF(20, 0, -1, 0, 0, "", "", "Vitality_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Defense_Bonus_Percent = new GameAttributeF(21, 0, -1, 0, 0, "", "", "Defense_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attack_Reduction_Percent = new GameAttributeF(22, 0, -1, 1, 0, "", "", "Attack_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Precision_Reduction_Percent = new GameAttributeF(23, 0, -1, 1, 0, "", "", "Precision_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Vitality_Reduction_Percent = new GameAttributeF(24, 0, -1, 1, 0, "", "", "Vitality_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Defense_Reduction_Percent = new GameAttributeF(25, 0, -1, 1, 0, "", "", "Defense_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Armor = new GameAttributeI(26, 0, -1, 0, 0, "", "", "Armor", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Armor_Bonus_Percent = new GameAttributeI(27, 0, -1, 0, 0, "", "", "Armor_Bonus_Percent", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Armor_Item = new GameAttributeI(28, 0, -1, 0, 0, "", "0", "Armor_Item", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Armor_Bonus_Item = new GameAttributeI(29, 0, -1, 0, 0, "", "", "Armor_Bonus_Item", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Armor_Item_Percent = new GameAttributeI(30, 0, -1, 0, 0, "", "0", "Armor_Item_Percent", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Armor_Item_SubTotal = new GameAttributeI(31, 0, -1, 0, 0, "FLOOR((Armor_Item + Armor_Bonus_Item) * (Armor_Item_Percent + 1))", "", "Armor_Item_SubTotal", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Armor_Item_Total = new GameAttributeI(32, 0, -1, 0, 0, "(Armor_Item > 0)?(Max(Armor_Item_SubTotal, 1)):Armor_Item_SubTotal", "", "Armor_Item_Total", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Armor_Total = new GameAttributeI(33, 0, -1, 0, 0, "", "FLOOR((Armor + Armor_Item_Total) * (Armor_Bonus_Percent + 1))", "Armor_Total", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Experience_Granted = new GameAttributeI(34, 0, -1, 0, 1, "", "", "Experience_Granted", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Experience_Next = new GameAttributeI(35, 0, -1, 0, 1, "", "", "Experience_Next", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Gold_Granted = new GameAttributeI(36, 0, -1, 0, 1, "", "", "Gold_Granted", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Gold = new GameAttributeI(37, 0, -1, 0, 1, "", "", "Gold", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeF Gold_Find = new GameAttributeF(38, 0, -1, 0, 0, "", "", "Gold_Find", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Level = new GameAttributeI(39, 0, -1, 0, 1, "", "", "Level", GameAttributeEncoding.IntMinMax, 31, -1, 127, 8); +public static readonly GameAttributeI Level_Cap = new GameAttributeI(40, 0, -1, 0, 1, "", "", "Level_Cap", GameAttributeEncoding.IntMinMax, 1, -1, 127, 8); +public static readonly GameAttributeF Magic_Find = new GameAttributeF(41, 0, -1, 0, 0, "", "", "Magic_Find", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Treasure_Find = new GameAttributeF(42, 0, 14, 0, 0, "", "", "Treasure_Find", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Resource_Cost_Reduction_Amount = new GameAttributeI(43, 0, 10, 0, 1, "", "", "Resource_Cost_Reduction_Amount", GameAttributeEncoding.IntMinMax, 9, -4095, 16383, 15); +public static readonly GameAttributeF Resource_Cost_Reduction_Total = new GameAttributeF(44, 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(45, 0, 10, 0, 0, "", "", "Resource_Set_Point_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Faster_Healing_Percent = new GameAttributeF(46, 0, -1, 0, 0, "", "", "Faster_Healing_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Spending_Resource_Heals_Percent = new GameAttributeF(47, 0, 10, 0, 0, "", "", "Spending_Resource_Heals_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Bonus_Healing_Received_Percent = new GameAttributeF(48, 0, -1, 0, 0, "", "", "Bonus_Healing_Received_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Reduced_Healing_Received_Percent = new GameAttributeF(49, 0, -1, 0, 0, "", "", "Reduced_Healing_Received_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Experience_Bonus = new GameAttributeF(50, 0, -1, 0, 0, "", "", "Experience_Bonus", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Experience_Bonus_Percent = new GameAttributeF(51, 0, -1, 0, 0, "", "", "Experience_Bonus_Percent", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Health_Globe_Bonus_Chance = new GameAttributeF(52, 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(53, 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(54, 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(55, 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(56, 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(57, 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(58, 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(59, 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(60, 0, -1, 0, 0, "", "", "Mana_Gained_From_Globes", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance = new GameAttributeF(61, 0, 0, 0, 0, "", "", "Resistance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Percent = new GameAttributeF(62, 0, 0, 0, 0, "", "", "Resistance_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Total = new GameAttributeF(63, 0, 0, 0, 0, "", "(Resistance + Resistance_All#NONE) * ((Resistance_Percent_All#NONE + Resistance_Percent + 1))", "Resistance_Total", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Resistance_All = new GameAttributeF(64, 0, -1, 0, 0, "", "", "Resistance_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Percent_All = new GameAttributeF(65, 0, -1, 0, 0, "", "", "Resistance_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Skill = new GameAttributeI(66, 0, 4, 0, 1, "", "", "Skill", GameAttributeEncoding.IntMinMax, 9, 0, 4095, 12); +public static readonly GameAttributeI Skill_Total = new GameAttributeI(67, 0, 4, 0, 1, "", "Skill", "Skill_Total", GameAttributeEncoding.IntMinMax, 9, 0, 4095, 12); +public static readonly GameAttributeI TeamID = new GameAttributeI(68, -1, -1, 1, 1, "", "", "TeamID", GameAttributeEncoding.IntMinMax, 31, -1, 23, 5); +public static readonly GameAttributeI Team_Override = new GameAttributeI(69, -1, -1, 1, 1, "", "", "Team_Override", GameAttributeEncoding.IntMinMax, 31, -1, 23, 5); +public static readonly GameAttributeB Invulnerable = new GameAttributeB(70, 0, -1, 1, 1, "", "", "Invulnerable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Loading = new GameAttributeB(71, 0, -1, 1, 1, "", "", "Loading", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Loading_Player_ACD = new GameAttributeI(72, -1, -1, 3, 1, "", "", "Loading_Player_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Loading_Power_SNO = new GameAttributeI(73, -1, -1, 3, 1, "", "", "Loading_Power_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Loading_Anim_Tag = new GameAttributeI(74, -1, -1, 3, 1, "", "", "Loading_Anim_Tag", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeB Loading_NewGame = new GameAttributeB(75, 0, -1, 1, 1, "", "", "Loading_NewGame", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB No_Damage = new GameAttributeB(76, 0, -1, 1, 1, "", "", "No_Damage", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB No_AutoPickup = new GameAttributeB(77, 0, -1, 1, 1, "", "", "No_AutoPickup", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF Light_Radius_Percent_Bonus = new GameAttributeF(78, 0, 0, 0, 0, "", "", "Light_Radius_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Hitpoints_Cur = new GameAttributeF(79, 0, -1, 0, 0, "", "Min(Hitpoints_Cur.Agg, Hitpoints_Max_Total)", "Hitpoints_Cur", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Factor_Level = new GameAttributeF(80, 0, -1, 0, 0, "", "", "Hitpoints_Factor_Level", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Factor_Vitality = new GameAttributeF(81, 0, -1, 0, 0, "", "", "Hitpoints_Factor_Vitality", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Total_From_Vitality = new GameAttributeF(82, 0, -1, 0, 0, "", "Vitality * Hitpoints_Factor_Vitality", "Hitpoints_Total_From_Vitality", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Total_From_Level = new GameAttributeF(83, 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(84, 0, -1, 0, 0, "", "", "Hitpoints_Granted", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeI Hitpoints_Granted_Duration = new GameAttributeI(85, 0, -1, 0, 1, "", "", "Hitpoints_Granted_Duration", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeF Hitpoints_Max = new GameAttributeF(86, 0, -1, 0, 0, "", "", "Hitpoints_Max", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Max_Bonus = new GameAttributeF(87, 0, -1, 0, 0, "", "", "Hitpoints_Max_Bonus", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Max_Total = new GameAttributeF(88, 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.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Percent = new GameAttributeF(89, 0, -1, 0, 0, "", "", "Hitpoints_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF Hitpoints_Regen_Per_Second = new GameAttributeF(90, 0, -1, 0, 0, "", "", "Hitpoints_Regen_Per_Second", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_Max_Percent_Bonus = new GameAttributeF(91, 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(92, 0, -1, 0, 0, "", "", "Hitpoints_Max_Percent_Bonus_Item", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF Hitpoints_Healed_Target = new GameAttributeF(93, 0, -1, 0, 0, "", "", "Hitpoints_Healed_Target", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeI Resource_Type_Primary = new GameAttributeI(94, -1, -1, 3, 1, "", "", "Resource_Type_Primary", GameAttributeEncoding.IntMinMax, 1, -1, 7, 4); +public static readonly GameAttributeI Resource_Type_Secondary = new GameAttributeI(95, -1, -1, 3, 1, "", "", "Resource_Type_Secondary", GameAttributeEncoding.IntMinMax, 1, -1, 7, 4); +public static readonly GameAttributeI Resource_Cur = new GameAttributeI(96, 0, 10, 0, 0, "", "Max(Resource_Cur.Agg, 0)", "Resource_Cur", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeF Resource_Max = new GameAttributeF(97, 0, 10, 0, 0, "", "", "Resource_Max", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Resource_Max_Bonus = new GameAttributeF(98, 0, 10, 0, 0, "", "", "Resource_Max_Bonus", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeI Resource_Max_Total = new GameAttributeI(99, 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.Int, 9, 0, 0, 32); +public static readonly GameAttributeF Resource_Factor_Level = new GameAttributeF(100, 0, 10, 0, 0, "", "", "Resource_Factor_Level", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Resource_Granted = new GameAttributeF(101, 0, 10, 0, 0, "", "", "Resource_Granted", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeI Resource_Granted_Duration = new GameAttributeI(102, 0, 10, 0, 1, "", "", "Resource_Granted_Duration", GameAttributeEncoding.IntMinMax, 9, 0, 16777215, 24); +public static readonly GameAttributeF Resource_Percent = new GameAttributeF(103, 0, 10, 0, 0, "", "", "Resource_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resource_Regen_Per_Second = new GameAttributeF(104, 0, 10, 0, 0, "", "", "Resource_Regen_Per_Second", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Resource_Regen_Bonus_Percent = new GameAttributeF(105, 0, 10, 0, 0, "", "", "Resource_Regen_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resource_Regen_Total = new GameAttributeF(106, 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(107, 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(108, 0, 10, 0, 0, "", "", "Resource_Capacity_Used", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Resource_Effective_Max = new GameAttributeF(109, 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(110, 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(111, 0, 10, 0, 0, "", "", "Resource_Degeneration_Stop_Point", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Movement_Scalar = new GameAttributeF(112, 0, -1, 0, 0, "", "", "Movement_Scalar", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Walking_Rate = new GameAttributeF(113, 0, -1, 0, 0, "", "", "Walking_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Running_Rate = new GameAttributeF(114, 0, -1, 0, 0, "", "", "Running_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Sprinting_Rate = new GameAttributeF(115, 0, -1, 0, 0, "", "", "Sprinting_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Strafing_Rate = new GameAttributeF(116, 0, -1, 0, 0, "", "", "Strafing_Rate", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Walking_Rate_Total = new GameAttributeF(117, 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(118, 0, -1, 0, 0, "", "Running_Rate * Movement_Scalar_Total", "Running_Rate_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Sprinting_Rate_Total = new GameAttributeF(119, 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(120, 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(121, 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(122, 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(123, 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(124, 0, -1, 0, 0, "", "", "Movement_Scalar_Uncapped_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Movement_Scalar_Total = new GameAttributeF(125, 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(126, 0, -1, 1, 0, "", "", "Movement_Bonus_Run_Speed", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Casting_Speed = new GameAttributeF(127, 0, -1, 0, 0, "", "", "Casting_Speed", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Casting_Speed_Bonus = new GameAttributeF(128, 0, -1, 0, 0, "", "", "Casting_Speed_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Casting_Speed_Total = new GameAttributeF(129, 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(130, 0, -1, 1, 1, "", "", "Always_Hits", GameAttributeEncoding.IntMinMax, 3, 0, 1, 1); +public static readonly GameAttributeF Hit_Chance = new GameAttributeF(131, 0, -1, 0, 0, "", "", "Hit_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attacks_Per_Second_Item = new GameAttributeF(132, 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(133, 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(134, 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(135, 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(136, 0, -1, 0, 0, "(Attacks_Per_Second_Item_Subtotal + Attacks_Per_Second_Item_Bonus)", "", "Attacks_Per_Second_Item_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attacks_Per_Second = new GameAttributeF(137, 0, -1, 0, 0, "0", "", "Attacks_Per_Second", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attacks_Per_Second_Bonus = new GameAttributeF(138, 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(139, 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.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Attacks_Per_Second_Percent = new GameAttributeF(140, 0, -1, 0, 0, "", "", "Attacks_Per_Second_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF AI_Cooldown_Reduction_Percent = new GameAttributeF(141, 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(142, 0, -1, 0, 0, "0", "", "Power_Cooldown_Reduction_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Damage_Delta = new GameAttributeF(143, 0, 0, 0, 0, "", "", "Damage_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Delta_Total = new GameAttributeF(144, 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(145, 0, 0, 0, 0, "", "", "Damage_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Bonus_Min = new GameAttributeF(146, 0, 0, 0, 0, "", "", "Damage_Bonus_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Min_Total = new GameAttributeF(147, 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(148, 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(149, 0, -1, 0, 0, "", "", "Damage_Percent_All_From_Skills", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Weapon_Delta = new GameAttributeF(150, 0, 0, 0, 0, "", "", "Damage_Weapon_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Delta_SubTotal = new GameAttributeF(151, 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(152, 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(153, 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_Delta_Total = new GameAttributeF(154, 0, 0, 0, 0, "Max((Damage_Weapon_Delta_SubTotal + Damage_Weapon_Bonus_Delta) * (1 + Damage_Weapon_Percent_Total), 0)", "", "Damage_Weapon_Delta_Total", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Delta_Total_All = new GameAttributeF(155, 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.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Bonus_Delta = new GameAttributeF(156, 0, 0, 0, 0, "", "", "Damage_Weapon_Bonus_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Min = new GameAttributeF(157, 0, 0, 0, 0, "", "", "Damage_Weapon_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Min_Total = new GameAttributeF(158, 0, 0, 0, 0, "(Damage_Weapon_Min + Damage_Weapon_Bonus_Min) * (1 + Damage_Weapon_Percent_Total)", "", "Damage_Weapon_Min_Total", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Min_Total_All = new GameAttributeF(159, 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.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Bonus_Min = new GameAttributeF(160, 0, 0, 0, 0, "", "", "Damage_Weapon_Bonus_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Weapon_Percent_Bonus = new GameAttributeF(161, 0, 0, 0, 0, "", "", "Damage_Weapon_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Weapon_Percent_All = new GameAttributeF(162, 0, -1, 0, 0, "", "", "Damage_Weapon_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Weapon_Percent_Total = new GameAttributeF(163, 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(164, 0, 0, 0, 0, "", "", "Damage_Type_Percent_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Percent_Bonus_Witchdoctor = new GameAttributeF(165, 0, -1, 0, 0, "", "", "Damage_Percent_Bonus_Witchdoctor", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Percent_Bonus_Wizard = new GameAttributeF(166, 0, -1, 0, 0, "", "", "Damage_Percent_Bonus_Wizard", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Crit_Percent_Base = new GameAttributeI(167, 0, -1, 0, 0, "", "", "Crit_Percent_Base", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Crit_Percent_Bonus_Capped = new GameAttributeI(168, 0, -1, 0, 0, "", "", "Crit_Percent_Bonus_Capped", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Crit_Percent_Bonus_Uncapped = new GameAttributeI(169, 0, -1, 0, 0, "", "", "Crit_Percent_Bonus_Uncapped", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Crit_Percent_Cap = new GameAttributeI(170, 0, -1, 0, 0, "", "", "Crit_Percent_Cap", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Crit_Damage_Percent = new GameAttributeI(171, 0, -1, 0, 0, "", "", "Crit_Damage_Percent", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Crit_Effect_Time = new GameAttributeI(172, 0, -1, 3, 1, "", "", "Crit_Effect_Time", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeF Pierce_Chance = new GameAttributeF(173, 0, -1, 0, 0, "", "", "Pierce_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Absorb_Percent = new GameAttributeF(174, 0, -1, 0, 0, "", "", "Damage_Absorb_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Reduction_Total = new GameAttributeF(175, 0, 0, 0, 0, "", "", "Damage_Reduction_Total", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Reduction_Current = new GameAttributeF(176, 0, 0, 0, 0, "", "", "Damage_Reduction_Current", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeI Damage_Reduction_Last_Tick = new GameAttributeI(177, 0, 0, 3, 1, "", "", "Damage_Reduction_Last_Tick", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeF Block_Chance = new GameAttributeF(178, 0, -1, 0, 0, "", "", "Block_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Block_Chance_Total = new GameAttributeF(179, 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(180, 0, -1, 0, 0, "", "", "Block_Chance_Bonus_Item", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Block_Chance_Item = new GameAttributeF(181, 0, -1, 0, 0, "", "0", "Block_Chance_Item", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Block_Chance_Item_Total = new GameAttributeF(182, 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(183, 0, -1, 0, 0, "", "", "Block_Amount", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Block_Amount_Bonus_Percent = new GameAttributeF(184, 0, -1, 0, 0, "", "", "Block_Amount_Bonus_Percent", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Block_Amount_Total_Min = new GameAttributeF(185, 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(186, 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(187, 0, -1, 0, 0, "", "", "Block_Amount_Item_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Block_Amount_Item_Delta = new GameAttributeF(188, 0, -1, 0, 0, "", "", "Block_Amount_Item_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Block_Amount_Item_Bonus = new GameAttributeF(189, 0, -1, 0, 0, "", "", "Block_Amount_Item_Bonus", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Dodge_Rating_Base = new GameAttributeF(190, 0, -1, 0, 0, "", "", "Dodge_Rating_Base", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Dodge_Rating = new GameAttributeF(191, 0, -1, 0, 0, "", "", "Dodge_Rating", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Dodge_Rating_Total = new GameAttributeF(192, 0, -1, 0, 0, "", "Dodge_Rating_Base + Dodge_Rating", "Dodge_Rating_Total", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Dodge_Chance_Bonus = new GameAttributeF(193, 0, -1, 7, 0, "", "", "Dodge_Chance_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Dodge_Chance_Bonus_Melee = new GameAttributeF(194, 0, -1, 7, 0, "", "", "Dodge_Chance_Bonus_Melee", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Dodge_Chance_Bonus_Ranged = new GameAttributeF(195, 0, -1, 7, 0, "", "", "Dodge_Chance_Bonus_Ranged", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Get_Hit_Current = new GameAttributeF(196, 0, -1, 0, 0, "", "", "Get_Hit_Current", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Get_Hit_Max_Base = new GameAttributeF(197, 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(198, 0, -1, 0, 0, "", "", "Get_Hit_Max_Per_Level", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Get_Hit_Max = new GameAttributeF(199, 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(200, 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(201, 0, -1, 0, 0, "", "", "Get_Hit_Recovery_Per_Level", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Get_Hit_Recovery = new GameAttributeF(202, 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(203, 0, -1, 0, 0, "", "", "Get_Hit_Damage", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Get_Hit_Damage_Scalar = new GameAttributeF(204, 0, -1, 0, 0, "", "", "Get_Hit_Damage_Scalar", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeI Last_Damage_MainActor = new GameAttributeI(205, -1, -1, 3, 1, "", "", "Last_Damage_MainActor", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Last_ACD_Attacked = new GameAttributeI(206, -1, -1, 3, 1, "", "", "Last_ACD_Attacked", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeB Ignores_Critical_Hits = new GameAttributeB(207, 0, -1, 1, 1, "", "", "Ignores_Critical_Hits", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Immunity = new GameAttributeB(208, 0, -1, 1, 1, "", "", "Immunity", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Untargetable = new GameAttributeB(209, 0, -1, 1, 1, "", "", "Untargetable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Immobolize = new GameAttributeB(210, 0, -1, 1, 1, "", "", "Immobolize", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); +public static readonly GameAttributeB Immune_To_Knockback = new GameAttributeB(211, 0, -1, 1, 1, "", "", "Immune_To_Knockback", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Power_Immobilize = new GameAttributeB(212, 0, -1, 1, 1, "", "", "Power_Immobilize", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF Stun_Chance = new GameAttributeF(213, 0, -1, 0, 0, "", "", "Stun_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Stun_Length = new GameAttributeF(214, 0, -1, 0, 0, "", "", "Stun_Length", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Stun_Recovery = new GameAttributeF(215, 0, -1, 0, 0, "", "", "Stun_Recovery", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Stun_Recovery_Speed = new GameAttributeF(216, 0, -1, 0, 0, "", "", "Stun_Recovery_Speed", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeB Stunned = new GameAttributeB(217, 0, -1, 1, 1, "", "", "Stunned", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Stun_Immune = new GameAttributeB(218, 0, -1, 1, 1, "", "", "Stun_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF Poison_Length_Reduction = new GameAttributeF(219, 0, -1, 0, 0, "", "", "Poison_Length_Reduction", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeB Poisoned = new GameAttributeB(220, 0, -1, 1, 1, "", "", "Poisoned", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Bleeding = new GameAttributeB(221, 0, -1, 1, 1, "", "", "Bleeding", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeF Bleed_Duration = new GameAttributeF(222, 0, -1, 0, 0, "", "", "Bleed_Duration", GameAttributeEncoding.Float16, 1, 0, 0, 16); +public static readonly GameAttributeB Chilled = new GameAttributeB(223, 0, -1, 1, 1, "", "", "Chilled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeF Freeze_Length_Reduction = new GameAttributeF(224, 0, -1, 0, 0, "", "", "Freeze_Length_Reduction", GameAttributeEncoding.Float16, 1, 0, 0, 16); +public static readonly GameAttributeB Freeze_Immune = new GameAttributeB(225, 0, -1, 1, 1, "", "", "Freeze_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Webbed = new GameAttributeB(226, 0, -1, 1, 1, "", "", "Webbed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Slow = new GameAttributeB(227, 0, -1, 1, 1, "", "", "Slow", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB FireAura = new GameAttributeB(228, 0, -1, 1, 1, "", "", "FireAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB LightningAura = new GameAttributeB(229, 0, -1, 1, 1, "", "", "LightningAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB ColdAura = new GameAttributeB(230, 0, -1, 1, 1, "", "", "ColdAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB PoisonAura = new GameAttributeB(231, 0, -1, 1, 1, "", "", "PoisonAura", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Blind = new GameAttributeB(232, 0, -1, 1, 1, "", "", "Blind", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Enraged = new GameAttributeB(233, 0, -1, 1, 1, "", "", "Enraged", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Slowdown_Immune = new GameAttributeB(234, 0, -1, 1, 1, "", "", "Slowdown_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Gethit_Immune = new GameAttributeB(235, 0, -1, 1, 1, "", "", "Gethit_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF Suffocation_Per_Second = new GameAttributeF(236, 0, -1, 0, 0, "", "", "Suffocation_Per_Second", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Suffocation_Unit_Value = new GameAttributeF(237, 0, -1, 1, 0, "", "", "Suffocation_Unit_Value", GameAttributeEncoding.Float16Or32, 1, 0, 0, 0); +public static readonly GameAttributeF Thorns_Percent = new GameAttributeF(238, 0, 0, 0, 0, "", "", "Thorns_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Thorns_Percent_All = new GameAttributeF(239, 0, -1, 0, 0, "", "", "Thorns_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Thorns_Percent_Total = new GameAttributeF(240, 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(241, 0, 0, 0, 0, "", "", "Thorns_Fixed", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Steal_Health_Percent = new GameAttributeF(242, 0, -1, 0, 0, "", "", "Steal_Health_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Steal_Mana_Percent = new GameAttributeF(243, 0, -1, 0, 0, "", "", "Steal_Mana_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resource_On_Hit = new GameAttributeF(244, 0, 10, 0, 0, "", "", "Resource_On_Hit", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Resource_On_Kill = new GameAttributeF(245, 0, 10, 0, 0, "", "", "Resource_On_Kill", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Resource_On_Crit = new GameAttributeF(246, 0, 10, 0, 0, "", "", "Resource_On_Crit", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_On_Hit = new GameAttributeF(247, 0, -1, 0, 0, "", "", "Hitpoints_On_Hit", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Hitpoints_On_Kill = new GameAttributeF(248, 0, -1, 0, 0, "", "", "Hitpoints_On_Kill", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_To_Mana = new GameAttributeF(249, 0, -1, 0, 0, "", "", "Damage_To_Mana", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeI Last_Proc_Time = new GameAttributeI(250, 0, -1, 3, 1, "", "", "Last_Proc_Time", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeF Damage_Power_Delta = new GameAttributeF(251, 0, 0, 0, 0, "", "", "Damage_Power_Delta", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeF Damage_Power_Min = new GameAttributeF(252, 0, 0, 0, 0, "", "", "Damage_Power_Min", GameAttributeEncoding.Float16Or32, 9, 0, 0, 0); +public static readonly GameAttributeI Rope_Overlay = new GameAttributeI(253, -1, -1, 3, 1, "", "", "Rope_Overlay", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI General_Cooldown = new GameAttributeI(254, -1, -1, 3, 1, "", "", "General_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Power_Cooldown = new GameAttributeI(255, -1, 4, 1, 1, "", "", "Power_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Power_Cooldown_Start = new GameAttributeI(256, -1, 4, 1, 1, "", "", "Power_Cooldown_Start", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Proc_Cooldown = new GameAttributeI(257, 0, 8, 1, 1, "", "", "Proc_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Emote_Cooldown = new GameAttributeI(258, 0, -1, 1, 1, "", "", "Emote_Cooldown", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeF Projectile_Speed = new GameAttributeF(259, 0, -1, 0, 0, "", "", "Projectile_Speed", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF Projectile_Speed_Increase_Percent = new GameAttributeF(260, 0, -1, 0, 0, "", "", "Projectile_Speed_Increase_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeB Destroy_When_Path_Blocked = new GameAttributeB(261, 0, -1, 1, 1, "", "", "Destroy When Path Blocked", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Skill_Toggled_State = new GameAttributeB(262, 0, 4, 1, 1, "", "", "Skill_Toggled_State", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); +public static readonly GameAttributeI Act = new GameAttributeI(263, -1, -1, 3, 1, "", "", "Act", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Difficulty = new GameAttributeI(264, -1, -1, 3, 1, "", "", "Difficulty", GameAttributeEncoding.IntMinMax, 9, -1, 4, 3); +public static readonly GameAttributeF Last_Damage_Amount = new GameAttributeF(265, -1, -1, 3, 0, "", "", "Last_Damage_Amount", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); +public static readonly GameAttributeB In_Knockback = new GameAttributeB(266, 0, -1, 1, 1, "", "", "In_Knockback", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF Amplify_Damage_Type_Percent = new GameAttributeF(267, 0, 0, 0, 0, "", "", "Amplify_Damage_Type_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Amplify_Damage_Percent = new GameAttributeF(268, 0, -1, 0, 0, "", "", "Amplify_Damage_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Durability_Cur = new GameAttributeI(269, 0, -1, 0, 1, "", "", "Durability_Cur", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI Durability_Max = new GameAttributeI(270, 0, -1, 0, 1, "", "", "Durability_Max", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI Durability_Last_Damage = new GameAttributeI(271, 0, -1, 0, 1, "", "", "Durability_Last_Damage", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Item_Quality_Level = new GameAttributeI(272, -1, -1, 1, 1, "", "", "Item_Quality_Level", GameAttributeEncoding.IntMinMax, 8, -1, 11, 4); +public static readonly GameAttributeF Item_Cost_Percent_Bonus = new GameAttributeF(273, 0, -1, 0, 0, "", "", "Item_Cost_Percent_Bonus", GameAttributeEncoding.Float16, 8, 0, 0, 16); +public static readonly GameAttributeB Item_Equipped = new GameAttributeB(274, 0, -1, 1, 1, "", "", "Item_Equipped", GameAttributeEncoding.IntMinMax, 8, 0, 1, 1); +public static readonly GameAttributeF Requirement = new GameAttributeF(275, 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(276, 0, -1, 0, 0, "", "0", "Requirements_Ease_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Requirement_When_Equipped = new GameAttributeF(277, 0, 1, 1, 0, "", "", "Requirement_When_Equipped", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Sockets = new GameAttributeI(278, 0, -1, 0, 1, "", "0", "Sockets", GameAttributeEncoding.IntMinMax, 8, 0, 3, 2); +public static readonly GameAttributeI Sockets_Filled = new GameAttributeI(279, 0, -1, 0, 1, "", "0", "Sockets_Filled", GameAttributeEncoding.IntMinMax, 8, 0, 3, 2); +public static readonly GameAttributeF Stats_All_Bonus = new GameAttributeF(280, 0, -1, 0, 0, "", "", "Stats_All_Bonus", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Item_Bound_To_ACD = new GameAttributeI(281, -1, -1, 3, 1, "", "0", "Item_Bound_To_ACD", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI Item_Binding_Level_Override = new GameAttributeI(282, 0, -1, 1, 1, "", "0", "Item_Binding_Level_Override", GameAttributeEncoding.IntMinMax, 8, 0, 5, 3); +public static readonly GameAttributeI ItemStackQuantityHi = new GameAttributeI(283, 0, -1, 4, 1, "", "", "ItemStackQuantityHi", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI ItemStackQuantityLo = new GameAttributeI(284, 0, -1, 4, 1, "", "", "ItemStackQuantityLo", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeF Run_Speed_Granted = new GameAttributeF(285, 0, -1, 0, 0, "", "", "Run_Speed_Granted", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Run_Speed_Duration = new GameAttributeI(286, 0, -1, 0, 1, "", "", "Run_Speed_Duration", GameAttributeEncoding.IntMinMax, 9, 0, 16777215, 24); +public static readonly GameAttributeI IdentifyCost = new GameAttributeI(287, 0, -1, 0, 1, "", "", "IdentifyCost", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI Seed = new GameAttributeI(288, 0, -1, 4, 1, "", "0", "Seed", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeB IsCrafted = new GameAttributeB(289, 0, -1, 4, 1, "", "0", "IsCrafted", GameAttributeEncoding.IntMinMax, 8, 0, 1, 1); +public static readonly GameAttributeI DyeType = new GameAttributeI(290, 0, -1, 1, 1, "", "0", "DyeType", GameAttributeEncoding.IntMinMax, 8, -1, 30, 5); +public static readonly GameAttributeI SocketAffix = new GameAttributeI(291, -1, -1, 3, 1, "", "0", "SocketAffix", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI EnchantAffix = new GameAttributeI(292, -1, -1, 3, 1, "", "0", "EnchantAffix", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI HighlySalvageable = new GameAttributeI(293, 0, -1, 1, 1, "", "0", "HighlySalvageable", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI ItemUnlockTimeHi = new GameAttributeI(294, 0, -1, 4, 1, "", "", "ItemUnlockTimeHi", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI ItemUnlockTimeLo = new GameAttributeI(295, 0, -1, 4, 1, "", "", "ItemUnlockTimeLo", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeB Always_Plays_GetHit = new GameAttributeB(296, 0, -1, 1, 1, "", "", "Always_Plays_GetHit", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Hidden = new GameAttributeB(297, 0, -1, 1, 1, "", "", "Hidden", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI RActor_Fade_Group = new GameAttributeI(298, -1, -1, 1, 1, "", "", "RActor_Fade_Group", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Quest_Range = new GameAttributeI(299, -1, -1, 3, 1, "", "", "Quest Range", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Attack_Cooldown_Min = new GameAttributeI(300, 0, -1, 0, 1, "", "", "Attack_Cooldown_Min", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI Attack_Cooldown_Delta = new GameAttributeI(301, 0, -1, 0, 1, "", "", "Attack_Cooldown_Delta", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI InitialCooldownMinTotal = new GameAttributeI(302, 0, -1, 0, 1, "", "InitialCooldownMin / Attacks_Per_Second_Total", "InitialCooldownMinTotal", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI InitialCooldownDeltaTotal = new GameAttributeI(303, 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(304, 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(305, 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(306, 0, -1, 0, 1, "", "", "Closing_Cooldown_Min_Total", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI Closing_Cooldown_Delta_Total = new GameAttributeI(307, 0, -1, 0, 1, "", "", "Closing_Cooldown_Delta_Total", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeB Quest_Monster = new GameAttributeB(308, 0, -1, 0, 1, "", "", "Quest_Monster", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Quest_Monster_Effect = new GameAttributeI(309, -1, -1, 3, 1, "", "", "Quest_Monster Effect", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Treasure_Class = new GameAttributeI(310, -1, -1, 3, 1, "", "", "Treasure_Class", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Removes_Body_On_Death = new GameAttributeB(311, 0, -1, 1, 1, "", "", "Removes_Body_On_Death", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI InitialCooldownMin = new GameAttributeI(312, 0, -1, 0, 1, "", "", "InitialCooldownMin", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI InitialCooldownDelta = new GameAttributeI(313, 0, -1, 0, 1, "", "", "InitialCooldownDelta", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeF Knockback_Weight = new GameAttributeF(314, 0, -1, 0, 0, "", "", "Knockback_Weight", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeB UntargetableByPets = new GameAttributeB(315, 0, -1, 1, 1, "", "", "UntargetableByPets", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Damage_State_Current = new GameAttributeI(316, 0, -1, 0, 1, "", "", "Damage_State_Current", GameAttributeEncoding.IntMinMax, 31, 0, 15, 4); +public static readonly GameAttributeI Damage_State_Max = new GameAttributeI(317, 0, -1, 0, 1, "", "", "Damage_State_Max", GameAttributeEncoding.IntMinMax, 31, 0, 15, 4); +public static readonly GameAttributeB Is_Player_Decoy = new GameAttributeB(318, 0, -1, 1, 1, "", "", "Is_Player_Decoy", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeF Custom_Target_Weight = new GameAttributeF(319, 0, 3, 0, 0, "", "", "Custom_Target_Weight", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Gizmo_State = new GameAttributeI(320, -1, -1, 3, 1, "", "", "Gizmo_State", GameAttributeEncoding.IntMinMax, 4, -1, 30, 5); +public static readonly GameAttributeI Gizmo_Charges = new GameAttributeI(321, 0, -1, 1, 1, "", "", "Gizmo_Charges", GameAttributeEncoding.IntMinMax, 4, -1, 30, 5); +public static readonly GameAttributeB Chest_Open = new GameAttributeB(322, 0, 3, 0, 1, "", "", "Chest_Open", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); +public static readonly GameAttributeB Door_Locked = new GameAttributeB(323, 0, -1, 1, 1, "", "", "Door_Locked", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); +public static readonly GameAttributeI Door_Timer = new GameAttributeI(324, -1, -1, 3, 1, "", "", "Door_Timer", GameAttributeEncoding.Int, 4, 0, 0, 32); +public static readonly GameAttributeB Gizmo_Disabled_By_Script = new GameAttributeB(325, 0, -1, 1, 1, "", "", "Gizmo_Disabled_By_Script", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); +public static readonly GameAttributeI Gizmo_Operator_ACDID = new GameAttributeI(326, -1, -1, 3, 1, "", "", "Gizmo_Operator_ACDID", GameAttributeEncoding.Int, 4, 0, 0, 32); +public static readonly GameAttributeI Triggering_Count = new GameAttributeI(327, 0, -1, 0, 1, "", "", "Triggering_Count", GameAttributeEncoding.Int, 4, 0, 0, 32); +public static readonly GameAttributeI Last_Altar_ANN = new GameAttributeI(328, -1, -1, 3, 1, "", "", "Last_Altar_ANN", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeB New_Skill_Since_Last_Altar = new GameAttributeB(329, 0, 3, 0, 1, "", "", "New_Skill_Since_Last_Altar", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); +public static readonly GameAttributeF Gate_Position = new GameAttributeF(330, 0, -1, 0, 0, "", "", "Gate_Position", GameAttributeEncoding.Float16, 4, 0, 0, 16); +public static readonly GameAttributeF Gate_Velocity = new GameAttributeF(331, 0, -1, 0, 0, "", "", "Gate_Velocity", GameAttributeEncoding.Float16, 4, 0, 0, 16); +public static readonly GameAttributeB Gizmo_Has_Been_Operated = new GameAttributeB(332, 0, -1, 1, 1, "", "", "Gizmo_Has_Been_Operated", GameAttributeEncoding.IntMinMax, 4, 0, 1, 1); +public static readonly GameAttributeI Pet_Owner = new GameAttributeI(333, -1, -1, 3, 1, "", "", "Pet_Owner", GameAttributeEncoding.IntMinMax, 31, -1, 8, 4); +public static readonly GameAttributeI Pet_Creator = new GameAttributeI(334, -1, -1, 3, 1, "", "", "Pet_Creator", GameAttributeEncoding.IntMinMax, 31, -1, 8, 4); +public static readonly GameAttributeI Pet_Type = new GameAttributeI(335, -1, -1, 3, 1, "", "", "Pet_Type", GameAttributeEncoding.IntMinMax, 31, -1, 24, 5); +public static readonly GameAttributeB DropsNoLoot = new GameAttributeB(336, 0, -1, 1, 1, "", "", "DropsNoLoot", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB GrantsNoXP = new GameAttributeB(337, 0, -1, 1, 1, "", "", "GrantsNoXP", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Hireling_Class = new GameAttributeI(338, 0, -1, 1, 1, "", "", "Hireling_Class", GameAttributeEncoding.IntMinMax, 31, 0, 4, 3); +public static readonly GameAttributeI Summoned_By_SNO = new GameAttributeI(339, -1, -1, 3, 1, "", "", "Summoned_By_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Is_NPC = new GameAttributeB(340, 0, -1, 1, 1, "", "", "Is_NPC", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB NPC_Is_Operatable = new GameAttributeB(341, 0, -1, 1, 1, "", "", "NPC_Is_Operatable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB NPC_Is_Escorting = new GameAttributeB(342, 0, -1, 1, 1, "", "", "NPC_Is_Escorting", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB NPC_Has_Interact_Options = new GameAttributeB(343, 0, 12, 1, 1, "", "", "NPC_Has_Interact_Options", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Conversation_Icon = new GameAttributeI(344, -1, 12, 3, 1, "", "", "Conversation_Icon", GameAttributeEncoding.IntMinMax, 31, -1, 6, 3); +public static readonly GameAttributeI Callout_Cooldown = new GameAttributeI(345, -1, 16, 1, 1, "", "", "Callout_Cooldown", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Banter_Cooldown = new GameAttributeI(346, -1, 16, 1, 1, "", "", "Banter_Cooldown", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Conversation_Heard_Count = new GameAttributeI(347, 0, 16, 1, 1, "", "", "Conversation_Heard_Count", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Last_Tick_Shop_Entered = new GameAttributeI(348, -1, -1, 3, 1, "", "", "Last_Tick_Shop_Entered", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Is_Helper = new GameAttributeB(349, 0, -1, 1, 1, "", "", "Is_Helper", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Axe = new GameAttributeI(350, 0, -1, 0, 0, "", "", "Axe", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Axe2H = new GameAttributeI(351, 0, -1, 0, 0, "", "", "Axe2H", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI ThrowingAxe = new GameAttributeI(352, 0, -1, 0, 0, "", "", "ThrowingAxe", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI AxeAny = new GameAttributeI(353, 0, -1, 0, 0, "Pin(Axe + Axe2H + ThrowingAxe, 0, 1)", "Pin(Axe + Axe2H + ThrowingAxe, 0, 1)", "AxeAny", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Bow = new GameAttributeI(354, 0, -1, 0, 0, "", "", "Bow", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Crossbow = new GameAttributeI(355, 0, -1, 0, 0, "", "", "Crossbow", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI BowAny = new GameAttributeI(356, 0, -1, 0, 0, "Pin(Bow + Crossbow, 0, 1)", "Pin(Bow + Crossbow, 0, 1)", "BowAny", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Club = new GameAttributeI(357, 0, -1, 0, 0, "", "", "Club", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Club2H = new GameAttributeI(358, 0, -1, 0, 0, "", "", "Club2H", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI ClubAny = new GameAttributeI(359, 0, -1, 0, 0, "Pin(Club + Club2H, 0, 1)", "Pin(Club + Club2H, 0, 1)", "ClubAny", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Dagger = new GameAttributeI(360, 0, -1, 0, 0, "", "", "Dagger", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Mace = new GameAttributeI(361, 0, -1, 0, 0, "", "", "Mace", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Mace2H = new GameAttributeI(362, 0, -1, 0, 0, "", "", "Mace2H", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI MaceAny = new GameAttributeI(363, 0, -1, 0, 0, "Pin(Mace + Mace2H, 0, 1)", "Pin(Mace + Mace2H, 0, 1)", "MaceAny", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Sword = new GameAttributeI(364, 0, -1, 0, 0, "", "", "Sword", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Sword2H = new GameAttributeI(365, 0, -1, 0, 0, "", "", "Sword2H", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI SwordAny = new GameAttributeI(366, 0, -1, 0, 0, "Pin(Sword + Sword2H, 0, 1)", "Pin(Sword + Sword2H, 0, 1)", "SwordAny", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Polearm = new GameAttributeI(367, 0, -1, 0, 0, "", "", "Polearm", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Spear = new GameAttributeI(368, 0, -1, 0, 0, "", "", "Spear", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Wand = new GameAttributeI(369, 0, -1, 0, 0, "", "", "Wand", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI ColdStaff = new GameAttributeI(370, 0, -1, 0, 0, "", "", "ColdStaff", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI FireStaff = new GameAttributeI(371, 0, -1, 0, 0, "", "", "FireStaff", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI LightningStaff = new GameAttributeI(372, 0, -1, 0, 0, "", "", "LightningStaff", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI PoisonStaff = new GameAttributeI(373, 0, -1, 0, 0, "", "", "PoisonStaff", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI StaffAny = new GameAttributeI(374, 0, -1, 0, 0, "Pin(ColdStaff + FireStaff + LightningStaff + PoisonStaff, 0, 1)", "Pin(ColdStaff + FireStaff + LightningStaff + PoisonStaff, 0, 1)", "StaffAny", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Weapon1H = new GameAttributeI(375, 0, -1, 0, 0, "Pin(Axe + Club + Dagger + Mace + Sword + Wand, 0, 1)", "Pin(Axe + Club + Dagger + Mace + Sword + Wand, 0, 1)", "Weapon1H", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Weapon2H = new GameAttributeI(376, 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.Int, 9, 0, 0, 32); +public static readonly GameAttributeI WeaponMelee = new GameAttributeI(377, 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.Int, 9, 0, 0, 32); +public static readonly GameAttributeI WeaponRanged = new GameAttributeI(378, 0, -1, 0, 0, "Pin(ThrowingAxe + BowAny, 0, 1)", "Pin(ThrowingAxe + BowAny, 0, 1)", "WeaponRanged", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Quiver = new GameAttributeI(379, 0, -1, 0, 0, "", "", "Quiver", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeI Reincarnation_Buff = new GameAttributeI(380, -1, -1, 3, 1, "", "", "Reincarnation_Buff", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Dead_Body_AnimTag = new GameAttributeI(381, -1, -1, 3, 1, "", "", "Dead_Body_AnimTag", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Spawned_by_ACDID = new GameAttributeI(382, -1, -1, 3, 1, "", "", "Spawned_by_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Summoned_By_ACDID = new GameAttributeI(383, -1, -1, 3, 1, "", "", "Summoned_By_ACDID", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Summoner_ID = new GameAttributeI(384, -1, -1, 3, 1, "", "", "Summoner_ID", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Banner_ACDID = new GameAttributeI(385, -1, -1, 3, 1, "", "", "Banner_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF Breakable_Shield_HP = new GameAttributeF(386, 0, -1, 0, 0, "", "", "Breakable_Shield_HP", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); +public static readonly GameAttributeI Current_WeaponClass = new GameAttributeI(387, -1, -1, 3, 1, "", "", "Current_WeaponClass", GameAttributeEncoding.IntMinMax, 31, -1, 19, 5); +public static readonly GameAttributeB Weapons_Sheathed = new GameAttributeB(388, 0, -1, 1, 1, "", "", "Weapons_Sheathed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Held_In_OffHand = new GameAttributeB(389, 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(390, 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(391, 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(392, 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(393, 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(394, 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(395, 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(396, 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(397, 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(398, 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(399, 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(400, 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(401, -1, -1, 1, 1, "", "", "Has_Special_Death_AnimTag", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Death_Type_Override = new GameAttributeI(402, -1, -1, 3, 1, "", "", "Death_Type_Override", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB In_Combat = new GameAttributeB(403, 0, -1, 1, 1, "", "", "In_Combat", GameAttributeEncoding.IntMinMax, 1, 0, 1, 1); +public static readonly GameAttributeB In_Conversation = new GameAttributeB(404, 0, -1, 3, 1, "", "", "In_Conversation", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Last_Tick_Potion_Used = new GameAttributeI(405, -1, -1, 3, 1, "", "", "Last_Tick_Potion_Used", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF Potion_Dilution_Percent = new GameAttributeF(406, 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(407, 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(408, 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(409, -1, -1, 3, 1, "", "", "Potion_Dilution_Duration", GameAttributeEncoding.IntMinMax, 0, -1, 16777214, 24); +public static readonly GameAttributeF Potion_Dilution_Scalar = new GameAttributeF(410, 0, -1, 0, 0, "", "", "Potion_Dilution_Scalar", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeB Feared = new GameAttributeB(411, 0, -1, 1, 1, "", "", "Feared", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Fear_Immune = new GameAttributeB(412, 0, -1, 1, 1, "", "", "Fear_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Last_Damage_ACD = new GameAttributeI(413, -1, -1, 3, 1, "", "", "Last_Damage_ACD", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Attached_To_ACD = new GameAttributeI(414, -1, -1, 3, 1, "", "", "Attached_To_ACD", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Attachment_ACD = new GameAttributeI(415, -1, -1, 3, 1, "", "", "Attachment_ACD", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Normal_Attack_Replacement_Power_SNO = new GameAttributeI(416, -1, -1, 3, 1, "", "", "Normal_Attack_Replacement_Power_SNO", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeF Damage_Type_Override = new GameAttributeF(417, 0, 0, 0, 0, "", "", "Damage_Type_Override", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); +public static readonly GameAttributeF Minion_Count_Bonus_Percent = new GameAttributeF(418, 0, -1, 0, 0, "", "", "Minion_Count_Bonus_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Champion_Teleport_Next_Tick = new GameAttributeI(419, 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(420, 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(421, 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(422, 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(423, 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(424, 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(425, 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(426, 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(427, 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(428, 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(429, 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(430, 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(431, 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(432, 0, -1, 0, 0, "", "", "Champion_Ghostly_Saved_Dodge_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeB Champion_Ghostly = new GameAttributeB(433, 0, -1, 1, 1, "", "", "Champion_Ghostly", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Base_Element = new GameAttributeI(434, -1, -1, 1, 1, "", "", "Base_Element", GameAttributeEncoding.IntMinMax, 0, -1, 7, 4); +public static readonly GameAttributeF Projectile_Amount_Bonus_Percent = new GameAttributeF(435, 0, -1, 0, 0, "", "", "Projectile_Amount_Bonus_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Projectile_Reflect_Chance = new GameAttributeF(436, 0, 0, 0, 0, "", "", "Projectile_Reflect_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Attack_Fear_Chance = new GameAttributeF(437, 0, -1, 0, 0, "", "", "Attack_Fear_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Attack_Fear_Time_Min = new GameAttributeF(438, 0, -1, 0, 0, "", "", "Attack_Fear_Time_Min", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Attack_Fear_Time_Delta = new GameAttributeF(439, 0, -1, 0, 0, "", "", "Attack_Fear_Time_Delta", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeB Buff_Visual_Effect = new GameAttributeB(440, 0, 9, 1, 1, "", "", "Buff_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Buff_Icon_Start_Tick0 = new GameAttributeI(441, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick0", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_Start_Tick1 = new GameAttributeI(442, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick1", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_Start_Tick2 = new GameAttributeI(443, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick2", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_Start_Tick3 = new GameAttributeI(444, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick3", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick0 = new GameAttributeI(445, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick0", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick1 = new GameAttributeI(446, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick1", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick2 = new GameAttributeI(447, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick2", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick3 = new GameAttributeI(448, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick3", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeB Could_Have_Ragdolled = new GameAttributeB(449, 0, -1, 1, 1, "", "", "Could_Have_Ragdolled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Ambient_Damage_Effect_Last_Time = new GameAttributeI(450, 0, -1, 1, 1, "", "", "Ambient_Damage_Effect_Last_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF Scale_Bonus = new GameAttributeF(451, 0, -1, 0, 0, "", "", "Scale_Bonus", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeB Deleted_On_Server = new GameAttributeB(452, 0, -1, 1, 1, "", "", "Deleted_On_Server", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Scripted_Fade_Time = new GameAttributeI(453, 0, -1, 1, 1, "", "", "Scripted_Fade_Time", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeB Does_No_Damage = new GameAttributeB(454, 0, -1, 1, 1, "", "", "Does_No_Damage", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Does_Fake_Damage = new GameAttributeB(455, 0, -1, 1, 1, "", "", "Does_Fake_Damage", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF SlowTime_Debuff = new GameAttributeF(456, 0, -1, 0, 0, "", "", "SlowTime_Debuff", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeB Blocks_Projectiles = new GameAttributeB(457, 0, -1, 1, 1, "", "", "Blocks_Projectiles", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Frozen = new GameAttributeB(458, 0, -1, 1, 1, "", "", "Frozen", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeF Freeze_Damage_Percent_Bonus = new GameAttributeF(459, 0, -1, 0, 0, "", "", "Freeze_Damage_Percent_Bonus", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeB Buff_Active = new GameAttributeB(460, 0, 4, 1, 1, "", "", "Buff_Active", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeF DualWield_BothAttack_Chance = new GameAttributeF(461, 0, -1, 0, 0, "", "", "DualWield_BothAttack_Chance", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Summon_Expiration_Tick = new GameAttributeI(462, 0, -1, 0, 1, "", "", "Summon_Expiration_Tick", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Summon_Count = new GameAttributeI(463, 0, -1, 0, 1, "", "", "Summon_Count", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Uninterruptible = new GameAttributeB(464, 0, -1, 1, 1, "", "", "Uninterruptible", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Queue_Death = new GameAttributeB(465, 0, -1, 1, 1, "", "", "Queue Death", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB CantStartDisplayedPowers = new GameAttributeB(466, 0, -1, 1, 1, "", "", "CantStartDisplayedPowers", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Wizard_Slowtime_Proxy_ACD = new GameAttributeI(467, -1, -1, 3, 1, "", "", "Wizard_Slowtime_Proxy_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF DPS = new GameAttributeF(468, 0, -1, 1, 0, "", "", "DPS", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeI Resurrection_Power = new GameAttributeI(469, -1, -1, 3, 1, "", "", "Resurrection_Power", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF Freeze_Damage = new GameAttributeF(470, 0, -1, 1, 0, "", "", "Freeze_Damage", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF Freeze_Capacity = new GameAttributeF(471, 0, -1, 0, 0, "", "", "Freeze_Capacity", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); +public static readonly GameAttributeF Thaw_Rate = new GameAttributeF(472, 0, -1, 0, 0, "", "", "Thaw_Rate", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); +public static readonly GameAttributeF Chilled_Dur_Bonus_Percent = new GameAttributeF(473, 0, -1, 0, 0, "", "", "Chilled_Dur_Bonus_Percent", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); +public static readonly GameAttributeF DOT_DPS = new GameAttributeF(474, 0, -1, 0, 0, "", "", "DOT_DPS", GameAttributeEncoding.Float16Or32, 31, 0, 0, 0); +public static readonly GameAttributeF DamageCap_Percent = new GameAttributeF(475, 0, -1, 1, 0, "", "", "DamageCap_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeI Item_Time_Sold = new GameAttributeI(476, 0, -1, 1, 1, "", "", "Item_Time_Sold", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI Forced_Hireling_Power = new GameAttributeI(477, -1, -1, 3, 1, "", "", "Forced_Hireling_Power", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB IsRooted = new GameAttributeB(478, 0, -1, 1, 1, "", "", "IsRooted", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI RootTargetACD = new GameAttributeI(479, -1, -1, 3, 1, "", "", "RootTargetACD", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeF RootAutoDecayPerSecond = new GameAttributeF(480, 0, -1, 1, 0, "", "", "RootAutoDecayPerSecond", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF RootUnitValue = new GameAttributeF(481, 0, -1, 1, 0, "", "", "RootUnitValue", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeI RootTotalTicks = new GameAttributeI(482, 0, -1, 1, 1, "", "", "RootTotalTicks", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Hide_Affixes = new GameAttributeB(483, 0, -1, 1, 1, "", "", "Hide_Affixes", GameAttributeEncoding.IntMinMax, 8, 0, 1, 1); +public static readonly GameAttributeI Skill_Socket_Bonus = new GameAttributeI(484, 0, -1, 1, 1, "", "", "Skill_Socket_Bonus", GameAttributeEncoding.IntMinMax, 8, 0, 31, 5); +public static readonly GameAttributeI Rune_Rank = new GameAttributeI(485, 0, 11, 0, 1, "", "", "Rune_Rank", GameAttributeEncoding.IntMinMax, 8, 0, 255, 8); +public static readonly GameAttributeI Rune_Attuned_Power = new GameAttributeI(486, -1, -1, 1, 1, "", "", "Rune_Attuned_Power", GameAttributeEncoding.Int, 8, 0, 0, 32); +public static readonly GameAttributeI Rune_A = new GameAttributeI(487, 0, 11, 0, 1, "", "", "Rune_A", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); +public static readonly GameAttributeI Rune_B = new GameAttributeI(488, 0, 11, 0, 1, "", "", "Rune_B", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); +public static readonly GameAttributeI Rune_C = new GameAttributeI(489, 0, 11, 0, 1, "", "", "Rune_C", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); +public static readonly GameAttributeI Rune_D = new GameAttributeI(490, 0, 11, 0, 1, "", "", "Rune_D", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); +public static readonly GameAttributeI Rune_E = new GameAttributeI(491, 0, 11, 0, 1, "", "", "Rune_E", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); +public static readonly GameAttributeF Resistance_Stun = new GameAttributeF(492, 0, -1, 0, 0, "", "", "Resistance_Stun", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Stun_Total = new GameAttributeF(493, 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(494, 0, -1, 0, 0, "", "", "Resistance_Root", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Root_Total = new GameAttributeF(495, 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(496, 0, -1, 0, 0, "", "", "Resistance_Freeze", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Freeze_Total = new GameAttributeF(497, 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(498, 0, -1, 0, 0, "", "", "Resistance_StunRootFreeze", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF CrowdControl_Reduction = new GameAttributeF(499, 0, -1, 7, 0, "", "", "CrowdControl_Reduction", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeB Displays_Team_Effect = new GameAttributeB(500, 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(501, 0, -1, 1, 1, "", "", "Cannot_Be_Added_To_AI_Target_List", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI SkillKit = new GameAttributeI(502, -1, -1, 3, 1, "", "", "SkillKit", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeB Immune_To_Charm = new GameAttributeB(503, 0, -1, 1, 1, "", "", "Immune_To_Charm", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Immune_To_Blind = new GameAttributeB(504, 0, -1, 1, 1, "", "", "Immune_To_Blind", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Damage_Shield = new GameAttributeB(505, 0, -1, 1, 1, "", "", "Damage_Shield", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Silenced = new GameAttributeB(506, 0, -1, 1, 1, "", "", "Silenced", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Diseased = new GameAttributeB(507, 0, -1, 1, 1, "", "", "Diseased", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Guard_Object_ACDID = new GameAttributeI(508, -1, -1, 3, 1, "", "", "Guard_Object_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Follow_Target_ACDID = new GameAttributeI(509, -1, -1, 3, 1, "", "", "Follow_Target_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Follow_Target_Type = new GameAttributeI(510, 0, -1, 3, 1, "", "", "Follow_Target_Type", GameAttributeEncoding.IntMinMax, 0, 0, 2, 2); +public static readonly GameAttributeI Forced_Enemy_ACDID = new GameAttributeI(511, -1, -1, 1, 1, "", "", "Forced_Enemy_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI NPC_Talk_Target_ANN = new GameAttributeI(512, -1, -1, 3, 1, "", "", "NPC_Talk_Target_ANN", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI NPC_Conv_Target_ANN = new GameAttributeI(513, -1, -1, 3, 1, "", "", "NPC_Conv_Target_ANN", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Script_Target_ACDID = new GameAttributeI(514, -1, 3, 3, 1, "", "", "Script_Target_ACDID", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Look_Target_Server_ANN = new GameAttributeI(515, -1, -1, 1, 1, "", "", "Look_Target_Server_ANN", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeF Look_Target_Broadcast_Intensity = new GameAttributeF(516, 0, -1, 0, 0, "", "", "Look_Target_Broadcast_Intensity", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF Look_Target_Broadcast_Radius = new GameAttributeF(517, 0, -1, 0, 0, "", "", "Look_Target_Broadcast_Radius", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeB Stealthed = new GameAttributeB(518, 0, -1, 1, 1, "", "", "Stealthed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI GemQuality = new GameAttributeI(519, 0, -1, 4, 1, "", "", "GemQuality", GameAttributeEncoding.IntMinMax, 8, 0, 10, 4); +public static readonly GameAttributeB SalvageUnlocked = new GameAttributeB(520, 0, -1, 1, 1, "", "", "SalvageUnlocked", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI TalismanLevel = new GameAttributeI(521, 0, -1, 1, 1, "", "", "TalismanLevel", GameAttributeEncoding.IntMinMax, 31, 0, 4, 3); +public static readonly GameAttributeI Talisman_Slots = new GameAttributeI(522, 0, -1, 0, 1, "", "", "Talisman_Slots", GameAttributeEncoding.IntMinMax, 31, 0, 9, 4); +public static readonly GameAttributeI UpgradeLevelA = new GameAttributeI(523, 0, -1, 1, 1, "", "", "UpgradeLevelA", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); +public static readonly GameAttributeI UpgradeLevelB = new GameAttributeI(524, 0, -1, 1, 1, "", "", "UpgradeLevelB", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); +public static readonly GameAttributeI UpgradeLevelC = new GameAttributeI(525, 0, -1, 1, 1, "", "", "UpgradeLevelC", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); +public static readonly GameAttributeI UpgradeLevelD = new GameAttributeI(526, 0, -1, 1, 1, "", "", "UpgradeLevelD", GameAttributeEncoding.IntMinMax, 31, 0, 255, 8); +public static readonly GameAttributeI ItemBuffIcon = new GameAttributeI(527, 0, 4, 1, 1, "", "0", "ItemBuffIcon", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeF ScrollDuration = new GameAttributeF(528, 0, -1, 1, 0, "", "0", "ScrollDuration", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Gizmo_Actor_SNO_To_Spawn = new GameAttributeI(529, -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(530, 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(531, -1, -1, 3, 1, "", "", "Death_Replacement_Power_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Attachment_Handled_By_Client = new GameAttributeB(532, 0, -1, 1, 1, "", "", "Attachment_Handled_By_Client", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB AI_In_Special_State = new GameAttributeB(533, 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(534, 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(535, 0, -1, 1, 1, "", "", "AI_Spawned_By_Inactive_Marker", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Headstone_Player_ANN = new GameAttributeI(536, -1, -1, 3, 1, "", "", "Headstone_Player_ANN", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeF Resource_Cost_Reduction_Percent = new GameAttributeF(537, 0, 10, 0, 0, "", "", "Resource_Cost_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Resistance_Penetration = new GameAttributeF(538, 0, 0, 0, 0, "", "", "Resistance_Penetration", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Resistance_Penetration_Total = new GameAttributeF(539, 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(540, 0, -1, 0, 0, "", "", "Resistance_Penetration_All", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Resistance_Penetration_Percent_All = new GameAttributeF(541, 0, -1, 0, 0, "", "", "Resistance_Penetration_Percent_All", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Fury_Effect_Level = new GameAttributeI(542, 0, -1, 0, 1, "", "", "Fury_Effect_Level", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeF Health_Potion_Bonus_Heal_Percent = new GameAttributeF(543, 0, -1, 0, 0, "", "", "Health_Potion_Bonus_Heal_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Free_Cast = new GameAttributeI(544, 0, 4, 1, 1, "", "", "Free_Cast", GameAttributeEncoding.Int, 9, 0, 0, 32); +public static readonly GameAttributeB Free_Cast_All = new GameAttributeB(545, 0, -1, 1, 1, "", "", "Free_Cast_All", GameAttributeEncoding.IntMinMax, 9, 0, 1, 1); +public static readonly GameAttributeF Movement_Scalar_Reduction_Percent = new GameAttributeF(546, 0, -1, 1, 0, "", "", "Movement_Scalar_Reduction_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Movement_Scalar_Reduction_Resistance = new GameAttributeF(547, 0, -1, 0, 0, "", "", "Movement_Scalar_Reduction_Resistance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Absorb_Percent_All = new GameAttributeF(548, 0, -1, 0, 0, "", "", "Damage_Absorb_Percent_All", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI World_Seed = new GameAttributeI(549, 0, -1, 0, 1, "", "", "World_Seed", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI Kill_Count_Record = new GameAttributeI(550, 0, -1, 1, 1, "", "", "Kill_Count_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI Object_Destruction_Record = new GameAttributeI(551, 0, -1, 1, 1, "", "", "Object_Destruction_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI Single_Attack_Record = new GameAttributeI(552, 0, -1, 1, 1, "", "", "Single_Attack_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeI Environment_Attack_Record = new GameAttributeI(553, 0, -1, 1, 1, "", "", "Environment_Attack_Record", GameAttributeEncoding.IntMinMax, 0, 0, 16777215, 24); +public static readonly GameAttributeB Root_Immune = new GameAttributeB(554, 0, -1, 1, 1, "", "", "Root_Immune", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeF Monster_Play_Get_Hit_Bonus = new GameAttributeF(555, 0, -1, 0, 0, "", "", "Monster_Play_Get_Hit_Bonus", GameAttributeEncoding.Float16Or32, 0, 0, 0, 0); +public static readonly GameAttributeI Stored_Contact_Frame = new GameAttributeI(556, 0, -1, 1, 1, "", "", "Stored_Contact_Frame", GameAttributeEncoding.IntMinMax, 0, 0, 4, 3); +public static readonly GameAttributeI Buff_Icon_Count0 = new GameAttributeI(557, 0, 4, 0, 1, "", "", "Buff_Icon_Count0", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeI Buff_Icon_Count1 = new GameAttributeI(558, 0, 4, 0, 1, "", "", "Buff_Icon_Count1", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeI Buff_Icon_Count2 = new GameAttributeI(559, 0, 4, 0, 1, "", "", "Buff_Icon_Count2", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeI Buff_Icon_Count3 = new GameAttributeI(560, 0, 4, 0, 1, "", "", "Buff_Icon_Count3", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeB Observer = new GameAttributeB(561, 0, -1, 1, 1, "", "", "Observer", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Resurrect_As_Observer = new GameAttributeB(562, 0, -1, 1, 1, "", "", "Resurrect_As_Observer", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Combo_Level = new GameAttributeI(563, 0, -1, 1, 1, "", "", "Combo_Level", GameAttributeEncoding.IntMinMax, 0, 0, 3, 2); +public static readonly GameAttributeI Combo_Time_Last_Move = new GameAttributeI(564, 0, -1, 1, 1, "", "", "Combo_Time_Last_Move", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Burrowed = new GameAttributeB(565, 0, -1, 1, 1, "", "", "Burrowed", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Death_Replacement_Effect_Group_SNO = new GameAttributeI(566, -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(567, 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(568, 0, -1, 0, 1, "", "", "Checkpoint_Resurrection_Forced_Game_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Controlling_TimedEvent_SNO = new GameAttributeI(569, -1, -1, 3, 1, "", "", "Controlling_TimedEvent_SNO", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF Casting_Speed_Percent = new GameAttributeF(570, 0, -1, 0, 0, "", "", "Casting_Speed_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeB Using_Bossbar = new GameAttributeB(571, 0, -1, 1, 1, "", "", "Using_Bossbar", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_0_Visual_Effect = new GameAttributeB(572, 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(573, 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(574, 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(575, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Store_SNO = new GameAttributeI(576, 0, 0, 3, 1, "", "", "Store SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeB Busy = new GameAttributeB(577, 0, -1, 1, 1, "", "", "Busy", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Afk = new GameAttributeB(578, 0, -1, 1, 1, "", "", "Afk", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Last_Action_Timestamp = new GameAttributeI(579, 0, -1, 1, 1, "", "", "Last Action Timestamp", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Portal_Next_Time = new GameAttributeI(580, 0, -1, 1, 1, "", "", "Portal Next Time", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeF Repair_Discount_Percent = new GameAttributeF(581, 0, -1, 0, 0, "", "", "Repair_Discount_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeB Resource_Degeneration_Prevented = new GameAttributeB(582, 0, -1, 1, 1, "", "", "Resource_Degeneration_Prevented", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Operatable = new GameAttributeB(583, 0, -1, 4, 1, "", "", "Operatable", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Look_Override = new GameAttributeI(584, 0, -1, 0, 1, "", "", "Look_Override", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Spawner_Concurrent_Count_ID = new GameAttributeI(585, -1, -1, 3, 1, "", "", "Spawner_Concurrent_Count_ID", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Disabled = new GameAttributeB(586, 0, -1, 1, 1, "", "", "Disabled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Skill_Override = new GameAttributeI(587, -1, 3, 1, 1, "", "", "Skill_Override", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeB Skill_Override_Active = new GameAttributeB(588, 0, -1, 1, 1, "", "", "Skill_Override_Active", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Skill_Override_Ended = new GameAttributeB(589, 0, 4, 1, 1, "", "", "Skill_Override_Ended", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Skill_Override_Ended_Active = new GameAttributeB(590, 0, -1, 1, 1, "", "", "Skill_Override_Ended_Active", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Is_Power_Proxy = new GameAttributeB(591, 0, -1, 1, 1, "", "", "Is_Power_Proxy", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Force_No_Death_Animation = new GameAttributeB(592, 0, -1, 1, 1, "", "", "Force_No_Death_Animation", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Player_WeaponClass_Anim_Override = new GameAttributeI(593, -1, -1, 1, 1, "", "", "Player_WeaponClass_Anim_Override", GameAttributeEncoding.IntMinMax, 31, -1, 19, 5); +public static readonly GameAttributeB Operatable_Story_Gizmo = new GameAttributeB(594, 0, -1, 1, 1, "", "", "Operatable_Story_Gizmo", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_0_Visual_Effect_None = new GameAttributeB(595, 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(596, 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(597, 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(598, 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(599, 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(600, 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(601, 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(602, 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(603, 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(604, 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(605, 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(606, 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(607, 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(608, 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(609, 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(610, 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(611, 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(612, 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(613, 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(614, 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(615, 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(616, 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(617, 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(618, 0, 4, 1, 1, "", "", "Power_Buff_3_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Walk_Passability_Power_SNO = new GameAttributeI(619, -1, -1, 1, 1, "", "", "Walk_Passability_Power_SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Passability_Power_SNO = new GameAttributeI(620, -1, -1, 1, 1, "", "", "Passability_Power_SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Flippy_ID = new GameAttributeI(621, -1, -1, 3, 1, "", "", "Flippy_ID", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Summoning_Machine_Num_Casters = new GameAttributeI(622, 0, -1, 0, 1, "", "", "Summoning_Machine_Num_Casters", GameAttributeEncoding.IntMinMax, 0, 0, 255, 8); +public static readonly GameAttributeI Summoning_Machine_Spawn_Count = new GameAttributeI(623, 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(624, 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(625, -1, -1, 1, 1, "", "", "Summoning_Machine_Spawn_Team", GameAttributeEncoding.IntMinMax, 0, -1, 23, 5); +public static readonly GameAttributeF Screen_Attack_Radius_Constant = new GameAttributeF(626, 1114636288, -1, 3, 0, "", "", "Screen_Attack_Radius_Constant", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeF Damage_Done_Reduction_Percent = new GameAttributeF(627, 0, -1, 1, 0, "", "", "Damage_Done_Reduction_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeI Set_Item_Count = new GameAttributeI(628, 0, 17, 0, 1, "", "", "Set_Item_Count", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeF Spawner_Countdown_Percent = new GameAttributeF(629, 0, -1, 1, 0, "", "", "Spawner_Countdown_Percent", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeB Attack_Slow = new GameAttributeB(630, 0, -1, 1, 1, "", "", "Attack_Slow", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Power_Disabled = new GameAttributeB(631, 0, 4, 1, 1, "", "", "Power_Disabled", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Weapon_Effect_Override = new GameAttributeI(632, 0, -1, 1, 1, "", "", "Weapon_Effect_Override", GameAttributeEncoding.IntMinMax, 31, 0, 14, 4); +public static readonly GameAttributeF Debuff_Duration_Reduction_Percent = new GameAttributeF(633, 0, -1, 0, 0, "", "", "Debuff_Duration_Reduction_Percent", GameAttributeEncoding.Float16, 0, 0, 0, 16); +public static readonly GameAttributeB Uses_PvP_Power_Tags = new GameAttributeB(634, 0, -1, 1, 1, "", "", "Uses_PvP_Power_Tags", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Trait = new GameAttributeI(635, 0, 4, 1, 1, "", "", "Trait", GameAttributeEncoding.IntMinMax, 31, -1, 30, 5); +public static readonly GameAttributeI Last_ACD_Attacked_By = new GameAttributeI(636, -1, -1, 3, 1, "", "", "Last_ACD_Attacked_By", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB ItemMeltUnlocked = new GameAttributeB(637, 0, -1, 1, 1, "", "", "ItemMeltUnlocked", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeF Gold_PickUp_Radius = new GameAttributeF(638, 0, -1, 0, 0, "", "", "Gold_PickUp_Radius", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeI Client_Only_Effect = new GameAttributeI(639, 0, 12, 1, 1, "", "", "Client Only Effect", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeB Has_Doppelganger_Cloned = new GameAttributeB(640, 0, -1, 1, 1, "", "", "Has_Doppelganger_Cloned", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Buff_Icon_Start_Tick4 = new GameAttributeI(641, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick4", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_Start_Tick5 = new GameAttributeI(642, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick5", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_Start_Tick6 = new GameAttributeI(643, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick6", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_Start_Tick7 = new GameAttributeI(644, 0, 4, 1, 1, "", "", "Buff_Icon_Start_Tick7", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick4 = new GameAttributeI(645, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick4", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick5 = new GameAttributeI(646, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick5", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick6 = new GameAttributeI(647, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick6", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_End_Tick7 = new GameAttributeI(648, 0, 4, 1, 1, "", "", "Buff_Icon_End_Tick7", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Buff_Icon_Count4 = new GameAttributeI(649, 0, 4, 0, 1, "", "", "Buff_Icon_Count4", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeI Buff_Icon_Count5 = new GameAttributeI(650, 0, 4, 0, 1, "", "", "Buff_Icon_Count5", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeI Buff_Icon_Count6 = new GameAttributeI(651, 0, 4, 0, 1, "", "", "Buff_Icon_Count6", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeI Buff_Icon_Count7 = new GameAttributeI(652, 0, 4, 0, 1, "", "", "Buff_Icon_Count7", GameAttributeEncoding.IntMinMax, 31, 0, 16777215, 24); +public static readonly GameAttributeB Power_Buff_4_Visual_Effect = new GameAttributeB(653, 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(654, 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(655, 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(656, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Power_Buff_4_Visual_Effect_None = new GameAttributeB(657, 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(658, 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(659, 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(660, 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(661, 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(662, 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(663, 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(664, 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(665, 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(666, 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(667, 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(668, 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(669, 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(670, 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(671, 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(672, 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(673, 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(674, 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(675, 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(676, 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(677, 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(678, 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(679, 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(680, 0, 4, 1, 1, "", "", "Power_Buff_7_Visual_Effect_E", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeF Resource_Gain_Bonus_Percent = new GameAttributeF(681, 0, 10, 0, 0, "", "", "Resource_Gain_Bonus_Percent", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Looping_Animation_Start_Time = new GameAttributeI(682, 0, -1, 1, 1, "", "", "Looping_Animation_Start_Time", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Looping_Animation_End_Time = new GameAttributeI(683, 0, -1, 1, 1, "", "", "Looping_Animation_End_Time", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeI Heal_Effect_Last_Played_Tick = new GameAttributeI(684, -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(685, -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(686, -1, -1, 3, 1, "", "", "Thorns_Effect_Last_Played_tick", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI PVP_Kills = new GameAttributeI(687, 0, -1, 0, 1, "", "", "PVP_Kills", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI PVP_Deaths = new GameAttributeI(688, 0, -1, 0, 1, "", "", "PVP_Deaths", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI PVP_Assists = new GameAttributeI(689, 0, -1, 0, 1, "", "", "PVP_Assists", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI PVP_Progression_Points_Gained = new GameAttributeI(690, 0, -1, 0, 1, "", "", "PVP_Progression_Points_Gained", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI PVP_Current_Kill_Streak = new GameAttributeI(691, 0, -1, 0, 1, "", "", "PVP_Current_Kill_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI PVP_Current_Death_Streak = new GameAttributeI(692, 0, -1, 0, 1, "", "", "PVP_Current_Death_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI PVP_Longest_Kill_Streak = new GameAttributeI(693, 0, -1, 0, 1, "", "", "PVP_Longest_Kill_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeI PVP_Longest_Death_Streak = new GameAttributeI(694, 0, -1, 0, 1, "", "", "PVP_Longest_Death_Streak", GameAttributeEncoding.Int, 1, 0, 0, 32); +public static readonly GameAttributeF Turn_Rate_Scalar = new GameAttributeF(695, 1065353216, -1, 5, 0, "", "", "Turn_Rate_Scalar", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF Turn_Accel_Scalar = new GameAttributeF(696, 1065353216, -1, 5, 0, "", "", "Turn_Accel_Scalar", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeF Turn_Deccel_Scalar = new GameAttributeF(697, 1065353216, -1, 5, 0, "", "", "Turn_Deccel_Scalar", GameAttributeEncoding.Float16, 31, 0, 0, 16); +public static readonly GameAttributeB No_Health_Drop = new GameAttributeB(698, 0, -1, 1, 1, "", "", "No_Health_Drop", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Leader = new GameAttributeB(699, 0, -1, 1, 1, "", "", "Leader", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB IsTrialActor = new GameAttributeB(700, 0, -1, 1, 1, "", "", "IsTrialActor", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB InBossEncounter = new GameAttributeB(701, 0, -1, 1, 1, "", "", "InBossEncounter", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB God = new GameAttributeB(702, 0, -1, 1, 1, "", "", "God", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB MinimapActive = new GameAttributeB(703, 0, -1, 1, 1, "", "", "MinimapActive", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI MinimapIconOverride = new GameAttributeI(704, -1, -1, 0, 1, "", "", "MinimapIconOverride", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeB MinimapDisableArrow = new GameAttributeB(705, 0, -1, 1, 1, "", "", "MinimapDisableArrow", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeI Last_Blocked_ACD = new GameAttributeI(706, -1, -1, 3, 1, "", "", "Last_Blocked_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeI Last_Blocked_Time = new GameAttributeI(707, 0, -1, 1, 1, "", "", "Last_Blocked_Time", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeB Deactivate_Lure = new GameAttributeB(708, 0, -1, 1, 1, "", "", "Deactivate Lure", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeB Weapons_Hidden = new GameAttributeB(709, 0, -1, 1, 1, "", "", "Weapons_Hidden", GameAttributeEncoding.IntMinMax, 31, 0, 1, 1); +public static readonly GameAttributeB Actor_Updates_Attributes_From_Owner = new GameAttributeB(710, 0, -1, 1, 1, "", "", "Actor_Updates_Attributes_From_Owner", GameAttributeEncoding.IntMinMax, 0, 0, 1, 1); +public static readonly GameAttributeI Taunt_Target_ACD = new GameAttributeI(711, -1, -1, 1, 1, "", "", "Taunt_Target_ACD", GameAttributeEncoding.Int, 0, 0, 0, 32); +public static readonly GameAttributeF UI_Only_Percent_Damage_Increase = new GameAttributeF(712, 0, -1, 0, 0, "", "", "UI_Only_Percent_Damage_Increase", GameAttributeEncoding.Float16, 1, 0, 0, 16); +public static readonly GameAttributeI Projectile_Effect_SNO = new GameAttributeI(713, -1, -1, 3, 1, "", "", "Projectile_Effect_SNO", GameAttributeEncoding.Int, 31, 0, 0, 32); +public static readonly GameAttributeF On_Hit_Fear_Proc_Chance = new GameAttributeF(714, 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(715, 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(716, 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(717, 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(718, 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(719, 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(720, 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(721, 0, -1, 7, 0, "", "", "On_Hit_Knockback_Proc_Chance", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Percent_Reduction_From_Ranged = new GameAttributeF(722, 0, -1, 7, 0, "", "", "Damage_Percent_Reduction_From_Ranged", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Percent_Reduction_From_Melee = new GameAttributeF(723, 0, -1, 7, 0, "", "", "Damage_Percent_Reduction_From_Melee", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Percent_Reduction_Turns_Into_Heal = new GameAttributeF(724, 0, -1, 7, 0, "", "", "Damage_Percent_Reduction_Turns_Into_Heal", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeF Damage_Percent_Percent_Bonus_Vs_Monster_Type = new GameAttributeF(725, 0, 18, 7, 0, "", "", "Damage_Percent_Percent_Bonus_Vs_Monster_Type", GameAttributeEncoding.Float16, 9, 0, 0, 16); +public static readonly GameAttributeI Item_Manipulation_Timeout = new GameAttributeI(726, 0, -1, 4, 1, "", "", "Item_Manipulation_Timeout", GameAttributeEncoding.Int, 0, 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..cdd61c4a --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/attributes.xml @@ -0,0 +1,730 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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..e521dd90 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/classgenerator-output.cs @@ -0,0 +1,5182 @@ + 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 > 0x1FFFFFFF) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadCharArray(49); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadInt(29); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteCharArray(49, Field0); + buffer.WriteInt(32, Field1); + buffer.WriteInt(29, 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 int Field4; + public int Field5; + public int Field6; + public int Field7; + public int Field8; + public int Field9; + public int snoSpeakerActor; + public string _Field11; + public string Field11 { get { return _Field11; } set { if(value != null && value.Length > 49) throw new ArgumentOutOfRangeException(); _Field11 = value; } } + public int Field12; + public int Field13; + public int Field14; + public int Field15; + public int Field16; + + public void Parse(GameBitBuffer buffer) + { + snoConversation = buffer.ReadInt(32); + Field1 = buffer.ReadInt(32); + Field2 = buffer.ReadBool(); + Field3 = buffer.ReadBool(); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadInt(32); + Field6 = buffer.ReadInt(32); + Field7 = buffer.ReadInt(32); + Field8 = buffer.ReadInt(32); + Field9 = buffer.ReadInt(32); + snoSpeakerActor = buffer.ReadInt(32); + Field11 = buffer.ReadCharArray(49); + Field12 = buffer.ReadInt(32); + Field13 = buffer.ReadInt(32); + Field14 = buffer.ReadInt(32); + Field15 = buffer.ReadInt(32); + Field16 = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoConversation); + buffer.WriteInt(32, Field1); + buffer.WriteBool(Field2); + buffer.WriteBool(Field3); + buffer.WriteInt(32, Field4); + buffer.WriteInt(32, Field5); + buffer.WriteInt(32, Field6); + buffer.WriteInt(32, Field7); + buffer.WriteInt(32, Field8); + buffer.WriteInt(32, Field9); + buffer.WriteInt(32, snoSpeakerActor); + buffer.WriteCharArray(49, Field11); + buffer.WriteInt(32, Field12); + buffer.WriteInt(32, Field13); + buffer.WriteInt(32, Field14); + buffer.WriteInt(32, Field15); + buffer.WriteInt(32, Field16); + } + + } + + 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 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 ACDTranslateSyncMessage : GameMessage + { + public int Field0; + public Vector3D Field1; + public bool? Field2; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new Vector3D(); + Field1.Parse(buffer); + if(buffer.ReadBool()) + Field2 = buffer.ReadBool(); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + if(Field2.HasValue) + buffer.WriteBool(Field2.Value); + } + + } + + 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 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; } } + + 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); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + buffer.WriteFloat32(Field2); + buffer.WriteBool(Field3); + buffer.WriteInt(25, Field4); + } + + } + + 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 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); + } + + 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); + } + + } + + public class PlayerChangeHotbarButtonMessage : GameMessage + { + int _Field0; + public int Field0 { get { return _Field0; } set { if(value < -1 || value > 8) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + public HotbarButtonData Field1; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(4) + (-1); + Field1 = new HotbarButtonData(); + Field1.Parse(buffer); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(4, Field0 - (-1)); + Field1.Encode(buffer); + } + + } + + public class HotbarButtonData + { + public int m_snoPower; + public int m_gbidItem; + + public void Parse(GameBitBuffer buffer) + { + m_snoPower = buffer.ReadInt(32); + m_gbidItem = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, m_snoPower); + buffer.WriteInt(32, m_gbidItem); + } + + } + + 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 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 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 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 AssignSkillMessage : GameMessage + { + public int snoPower; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 28) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + snoPower = buffer.ReadInt(32); + Field1 = buffer.ReadInt(5); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, snoPower); + buffer.WriteInt(5, Field1); + } + + } + + public class MapMarkerInfoMessage : GameMessage + { + public int Field0; + public WorldPlace Field1; + public int Field2; + public int m_snoStringList; + public int Field4; + public float Field5; + public float Field6; + public float Field7; + public int Field8; + public bool Field9; + public bool Field10; + public bool Field11; + public int Field12; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadInt(32); + Field1 = new WorldPlace(); + Field1.Parse(buffer); + Field2 = buffer.ReadInt(32); + m_snoStringList = buffer.ReadInt(32); + Field4 = buffer.ReadInt(32); + Field5 = buffer.ReadFloat32(); + Field6 = buffer.ReadFloat32(); + Field7 = buffer.ReadFloat32(); + Field8 = buffer.ReadInt(32); + Field9 = buffer.ReadBool(); + Field10 = buffer.ReadBool(); + Field11 = buffer.ReadBool(); + Field12 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + Field1.Encode(buffer); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, m_snoStringList); + buffer.WriteInt(32, Field4); + buffer.WriteFloat32(Field5); + buffer.WriteFloat32(Field6); + buffer.WriteFloat32(Field7); + buffer.WriteInt(32, Field8); + buffer.WriteBool(Field9); + buffer.WriteBool(Field10); + buffer.WriteBool(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 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 WeatherOverrideMessage : 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 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; + int _Field4; + public int Field4 { get { return _Field4; } set { if(value < 0 || value > 7) throw new ArgumentOutOfRangeException(); _Field4 = value; } } + + 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.ReadInt(3); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteInt(32, Field0); + buffer.WriteInt(32, snoScene); + Field2.Encode(buffer); + buffer.WriteInt(32, Field3); + buffer.WriteInt(3, 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 float Field0; + public Vector3D Field1; + + public void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadFloat32(); + Field1 = new Vector3D(); + Field1.Parse(buffer); + } + + public void Encode(GameBitBuffer buffer) + { + buffer.WriteFloat32(Field0); + Field1.Encode(buffer); + } + + } + + 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 > 14) 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 SocketSpellMessage : 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 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 > 28) 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 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 snoKillerMonster; + public int snoKillerActor; + int _Field6; + public int Field6 { get { return _Field6; } set { if(value < -1 || value > 23) throw new ArgumentOutOfRangeException(); _Field6 = value; } } + int[] _Field7; + public int[] Field7 { get { return _Field7; } set { if(value != null && value.Length != 2) throw new ArgumentOutOfRangeException(); _Field7 = 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); + snoKillerMonster = buffer.ReadInt(32); + snoKillerActor = buffer.ReadInt(32); + Field6 = buffer.ReadInt(5) + (-1); + Field7 = new int[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, snoKillerMonster); + 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 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 > 2) 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 + { + public string _Field0; + public string Field0 { get { return _Field0; } set { if(value != null && value.Length > 512) 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 WorldPlace Field2; + public int Field3; + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadCharArray(512); + Field1 = buffer.ReadInt(4) + (-1); + Field2 = new WorldPlace(); + Field2.Parse(buffer); + Field3 = buffer.ReadInt(32); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteCharArray(512, Field0); + buffer.WriteInt(4, Field1 - (-1)); + 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 > 28) 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 > 31) 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(5); + 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(5, 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 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 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 > 9) 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 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 GoldModifiedMessage : GameMessage + { + public bool Field0; + int _Field1; + public int Field1 { get { return _Field1; } set { if(value < 0 || value > 2) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + + public override void Parse(GameBitBuffer buffer) + { + Field0 = buffer.ReadBool(); + Field1 = buffer.ReadInt(2); + } + + public override void Encode(GameBitBuffer buffer) + { + buffer.WriteBool(Field0); + buffer.WriteInt(2, 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 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; + int _Field3; + public int Field3 { get { return _Field3; } set { if(value < 0 || value > 0x1FFFFFFF) throw new ArgumentOutOfRangeException(); _Field3 = value; } } + public PlayerSavedData Field4; + public int Field5; + 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(29); + Field4 = new PlayerSavedData(); + Field4.Parse(buffer); + Field5 = 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(29, Field3); + Field4.Encode(buffer); + buffer.WriteInt(32, Field5); + 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 != 9) throw new ArgumentOutOfRangeException(); _Field0 = value; } } + SkillKeyMapping[] _Field1; + public SkillKeyMapping[] Field1 { get { return _Field1; } set { if(value != null && value.Length != 15) throw new ArgumentOutOfRangeException(); _Field1 = value; } } + public int Field2; + public int Field3; + public HirelingSavedData Field4; + public int Field5; + public LearnedLore Field6; + int[] _snoActiveSkills; + public int[] snoActiveSkills { get { return _snoActiveSkills; } set { if(value != null && value.Length != 6) throw new ArgumentOutOfRangeException(); _snoActiveSkills = value; } } + int[] _snoTraits; + public int[] snoTraits { get { return _snoTraits; } set { if(value != null && value.Length != 3) throw new ArgumentOutOfRangeException(); _snoTraits = value; } } + public SavePointData Field9; + int[] _m_SeenTutorials; + public int[] m_SeenTutorials { get { return _m_SeenTutorials; } set { if(value != null && value.Length != 64) throw new ArgumentOutOfRangeException(); _m_SeenTutorials = value; } } + + public void Parse(GameBitBuffer buffer) + { + Field0 = new HotbarButtonData[9]; + for(int i = 0;i < _Field0.Length;i++) + { + _Field0[i] = new HotbarButtonData(); + _Field0[i].Parse(buffer); + } + Field1 = new SkillKeyMapping[15]; + for(int i = 0;i < _Field1.Length;i++) + { + _Field1[i] = new SkillKeyMapping(); + _Field1[i].Parse(buffer); + } + Field2 = buffer.ReadInt(32); + Field3 = buffer.ReadInt(32); + Field4 = new HirelingSavedData(); + Field4.Parse(buffer); + Field5 = buffer.ReadInt(32); + Field6 = new LearnedLore(); + Field6.Parse(buffer); + snoActiveSkills = new int[6]; + for(int i = 0;i < _snoActiveSkills.Length;i++) _snoActiveSkills[i] = buffer.ReadInt(32); + snoTraits = new int[3]; + for(int i = 0;i < _snoTraits.Length;i++) _snoTraits[i] = buffer.ReadInt(32); + Field9 = new SavePointData(); + Field9.Parse(buffer); + m_SeenTutorials = new int[64]; + for(int i = 0;i < _m_SeenTutorials.Length;i++) _m_SeenTutorials[i] = buffer.ReadInt(32); + } + + public void Encode(GameBitBuffer buffer) + { + for(int i = 0;i < _Field0.Length;i++) _Field0[i].Encode(buffer); + for(int i = 0;i < _Field1.Length;i++) _Field1[i].Encode(buffer); + buffer.WriteInt(32, Field2); + buffer.WriteInt(32, Field3); + Field4.Encode(buffer); + buffer.WriteInt(32, Field5); + Field6.Encode(buffer); + for(int i = 0;i < _snoActiveSkills.Length;i++) buffer.WriteInt(32, _snoActiveSkills[i]); + for(int i = 0;i < _snoTraits.Length;i++) buffer.WriteInt(32, _snoTraits[i]); + Field9.Encode(buffer); + for(int i = 0;i < _m_SeenTutorials.Length;i++) buffer.WriteInt(32, _m_SeenTutorials[i]); + } + + } + + public class SkillKeyMapping + { + public int Power; + public int Field1; + int _Field2; + public int Field2 { get { return _Field2; } set { if(value < 0 || value > 9) throw new ArgumentOutOfRangeException(); _Field2 = value; } } + + 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 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 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 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 > 101) 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(101); + 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(101, 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 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 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); + } + + } + + 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 + { + public bool Field0; + 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.ReadBool(); + 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.WriteBool(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]); + } + + } + diff --git a/src/tools/GameServer/TypeExtractor/typedescriptors.xml b/src/tools/GameServer/TypeExtractor/typedescriptors.xml new file mode 100644 index 00000000..b675e0f7 --- /dev/null +++ b/src/tools/GameServer/TypeExtractor/typedescriptors.xml @@ -0,0 +1,6213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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/src/tools/MooNet/Helpers/.gitignore b/src/tools/MooNet/Helpers/.gitignore new file mode 100644 index 00000000..b37c0835 --- /dev/null +++ b/src/tools/MooNet/Helpers/.gitignore @@ -0,0 +1,4 @@ +/bin/ +/obj/ +/*.pidb +/*.csproj.ReSharper 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/.gitignore b/src/tools/MooNet/ProtoExtractor/.gitignore new file mode 100644 index 00000000..4ded7c4c --- /dev/null +++ b/src/tools/MooNet/ProtoExtractor/.gitignore @@ -0,0 +1,2 @@ +/bin/ +/obj/ 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/source/D3Sharp/app.config b/src/tools/MooNet/ProtoExtractor/app.config similarity index 100% rename from source/D3Sharp/app.config rename to src/tools/MooNet/ProtoExtractor/app.config diff --git a/src/tools/MooNet/StringViewer/.gitignore b/src/tools/MooNet/StringViewer/.gitignore new file mode 100644 index 00000000..0b71c097 --- /dev/null +++ b/src/tools/MooNet/StringViewer/.gitignore @@ -0,0 +1,3 @@ +/bin/ +/obj/ +/*.pidb 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