mirror of
https://gitlab.com/gh0stl1ne/Bioserver1.git
synced 2026-04-07 19:39:56 -03:00
Initial commit
This commit is contained in:
662
LICENSE.txt
Normal file
662
LICENSE.txt
Normal file
@@ -0,0 +1,662 @@
|
|||||||
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 19 November 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works, specifically designed to ensure
|
||||||
|
cooperation with the community in the case of network server software.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
our General Public Licenses are intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users.
|
||||||
|
|
||||||
|
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
|
||||||
|
them 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.
|
||||||
|
|
||||||
|
Developers that use our General Public Licenses protect your rights
|
||||||
|
with two steps: (1) assert copyright on the software, and (2) offer
|
||||||
|
you this License which gives you legal permission to copy, distribute
|
||||||
|
and/or modify the software.
|
||||||
|
|
||||||
|
A secondary benefit of defending all users' freedom is that
|
||||||
|
improvements made in alternate versions of the program, if they
|
||||||
|
receive widespread use, become available for other developers to
|
||||||
|
incorporate. Many developers of free software are heartened and
|
||||||
|
encouraged by the resulting cooperation. However, in the case of
|
||||||
|
software used on network servers, this result may fail to come about.
|
||||||
|
The GNU General Public License permits making a modified version and
|
||||||
|
letting the public access it on a server without ever releasing its
|
||||||
|
source code to the public.
|
||||||
|
|
||||||
|
The GNU Affero General Public License is designed specifically to
|
||||||
|
ensure that, in such cases, the modified source code becomes available
|
||||||
|
to the community. It requires the operator of a network server to
|
||||||
|
provide the source code of the modified version running there to the
|
||||||
|
users of that server. Therefore, public use of a modified version, on
|
||||||
|
a publicly accessible server, gives the public access to the source
|
||||||
|
code of the modified version.
|
||||||
|
|
||||||
|
An older license, called the Affero General Public License and
|
||||||
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
|
this license.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey 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;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If 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 convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the
|
||||||
|
Program, your modified version must prominently offer all users
|
||||||
|
interacting with it remotely through a computer network (if your version
|
||||||
|
supports such interaction) an opportunity to receive the Corresponding
|
||||||
|
Source of your version by providing access to the Corresponding Source
|
||||||
|
from a network server at no charge, through some standard or customary
|
||||||
|
means of facilitating copying of software. This Corresponding Source
|
||||||
|
shall include the Corresponding Source for any work covered by version 3
|
||||||
|
of the GNU General Public License that is incorporated pursuant to the
|
||||||
|
following paragraph.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the work with which it is combined will remain governed by version
|
||||||
|
3 of the GNU General Public License.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU Affero 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 that a certain numbered version of the GNU Affero General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU Affero General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU Affero General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
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.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
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
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If your software can interact with users remotely through a computer
|
||||||
|
network, you should also make sure that it provides a way for users to
|
||||||
|
get its source. For example, if your program is a web application, its
|
||||||
|
interface could display a "Source" link that leads users to an archive
|
||||||
|
of the code. There are many ways you could offer source, and different
|
||||||
|
solutions will be better for different programs; see section 13 for the
|
||||||
|
specific requirements.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
51
bioserver/Area.java
Normal file
51
bioserver/Area.java
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
public class Area {
|
||||||
|
// status of the area
|
||||||
|
public static final byte STATUS_ACTIVE = 3;
|
||||||
|
public static final byte STATUS_INACTIVE = 0;
|
||||||
|
|
||||||
|
private int nr;
|
||||||
|
private String name;
|
||||||
|
private String description;
|
||||||
|
private byte status;
|
||||||
|
|
||||||
|
public Area(int number, String name, String description, byte status) {
|
||||||
|
this.nr = number;
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
}
|
||||||
58
bioserver/Areas.java
Normal file
58
bioserver/Areas.java
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All areas
|
||||||
|
*/
|
||||||
|
public class Areas {
|
||||||
|
private List areas;
|
||||||
|
|
||||||
|
// setup our areas
|
||||||
|
public Areas() {
|
||||||
|
areas = new LinkedList();
|
||||||
|
areas.add(new Area(1, "East Town", "<BODY><SIZE=3>standard rules<END>", Area.STATUS_ACTIVE));
|
||||||
|
areas.add(new Area(2, "West Town", "<BODY><SIZE=3>individual games<END>",Area.STATUS_ACTIVE));
|
||||||
|
}
|
||||||
|
|
||||||
|
// how many areas do we have ?
|
||||||
|
public int getAreaCount() {
|
||||||
|
return areas.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName(int areanumber) {
|
||||||
|
Area area = (Area) areas.get(areanumber-1);
|
||||||
|
return(area.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription(int areanumber) {
|
||||||
|
Area area = (Area) areas.get(areanumber-1);
|
||||||
|
return(area.getDescription());
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getStatus(int areanumber) {
|
||||||
|
Area area = (Area) areas.get(areanumber-1);
|
||||||
|
return(area.getStatus());
|
||||||
|
}
|
||||||
|
}
|
||||||
41
bioserver/ChangeRequest.java
Normal file
41
bioserver/ChangeRequest.java
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.nio.channels.SocketChannel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object for the request queue
|
||||||
|
*/
|
||||||
|
public class ChangeRequest {
|
||||||
|
public static final int REGISTER = 1;
|
||||||
|
public static final int CHANGEOPS = 2;
|
||||||
|
|
||||||
|
public SocketChannel socket;
|
||||||
|
public int type;
|
||||||
|
public int ops;
|
||||||
|
|
||||||
|
public ChangeRequest(SocketChannel socket, int type, int ops) {
|
||||||
|
this.socket = socket;
|
||||||
|
this.type = type;
|
||||||
|
this.ops = ops;
|
||||||
|
}
|
||||||
|
}
|
||||||
165
bioserver/Client.java
Normal file
165
bioserver/Client.java
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.channels.SocketChannel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* information about the clients
|
||||||
|
*/
|
||||||
|
public class Client {
|
||||||
|
private SocketChannel socket;
|
||||||
|
private String userid;
|
||||||
|
private String session;
|
||||||
|
private HNPair hnpair; // chosen handle / nickname
|
||||||
|
private byte[] characterstats; // 0xd0 in len
|
||||||
|
private short character;
|
||||||
|
private short costume;
|
||||||
|
|
||||||
|
private int area; // special case 51 = post-game lobby
|
||||||
|
private int room;
|
||||||
|
private int slot;
|
||||||
|
public int gamenumber;
|
||||||
|
private byte player; // number of this player (1-4)
|
||||||
|
|
||||||
|
public boolean connalive; // set back every 60 secs or be disconnected ;-)
|
||||||
|
|
||||||
|
private byte host; // this is the host of a gameslot
|
||||||
|
|
||||||
|
public Client(SocketChannel socket, String userid, String session) {
|
||||||
|
this.socket = socket;
|
||||||
|
this.userid = userid;
|
||||||
|
this.session = session;
|
||||||
|
this.area = 0; // in no area (area selection screen)
|
||||||
|
this.room = 0; // in no room
|
||||||
|
this.slot = 0; // in no slot
|
||||||
|
this.host = 0;
|
||||||
|
this.connalive = true; // begin with active connection
|
||||||
|
}
|
||||||
|
|
||||||
|
public SocketChannel getSocket() {
|
||||||
|
return socket;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserID() {
|
||||||
|
return userid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HNPair getHNPair() {
|
||||||
|
return hnpair;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHNPair(HNPair hnpair) {
|
||||||
|
this.hnpair = hnpair;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCharacterStats(byte[] charstats) {
|
||||||
|
this.characterstats = charstats;
|
||||||
|
this.character = (short) (charstats[0xc8] & 0x00ff);
|
||||||
|
// npc start with MAC = 9
|
||||||
|
this.character = (short) (this.character + (short) (8 * charstats[0xca] & 0x00ff));
|
||||||
|
this.costume = (short) (charstats[0xcc] & 0x00ff);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArea(int number) {
|
||||||
|
this.area = number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getArea() {
|
||||||
|
return this.area;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoom(int number) {
|
||||||
|
this.room = number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRoom() {
|
||||||
|
return this.room;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSlot(int number) {
|
||||||
|
this.slot = number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSlot() {
|
||||||
|
return this.slot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getCharacterStats() {
|
||||||
|
return this.characterstats;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getHostFlag() {
|
||||||
|
return this.host;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHostFlag(byte number) {
|
||||||
|
this.host = number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlayerNum(byte number) {
|
||||||
|
this.player = number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getPlayerNum() {
|
||||||
|
return this.player;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getPreGameStat(byte playernum) {
|
||||||
|
ByteBuffer z = ByteBuffer.wrap(new byte[300]);
|
||||||
|
|
||||||
|
z.put(playernum);
|
||||||
|
z.put((byte) 1);
|
||||||
|
z.put(this.getHNPair().getHNPair());
|
||||||
|
z.putShort((short) this.characterstats.length);
|
||||||
|
z.put(this.characterstats);
|
||||||
|
z.put((byte) 0);
|
||||||
|
z.put((byte) 0);
|
||||||
|
z.put((byte) 6);
|
||||||
|
|
||||||
|
byte[] retval = new byte[z.position()];
|
||||||
|
z.rewind();
|
||||||
|
z.get(retval);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getCharacterStat() {
|
||||||
|
ByteBuffer z = ByteBuffer.wrap(new byte[300]);
|
||||||
|
|
||||||
|
z.put(this.getHNPair().getHNPair());
|
||||||
|
z.putShort((short) this.characterstats.length);
|
||||||
|
z.put(this.characterstats);
|
||||||
|
|
||||||
|
byte[] retval = new byte[z.position()];
|
||||||
|
z.rewind();
|
||||||
|
z.get(retval);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public short getCharacter() {
|
||||||
|
return this.character;
|
||||||
|
}
|
||||||
|
|
||||||
|
public short getCostume() {
|
||||||
|
return this.costume;
|
||||||
|
}
|
||||||
|
}
|
||||||
243
bioserver/ClientList.java
Normal file
243
bioserver/ClientList.java
Normal file
@@ -0,0 +1,243 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.channels.SocketChannel;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of connected clients
|
||||||
|
*/
|
||||||
|
public class ClientList {
|
||||||
|
private List clients;
|
||||||
|
private Client client;
|
||||||
|
|
||||||
|
public ClientList() {
|
||||||
|
clients = new LinkedList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List getList() {
|
||||||
|
return clients;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void add(Client client) {
|
||||||
|
clients.add(client);
|
||||||
|
}
|
||||||
|
|
||||||
|
// find a client by its sockets
|
||||||
|
public Client findClient(SocketChannel socket) {
|
||||||
|
for(int i=0; i< clients.size(); i++) {
|
||||||
|
client = (Client) clients.get(i);
|
||||||
|
if(client.getSocket() == socket) {
|
||||||
|
return(client);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// find a client by userid
|
||||||
|
public Client findClient(String userid) {
|
||||||
|
for(int i=0; i<clients.size(); i++) {
|
||||||
|
client = (Client) clients.get(i);
|
||||||
|
if(client.getUserID().equals(userid)) return client;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// find a client by its handle
|
||||||
|
public Client findClientByHandle(byte[] handle) {
|
||||||
|
byte[] clhand;
|
||||||
|
if(handle == null) return null;
|
||||||
|
for(int i=0; i<clients.size(); i++) {
|
||||||
|
client = (Client) clients.get(i);
|
||||||
|
try {
|
||||||
|
clhand = client.getHNPair().getHandle();
|
||||||
|
} catch (Exception e) {
|
||||||
|
//TODO: for the moment we ignore the nullpointer execeptions, but we have to handle clientlist different!
|
||||||
|
clhand = null;
|
||||||
|
}
|
||||||
|
if(clhand != null)
|
||||||
|
if(Arrays.equals(handle, clhand)) return client;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// find client with certain playernumber in same gameslot like client
|
||||||
|
public Client findClient(int area, int room, int slot, byte playernum) {
|
||||||
|
for(int i=0; i<clients.size(); i++) {
|
||||||
|
client = (Client) clients.get(i);
|
||||||
|
if(client.getArea()==area &&
|
||||||
|
client.getRoom()==room &&
|
||||||
|
client.getSlot()==slot &&
|
||||||
|
client.getPlayerNum() == playernum) { return(client); }
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getFreePlayerNum(int area, int room, int slot) {
|
||||||
|
byte[] fpn = {0,0,0,0,0};
|
||||||
|
for(int i=0; i<clients.size(); i++) {
|
||||||
|
client = (Client) clients.get(i);
|
||||||
|
if(client.getArea()==area && client.getRoom()==room && client.getSlot()==slot) {
|
||||||
|
fpn[client.getPlayerNum()] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(int i=2; i<5; i++) if(fpn[i] == 0) return((byte) i);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// find a client by its socket and remove it
|
||||||
|
public void remove(SocketChannel socket) {
|
||||||
|
for(int i=0; i< clients.size(); i++) {
|
||||||
|
client = (Client) clients.get(i);
|
||||||
|
if(client.getSocket() == socket) {
|
||||||
|
clients.remove(i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove a client
|
||||||
|
public void remove(Client cl) {
|
||||||
|
for(int i=0; i< clients.size(); i++) {
|
||||||
|
client = (Client) clients.get(i);
|
||||||
|
if(client == cl) {
|
||||||
|
clients.remove(i);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// find the host of a slot if there's any
|
||||||
|
public Client getHostofSlot(int area, int room, int slot) {
|
||||||
|
Client retval = null;
|
||||||
|
for(int i=0; i<clients.size(); i++) {
|
||||||
|
client = (Client) clients.get(i);
|
||||||
|
if(client.getArea()==area && client.getRoom()==room && client.getSlot()==slot && client.getHostFlag()==1) {
|
||||||
|
return client;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getPlayerStats(int area, int room, int slotnr) {
|
||||||
|
ByteBuffer retval = ByteBuffer.wrap(new byte[1024]);
|
||||||
|
|
||||||
|
byte playercnt = (byte) (this.countPlayersInSlot(area, room, slotnr) & 0xff);
|
||||||
|
retval.putShort((short) slotnr);
|
||||||
|
retval.put((byte) 3); // ???
|
||||||
|
retval.put(playercnt);
|
||||||
|
|
||||||
|
for(int i = 0; i<clients.size(); i++) {
|
||||||
|
client = (Client) clients.get(i);
|
||||||
|
if(client.getArea()==area && client.getRoom()==room && client.getSlot() == slotnr) {
|
||||||
|
retval.put(client.getHNPair().getHNPair());
|
||||||
|
retval.putShort((short)client.getCharacterStats().length);
|
||||||
|
retval.put(client.getCharacterStats());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] r = new byte[retval.position()];
|
||||||
|
retval.rewind();
|
||||||
|
retval.get(r);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
// count players in a specific game
|
||||||
|
public int countPlayersInGame(int gamenr) {
|
||||||
|
int retval = 0;
|
||||||
|
for(int i = 0; i<clients.size(); i++) {
|
||||||
|
client = (Client) clients.get(i);
|
||||||
|
if(client.gamenumber == gamenr) retval++;
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Count players in given slot
|
||||||
|
public int countPlayersInSlot(int area, int room, int slotnr) {
|
||||||
|
int retval = 0;
|
||||||
|
for(int i = 0; i<clients.size(); i++) {
|
||||||
|
client = (Client) clients.get(i);
|
||||||
|
if(client.getArea() == area && client.getRoom() == room && client.getSlot() == slotnr) retval++;
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Count players in given room
|
||||||
|
public int countPlayersInRoom(int area, int room) {
|
||||||
|
int retval = 0;
|
||||||
|
for(int i = 0; i<clients.size(); i++) {
|
||||||
|
client = (Client) clients.get(i);
|
||||||
|
if(client.getArea() == area && client.getRoom() == room) retval++;
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
// count players in a given meeting room
|
||||||
|
public byte getPlayerCountAgl(int nr) {
|
||||||
|
byte retval = 0;
|
||||||
|
for(int i=0; i<clients.size(); i++)
|
||||||
|
if(((Client)clients.get(i)).gamenumber == nr)
|
||||||
|
retval++;
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
// count the players in a given area lobby
|
||||||
|
public int[] countPlayersInArea(int nr) {
|
||||||
|
// TODO: find out the unknown 3rd value. is it ingame ?
|
||||||
|
int retval[] = {0,0,0}; // arealobby, arearoom, ingame?
|
||||||
|
for(int i=0; i<clients.size(); i++) {
|
||||||
|
// right area
|
||||||
|
if(((Client)clients.get(i)).getArea() == nr) {
|
||||||
|
// in lobby or in room ?
|
||||||
|
if(((Client)clients.get(i)).getRoom() == 0) {
|
||||||
|
retval[0]++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
retval[1]++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (((Client)clients.get(i)).getArea() == 51) {
|
||||||
|
retval[2]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getClientStatus(byte[] handle) {
|
||||||
|
Client cl = this.findClientByHandle(handle);
|
||||||
|
|
||||||
|
// offline or playing
|
||||||
|
if(cl == null) return 0;
|
||||||
|
|
||||||
|
// ingame
|
||||||
|
if(cl.gamenumber != 0) return 3;
|
||||||
|
|
||||||
|
// assume online
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
152
bioserver/Commands.java
Normal file
152
bioserver/Commands.java
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
// Definitions for the protocol
|
||||||
|
public class Commands {
|
||||||
|
|
||||||
|
final static byte SERVER = (byte) 0x18; // a packet from the server
|
||||||
|
final static byte CLIENT = (byte) 0x81; // a packet from the client
|
||||||
|
final static byte GAMESERVER = (byte) 0x28; // a packet from the gameserver
|
||||||
|
final static byte GAMECLIENT = (byte) 0x82; // a packet from the gameclient
|
||||||
|
|
||||||
|
final static byte QUERY = 0x01; // ask a question
|
||||||
|
final static byte TELL = 0x02; // answer a question
|
||||||
|
final static byte BROADCAST = 0x10; // send a packet to all clients
|
||||||
|
|
||||||
|
final static int LOGIN = 0x6101;
|
||||||
|
final static int UNKN61A0 = 0x61A0; // TIMEOUTS ?
|
||||||
|
final static int CHECKVERSION = 0x6103; // check the clients version
|
||||||
|
final static int CHECKRND = 0x600E; // check random numbers
|
||||||
|
final static int UNKN61A1 = 0x61A1;
|
||||||
|
final static int IDHNPAIRS = 0x6131; // send available ID/HN pairs
|
||||||
|
|
||||||
|
final static int HNSELECT = 0x6132; // which pair shall be used
|
||||||
|
final static int UNKN6104 = 0x6104;
|
||||||
|
final static int MOTHEDAY = 0x614C; // message of the day, kind of html/xml used
|
||||||
|
|
||||||
|
final static int CHARSELECT = 0x6190; // selected char and its statistics
|
||||||
|
final static int UNKN6881 = 0x6881;
|
||||||
|
final static int UNKN6882 = 0x6882;
|
||||||
|
final static int RANKINGS = 0x6145; // playerranking one can see in the area lobby
|
||||||
|
final static int UNKN6141 = 0x6141;
|
||||||
|
final static int AREACOUNT = 0x6203; // how many areas has this server
|
||||||
|
final static int AREAPLAYERCNT = 0x6205; // number of players in the area
|
||||||
|
final static int AREASTATUS = 0x6206; // area available (0) or locked (3)
|
||||||
|
final static int AREANAME = 0x6204; // name of the area
|
||||||
|
final static int AREADESCRIPT = 0x620A; // descripton of the area
|
||||||
|
final static int HEARTBEAT = 0x6202; // send every 30 secs to the clients
|
||||||
|
|
||||||
|
final static int AREASELECT = 0x6207; // choose area
|
||||||
|
final static int EXITAREA = 0x6209; // leave the roomlist (back to arealist)
|
||||||
|
final static int ROOMSCOUNT = 0x6301; // rooms in area
|
||||||
|
final static int ROOMPLAYERCNT = 0x6303;
|
||||||
|
final static int ROOMSTATUS = 0x6304; // status of a room
|
||||||
|
final static int ROOMNAME = 0x6302; // Name of a room
|
||||||
|
final static int UNKN6308 = 0x6308;
|
||||||
|
|
||||||
|
final static int ENTERROOM = 0x6305;
|
||||||
|
final static int SLOTCOUNT = 0x6401; // How many gameslots are in the room ?
|
||||||
|
final static int SLOTPLRSTATUS = 0x6403; // how many players are in slot / available in slot ?
|
||||||
|
final static int SLOTSTATUS = 0x6404; // is slot available, used or full ?
|
||||||
|
final static int SLOTTITLE = 0x6402; // title of the gameslot
|
||||||
|
final static int SLOTATTRIB2 = 0x640B;
|
||||||
|
final static int SLOTPWDPROT = 0x6405; // flag for password protection
|
||||||
|
final static int SLOTSCENTYPE = 0x650A; // scenario and type (DVD/HDD) for this slot
|
||||||
|
|
||||||
|
final static int RULESCOUNT = 0x6603; // how many rules are there for slot ?
|
||||||
|
final static int RULEATTCOUNT = 0x6607; // how many attributes has a rule ?
|
||||||
|
final static int UNKN6601 = 0x6601;
|
||||||
|
final static int UNKN6602 = 0x6602;
|
||||||
|
final static int RULEDESCRIPT = 0x6604; // name of the rule
|
||||||
|
final static int RULEVALUE = 0x6606; // get value of rule
|
||||||
|
final static int RULEATTRIB = 0x6605; // additional attribute 2 of rule
|
||||||
|
final static int ATTRDESCRIPT = 0x6608; // name of the choice
|
||||||
|
final static int ATTRATTRIB = 0x660E; // attribute of the choice (always 0?)
|
||||||
|
final static int PLAYERSTATS = 0x640A; // statistics of players in room
|
||||||
|
final static int EXITSLOTLIST = 0x6408; // leave the slotlist (back to roomlist)
|
||||||
|
|
||||||
|
final static int CREATESLOT = 0x6407; // create a new slot
|
||||||
|
final static int SCENESELECT = 0x6509; // select scenario for slot
|
||||||
|
final static int SLOTNAME = 0x6609; // set name of the slot
|
||||||
|
final static int SETRULE = 0x660B; // set rule for gameslot
|
||||||
|
final static int UNKN660C = 0x660C;
|
||||||
|
final static int SLOTTIMER = 0x6409; // wait time for a gameslot
|
||||||
|
final static int UNKN6412 = 0x6412;
|
||||||
|
final static int UNKN6504 = 0x6504;
|
||||||
|
final static int CANCELSLOT = 0x6501; // cancel game in slot
|
||||||
|
final static int LEAVESLOT = 0x6502; // leave slot
|
||||||
|
final static int PLAYERSTATBC = 0x6503; // broadcasting statistics of a joining player
|
||||||
|
final static int CANCELSLOTBC = 0x6505; // broadcast when host cancels slot
|
||||||
|
final static int PLAYEROK = 0x6506; // broadcast when player is "unlocked"
|
||||||
|
final static int STARTGAME = 0x6508; // broadcast by host when game will be started
|
||||||
|
|
||||||
|
final static int CHATIN = 0x6701; // chat message from a client
|
||||||
|
final static int CHATOUT = 0x6702; // chat mesage from server
|
||||||
|
|
||||||
|
final static int GETREADY = 0x6910; // broadcasted by server, clients request game details then
|
||||||
|
final static int PLAYERCOUNT = 0x6911; // total number of players for the gamesession
|
||||||
|
final static int PLAYERNUMBER = 0x6912; // number of player
|
||||||
|
final static int PLAYERSTAT = 0x6913; // statistic of a player in slot
|
||||||
|
final static int PLAYERSCORE = 0x6917; // scoring from the ranklist for a player
|
||||||
|
final static int GAMESESSION = 0x6915; // the session number for this game
|
||||||
|
final static int GAMEDIFF = 0x6914; // difficulty of the game
|
||||||
|
final static int GSINFO = 0x6916; // gameserver info (192.168.2.1:8590)
|
||||||
|
final static int UNKN6002 = 0x6002;
|
||||||
|
|
||||||
|
final static int ENTERAGL = 0x6210; // entering the aftergame
|
||||||
|
final static int AGLSTATS = 0x6213; // stats after the game
|
||||||
|
final static int AGLPLAYERCNT = 0x6212; // number of players in aftergame lobby
|
||||||
|
final static int LEAVEAGL = 0x6211; // leave after game lobby ?
|
||||||
|
final static int JOINGAME = 0x6406; // joining a slot not as host
|
||||||
|
final static int AGLLEAVE = 0x6214; // broadcasting that a player left
|
||||||
|
final static int AGLJOIN = 0x6215; // broadcast stats of client to aftergame lobby
|
||||||
|
final static int GETINFO = 0x6801; // request the information
|
||||||
|
|
||||||
|
final static int EVENTDAT = 0x670D;
|
||||||
|
final static int EVENTDATBC = 0x670E;
|
||||||
|
|
||||||
|
final static int BUDDYLIST = 0x6707; // check status of a buddy
|
||||||
|
final static int CHECKBUDDY = 0x6703; // online status checker
|
||||||
|
final static int PRIVATEMSG = 0x6704; // private messaging
|
||||||
|
final static int PRIVATEMSGBC = 0x6705; // broadcast of the private msg
|
||||||
|
|
||||||
|
final static int UNKN6181 = 0x6181; // unknown, deep in the database functions ...
|
||||||
|
// something along registration ?
|
||||||
|
|
||||||
|
final static int CONNCHECK = 0x6001; // send every 60 secs to client
|
||||||
|
|
||||||
|
final static int LOGOUT = 0x6006;
|
||||||
|
final static int SLOTPASSWD = 0x660A; // set passowrd for slot
|
||||||
|
|
||||||
|
final static int POSTGAMEINFO = 0x6138; // statistics for the played game, used for rankings
|
||||||
|
|
||||||
|
final static int PATCHSTART = 0x6121; // indicates the start of a ptch file
|
||||||
|
final static int PATCHDATA = 0x6122; // block of 0x100 bytes patch
|
||||||
|
final static int PATCHFOOTER = 0x6123; // indicate the end of a patch file
|
||||||
|
final static int PATCHLINECHECK = 0x6124; // after 8 blocks of patchdata this check packet occurs
|
||||||
|
final static int PATCHFINISH = 0x6125; // done ...
|
||||||
|
|
||||||
|
final static int SHUTDOWN = 0x6003; // shutdown a client and put notice on screen
|
||||||
|
|
||||||
|
// packets for gameserver
|
||||||
|
final static int GSLOGIN = 0x1031; // first login packet for gameserver
|
||||||
|
}
|
||||||
69
bioserver/Configuration.java
Normal file
69
bioserver/Configuration.java
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration
|
||||||
|
* reads config.properties in the same directory folder
|
||||||
|
*/
|
||||||
|
public class Configuration {
|
||||||
|
public String gs_ip;
|
||||||
|
public String db_user;
|
||||||
|
public String db_password;
|
||||||
|
|
||||||
|
// constructor
|
||||||
|
public Configuration() {
|
||||||
|
InputStream inputStream = null;
|
||||||
|
Properties prop = new Properties();
|
||||||
|
String propFileName = "config.properties";
|
||||||
|
|
||||||
|
try {
|
||||||
|
inputStream = new FileInputStream(propFileName);
|
||||||
|
prop.load(inputStream);
|
||||||
|
|
||||||
|
this.gs_ip = prop.getProperty("gs_ip");
|
||||||
|
this.db_user = prop.getProperty("db_user");
|
||||||
|
this.db_password = prop.getProperty("db_password");
|
||||||
|
|
||||||
|
} catch (FileNotFoundException ex) {
|
||||||
|
Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
} catch (IOException ex) {
|
||||||
|
Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
} finally {
|
||||||
|
if (inputStream != null) {
|
||||||
|
try {
|
||||||
|
inputStream.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("Exception: " + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
393
bioserver/Database.java
Normal file
393
bioserver/Database.java
Normal file
@@ -0,0 +1,393 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import com.mysql.jdbc.Connection;
|
||||||
|
import com.mysql.jdbc.PreparedStatement;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.sql.DriverManager;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* class for managing the database
|
||||||
|
*/
|
||||||
|
public class Database {
|
||||||
|
// TODO: read from ini-file, don't save credentials in class!
|
||||||
|
private final String url = "jdbc:mysql://localhost:3306/bioserver"
|
||||||
|
+"?useUnicode=true&characterEncoding=UTF-8";
|
||||||
|
private String user = "bioserver";
|
||||||
|
private String password = "xxxxxxxxxxxxxxxx";
|
||||||
|
|
||||||
|
private Connection con = null;
|
||||||
|
|
||||||
|
// simple constructor to create a reusable connection to the database
|
||||||
|
public Database(String db_user, String db_password) {
|
||||||
|
this.user = db_user;
|
||||||
|
this.password = db_password;
|
||||||
|
|
||||||
|
try {
|
||||||
|
con = (Connection) DriverManager.getConnection(url, user, password);
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// setup some things on server restart
|
||||||
|
// set area to -1, rooms, slots and gamesessions to 0
|
||||||
|
this.setupDBrestart();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// test connection and create a new one on failure
|
||||||
|
private void testConnection() {
|
||||||
|
PreparedStatement pst = null;
|
||||||
|
try {
|
||||||
|
pst = (PreparedStatement) con.prepareStatement("select 1;");
|
||||||
|
pst.executeQuery();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
try {
|
||||||
|
if (pst != null) {
|
||||||
|
pst.close();
|
||||||
|
}
|
||||||
|
if (con != null) {
|
||||||
|
con.close();
|
||||||
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, e);
|
||||||
|
}
|
||||||
|
// create a new connection
|
||||||
|
try {
|
||||||
|
this.con = (Connection) DriverManager.getConnection(url, user, password);
|
||||||
|
} catch (SQLException ex1) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.SEVERE, null, ex1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// get userid of an existing session
|
||||||
|
public String getUserid(String sessid) {
|
||||||
|
ResultSet rs = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
|
// check it out ;-)
|
||||||
|
this.testConnection();
|
||||||
|
|
||||||
|
String retval = "";
|
||||||
|
try {
|
||||||
|
pst = (PreparedStatement) con.prepareStatement(String.format("select userid from sessions where sessid='%s'", sessid));
|
||||||
|
rs = pst.executeQuery();
|
||||||
|
if(rs.next()){
|
||||||
|
retval = rs.getString("userid");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if(rs != null) {
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
if(pst != null) {
|
||||||
|
pst.close();
|
||||||
|
}
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// get handle/nickname list for a given userid
|
||||||
|
public HNPairs getHNPairs(String userid) {
|
||||||
|
ResultSet rs = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
|
HNPairs hns = new HNPairs();
|
||||||
|
String nickname;
|
||||||
|
|
||||||
|
try {
|
||||||
|
pst = (PreparedStatement) con.prepareStatement(String.format("select handle,nickname from hnpairs where userid='%s' limit 0,3", userid));
|
||||||
|
rs = pst.executeQuery();
|
||||||
|
while(rs.next()){
|
||||||
|
hns.add(new HNPair(rs.getString("handle"), rs.getString("nickname")));
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if(rs != null) {
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
if(pst != null) {
|
||||||
|
pst.close();
|
||||||
|
}
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return hns;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// check if a handles exists
|
||||||
|
// returns true when handle is free
|
||||||
|
public boolean checkHandle(String handle) {
|
||||||
|
ResultSet rs = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
|
boolean retval = false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
pst = (PreparedStatement) con.prepareStatement(String.format("select count(*) as cnt from hnpairs where handle='%s'", handle));
|
||||||
|
rs = pst.executeQuery();
|
||||||
|
if(rs.next()){
|
||||||
|
if(rs.getInt("cnt") == 0) retval=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if(rs != null) {
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
if(pst != null) {
|
||||||
|
pst.close();
|
||||||
|
}
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// insert a new handle/nickname into database
|
||||||
|
public void createNewHNPair(Client cl) {
|
||||||
|
ResultSet rs = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
|
try {
|
||||||
|
String nickname;
|
||||||
|
try {
|
||||||
|
nickname = new String(cl.getHNPair().getNickname(),"SJIS");
|
||||||
|
} catch (UnsupportedEncodingException ex) {
|
||||||
|
nickname = "sjis";
|
||||||
|
}
|
||||||
|
pst = (PreparedStatement) con.prepareStatement(String.format("insert into hnpairs (userid,handle,nickname) values ('%s','%s','%s')",
|
||||||
|
cl.getUserID(), new String(cl.getHNPair().getHandle()), nickname));
|
||||||
|
pst.executeUpdate();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if(rs != null) {
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
if(pst != null) {
|
||||||
|
pst.close();
|
||||||
|
}
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// update handle/nickname of a client
|
||||||
|
public void updateHNPair(Client cl) {
|
||||||
|
ResultSet rs = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
|
String nickname;
|
||||||
|
try {
|
||||||
|
nickname = new String(cl.getHNPair().getNickname(),"SJIS");
|
||||||
|
} catch (UnsupportedEncodingException ex) {
|
||||||
|
nickname = "sjis";
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
pst = (PreparedStatement) con.prepareStatement(String.format("update hnpairs set nickname='%s' where userid='%s' and handle='%s'",
|
||||||
|
nickname, cl.getUserID(), new String(cl.getHNPair().getHandle())));
|
||||||
|
pst.executeUpdate();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if(rs != null) {
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
if(pst != null) {
|
||||||
|
pst.close();
|
||||||
|
}
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// set area, room, slot for a user
|
||||||
|
private void setupDBrestart() {
|
||||||
|
ResultSet rs = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
|
try {
|
||||||
|
pst = (PreparedStatement) con.prepareStatement("update sessions set area=-1, room=0, slot=0, gamesess=0, state=0");
|
||||||
|
pst.executeUpdate();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if(rs != null) {
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
if(pst != null) {
|
||||||
|
pst.close();
|
||||||
|
}
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// set area, room, slot for a user and a state
|
||||||
|
public void updateClientOrigin(String userid, int state, int area, int room, int slot) {
|
||||||
|
ResultSet rs = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
|
try {
|
||||||
|
pst = (PreparedStatement) con.prepareStatement("update sessions set state=?, area=?, room=?, slot=? where userid=?");
|
||||||
|
pst.setInt(1, state);
|
||||||
|
pst.setInt(2, area);
|
||||||
|
pst.setInt(3, room);
|
||||||
|
pst.setInt(4, slot);
|
||||||
|
pst.setString(5, userid);
|
||||||
|
pst.executeUpdate();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if(rs != null) {
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
if(pst != null) {
|
||||||
|
pst.close();
|
||||||
|
}
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// set game for a user
|
||||||
|
public void updateClientGame(String userid, int gamenumber) {
|
||||||
|
ResultSet rs = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
|
try {
|
||||||
|
String gamenum = (new Integer(gamenumber)).toString(); // TODO: I hate Java for this!
|
||||||
|
pst = (PreparedStatement) con.prepareStatement(String.format("update sessions set gamesess='%s' where userid='%s'", gamenum, userid));
|
||||||
|
pst.executeUpdate();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if(rs != null) {
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
if(pst != null) {
|
||||||
|
pst.close();
|
||||||
|
}
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// get the gamenumber of a given userid
|
||||||
|
public int getGameNumber(String userid) {
|
||||||
|
ResultSet rs = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
|
int retval = 0;
|
||||||
|
try {
|
||||||
|
pst = (PreparedStatement) con.prepareStatement(String.format("select gamesess from sessions where userid='%s'", userid));
|
||||||
|
rs = pst.executeQuery();
|
||||||
|
if(rs.next()){
|
||||||
|
retval = rs.getInt("gamesess");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if(rs != null) {
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
if(pst != null) {
|
||||||
|
pst.close();
|
||||||
|
}
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// get message of the day
|
||||||
|
public String getMOTD() {
|
||||||
|
ResultSet rs = null;
|
||||||
|
PreparedStatement pst = null;
|
||||||
|
// check it out ;-)
|
||||||
|
this.testConnection();
|
||||||
|
|
||||||
|
String retval = "";
|
||||||
|
try {
|
||||||
|
pst = (PreparedStatement) con.prepareStatement("select message from motd where active=1 order by id desc limit 0,1");
|
||||||
|
rs = pst.executeQuery();
|
||||||
|
if(rs.next()){
|
||||||
|
retval = rs.getString("message");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if(rs != null) {
|
||||||
|
rs.close();
|
||||||
|
}
|
||||||
|
if(pst != null) {
|
||||||
|
pst.close();
|
||||||
|
}
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
Logger.getLogger(Database.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
38
bioserver/GameServerDataEvent.java
Normal file
38
bioserver/GameServerDataEvent.java
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.nio.channels.SocketChannel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object for the packet server is sending
|
||||||
|
*/
|
||||||
|
class GameServerDataEvent {
|
||||||
|
public GameServerThread server;
|
||||||
|
public SocketChannel socket;
|
||||||
|
public byte[] data;
|
||||||
|
|
||||||
|
public GameServerDataEvent(GameServerThread server, SocketChannel socket, byte[] data) {
|
||||||
|
this.server = server;
|
||||||
|
this.socket = socket;
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
246
bioserver/GameServerPacketHandler.java
Normal file
246
bioserver/GameServerPacketHandler.java
Normal file
@@ -0,0 +1,246 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.nio.channels.SocketChannel;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Process messages
|
||||||
|
*/
|
||||||
|
class GameServerPacketHandler implements Runnable {
|
||||||
|
// database for sessionhandling
|
||||||
|
private Database db;
|
||||||
|
|
||||||
|
// the list with packets :-)
|
||||||
|
private List queue = new LinkedList();
|
||||||
|
|
||||||
|
// list of connected clients
|
||||||
|
private ClientList clients = new ClientList();
|
||||||
|
|
||||||
|
// server packet id if needed
|
||||||
|
private int packetidcounter;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
GameServerDataEvent dataEvent;
|
||||||
|
// get configuration
|
||||||
|
Configuration conf = new Configuration();
|
||||||
|
|
||||||
|
this.db = new Database(conf.db_user, conf.db_password);
|
||||||
|
packetidcounter = 0;
|
||||||
|
|
||||||
|
while(true) {
|
||||||
|
// Wait for data to become available
|
||||||
|
synchronized(queue) {
|
||||||
|
while(queue.isEmpty()) {
|
||||||
|
try {
|
||||||
|
queue.wait();
|
||||||
|
} catch (InterruptedException e) { }
|
||||||
|
}
|
||||||
|
dataEvent = (GameServerDataEvent) queue.remove(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// send the data
|
||||||
|
dataEvent.server.send(dataEvent.socket, dataEvent.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int countInGamePlayers () {
|
||||||
|
return clients.getList().size();
|
||||||
|
}
|
||||||
|
|
||||||
|
// simple getter to let the serverthread manage disconnected clients
|
||||||
|
public ClientList getClients() {
|
||||||
|
return clients;
|
||||||
|
}
|
||||||
|
|
||||||
|
// increase the server packet id
|
||||||
|
public int getNextPacketID() {
|
||||||
|
return(++packetidcounter);
|
||||||
|
}
|
||||||
|
|
||||||
|
// here comes the raw packet data and is tranformed into messages
|
||||||
|
void processData(GameServerThread server, SocketChannel socket, byte[] data, int count) {
|
||||||
|
switch(data[0]) {
|
||||||
|
case (byte)0x82:
|
||||||
|
if(data[1] == 0x02) {
|
||||||
|
// some session checking etc.
|
||||||
|
Packet p = new Packet(data);
|
||||||
|
if(p.getCmd() == Commands.GSLOGIN) {
|
||||||
|
// check this session and if ok create client
|
||||||
|
if(!check_session(server, socket, p)) {
|
||||||
|
Logging.println("Session check gameserver failed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// broadcast to connected clients in gamesession but not the sender
|
||||||
|
byte[] acopy = new byte[count];
|
||||||
|
System.arraycopy(data, 0, acopy, 0, count);
|
||||||
|
|
||||||
|
Client cl = clients.findClient(socket);
|
||||||
|
cl.connalive = true;
|
||||||
|
int gamenum = cl.gamenumber;
|
||||||
|
List cls = clients.getList();
|
||||||
|
synchronized(queue) {
|
||||||
|
for(int i=0; i<cls.size(); i++) {
|
||||||
|
cl = (Client) cls.get(i);
|
||||||
|
if(cl.gamenumber==gamenum && cl.getSocket()!=socket) {
|
||||||
|
queue.add(new GameServerDataEvent(server, cl.getSocket(), acopy));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
queue.notify();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add a packet to the queue
|
||||||
|
void addOutPacket(GameServerThread server, SocketChannel socket, Packet packet) {
|
||||||
|
synchronized(queue) {
|
||||||
|
queue.add(new GameServerDataEvent(server, socket, packet.getPacketData()));
|
||||||
|
queue.notify();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// broadcast a packet to all connected clients
|
||||||
|
void broadcastPacket(GameServerThread server, Packet packet) {
|
||||||
|
List cls = clients.getList();
|
||||||
|
synchronized(queue) {
|
||||||
|
for(int i=0; i<cls.size(); i++) {
|
||||||
|
Client cl = (Client) cls.get(i);
|
||||||
|
queue.add(new GameServerDataEvent(server, cl.getSocket(), packet.getPacketData()));
|
||||||
|
}
|
||||||
|
queue.notify();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void GSsendLogin(GameServerThread server, SocketChannel socket) {
|
||||||
|
Packet p = new Packet(Commands.GSLOGIN, Commands.QUERY, Commands.GAMESERVER, this.getNextPacketID());
|
||||||
|
this.addOutPacket(server, socket, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
// check the login for gameserver!
|
||||||
|
private boolean check_session(GameServerThread server, SocketChannel socket, Packet p) {
|
||||||
|
int seed = p.getPacketID();
|
||||||
|
int sessA = ((int) p.getPayload()[0] - 0x30)*10000
|
||||||
|
+((int) p.getPayload()[1] - 0x30)*1000
|
||||||
|
+((int) p.getPayload()[2] - 0x30)*100
|
||||||
|
+((int) p.getPayload()[3] - 0x30)*10
|
||||||
|
+((int) p.getPayload()[4] - 0x30);
|
||||||
|
int sessB = ((int) p.getPayload()[5] - 0x30)*10000
|
||||||
|
+((int) p.getPayload()[6] - 0x30)*1000
|
||||||
|
+((int) p.getPayload()[7] - 0x30)*100
|
||||||
|
+((int) p.getPayload()[8] - 0x30)*10
|
||||||
|
+((int) p.getPayload()[9] - 0x30);
|
||||||
|
String session = String.format("%04d%04d", sessA-seed, sessB-seed);
|
||||||
|
|
||||||
|
String userid = db.getUserid(session);
|
||||||
|
int gamenr = 0;
|
||||||
|
|
||||||
|
Client cl;
|
||||||
|
|
||||||
|
// session check is OK, a user with this session is in database
|
||||||
|
if(!"".equals(userid)) {
|
||||||
|
// kill old connections of this client
|
||||||
|
cl = clients.findClient(userid);
|
||||||
|
if(cl != null) {
|
||||||
|
List cls = clients.getList();
|
||||||
|
for(int i=0; i<cls.size(); i++) {
|
||||||
|
cl = (Client) cls.get(i);
|
||||||
|
if(cl.getUserID().equals(userid)) {
|
||||||
|
Logging.println("GS: Disconnect double session for userid "+userid);
|
||||||
|
server.disconnect(cl.getSocket());
|
||||||
|
this.removeClient(server, cl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// setup client object for this user/session
|
||||||
|
gamenr = db.getGameNumber(userid);
|
||||||
|
clients.add((new Client(socket, userid, session)));
|
||||||
|
cl = clients.findClient(socket);
|
||||||
|
cl.gamenumber = gamenr;
|
||||||
|
|
||||||
|
// set this user to ingame status
|
||||||
|
db.updateClientOrigin(userid, PacketHandler.STATUS_GAME, 0, 0, 0);
|
||||||
|
return(true);
|
||||||
|
} else {
|
||||||
|
// the session check failed, disconnect this client
|
||||||
|
Logging.println("GS: Disconnect invalid session "+session+" for userid "+userid);
|
||||||
|
server.disconnect(socket);
|
||||||
|
return(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove client by userid
|
||||||
|
public void removeClient(GameServerThread server, String userid) {
|
||||||
|
Client cl = clients.findClient(userid);
|
||||||
|
if(cl == null) {
|
||||||
|
Logging.println("GS: kicking of " + userid + " failed, missing connection");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.removeClient(server, cl);
|
||||||
|
Logging.println("GS: " + userid + " kicked");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeNoDisconnectClient(GameServerThread server, SocketChannel socket) {
|
||||||
|
Client cl = clients.findClient(socket);
|
||||||
|
// set user to offline status in database
|
||||||
|
db.updateClientOrigin(cl.getUserID(), PacketHandler.STATUS_OFFLINE, -1, 0, 0);
|
||||||
|
clients.remove(cl);
|
||||||
|
}
|
||||||
|
|
||||||
|
// when a host or client leaves unexpected, we have to handle this
|
||||||
|
public void removeClient(GameServerThread server, Client cl) {
|
||||||
|
if(cl == null) return;
|
||||||
|
|
||||||
|
SocketChannel socket = cl.getSocket();
|
||||||
|
// set user to offline status in database
|
||||||
|
db.updateClientOrigin(cl.getUserID(), PacketHandler.STATUS_OFFLINE, -1, 0, 0);
|
||||||
|
clients.remove(cl);
|
||||||
|
|
||||||
|
// close connection from server side
|
||||||
|
server.disconnect(socket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// check for frozen players and remove their connection after one minute
|
||||||
|
public void connCheck(GameServerThread server) {
|
||||||
|
List cls = clients.getList();
|
||||||
|
for(int i=0; i<cls.size(); i++) {
|
||||||
|
Client cl = (Client) cls.get(i);
|
||||||
|
// check if connection is alive and initiate next check
|
||||||
|
// the connection flag is set to true by every incoming new packet
|
||||||
|
if(cl.connalive) {
|
||||||
|
cl.connalive = false;
|
||||||
|
} else {
|
||||||
|
// this client left us :-(
|
||||||
|
Logging.println("GS connCheck: trying to remove " + cl.getUserID());
|
||||||
|
this.removeClient(server, cl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
300
bioserver/GameServerThread.java
Normal file
300
bioserver/GameServerThread.java
Normal file
@@ -0,0 +1,300 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.channels.SelectionKey;
|
||||||
|
import java.nio.channels.Selector;
|
||||||
|
import java.nio.channels.ServerSocketChannel;
|
||||||
|
import java.nio.channels.SocketChannel;
|
||||||
|
import java.nio.channels.spi.SelectorProvider;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
class GameServerThread implements Runnable {
|
||||||
|
// host:port combination to listen
|
||||||
|
private InetAddress hostAddress;
|
||||||
|
private int port;
|
||||||
|
|
||||||
|
// selector to monitor
|
||||||
|
private Selector selector;
|
||||||
|
|
||||||
|
// The channel on which we'll accept connections
|
||||||
|
private ServerSocketChannel serverChannel;
|
||||||
|
|
||||||
|
// thread of the packethandler
|
||||||
|
private GameServerPacketHandler packethandler;
|
||||||
|
|
||||||
|
// A list of ChangeRequest instances
|
||||||
|
private List changeRequests = new LinkedList();
|
||||||
|
|
||||||
|
// Maps a SocketChannel to a list of ByteBuffer instances
|
||||||
|
private Map pendingData = new HashMap();
|
||||||
|
|
||||||
|
// The buffer into which we'll read data when it's available
|
||||||
|
private ServerStreamBuffer readBuffer;
|
||||||
|
|
||||||
|
// Maps a SocketChannel to a ServerStreamBuffer (allows messaging)
|
||||||
|
private Map readbuffers = new HashMap();
|
||||||
|
|
||||||
|
// was initialisation ok ?
|
||||||
|
private boolean initOK;
|
||||||
|
|
||||||
|
// function to initialise the selector
|
||||||
|
private Selector initSelector() throws IOException {
|
||||||
|
// Create a new selector
|
||||||
|
Selector socketSelector = SelectorProvider.provider().openSelector();
|
||||||
|
|
||||||
|
// Create a new non-blocking server socket channel
|
||||||
|
this.serverChannel = ServerSocketChannel.open();
|
||||||
|
serverChannel.configureBlocking(false);
|
||||||
|
|
||||||
|
// Bind the server socket to the specified address and port
|
||||||
|
InetSocketAddress isa = new InetSocketAddress(this.hostAddress, this.port);
|
||||||
|
serverChannel.socket().bind(isa);
|
||||||
|
|
||||||
|
// Register the server socket channel, indicating an interest in
|
||||||
|
// accepting new connections
|
||||||
|
serverChannel.register(socketSelector, SelectionKey.OP_ACCEPT);
|
||||||
|
|
||||||
|
return socketSelector;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GameServerThread(InetAddress hostAddress, int port, GameServerPacketHandler packethandler) {
|
||||||
|
this.initOK = true;
|
||||||
|
try {
|
||||||
|
this.hostAddress = hostAddress;
|
||||||
|
this.port = port;
|
||||||
|
this.selector = this.initSelector();
|
||||||
|
this.packethandler = packethandler;
|
||||||
|
} catch (IOException ex) {
|
||||||
|
Logging.println("Gameserver constructor exception caught!");
|
||||||
|
this.initOK = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// iteration of selector, deal accept, read and write
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
SelectionKey key;
|
||||||
|
|
||||||
|
while (this.initOK) {
|
||||||
|
try {
|
||||||
|
// Process any pending changes
|
||||||
|
synchronized(this.changeRequests) {
|
||||||
|
Iterator changes = this.changeRequests.iterator();
|
||||||
|
while (changes.hasNext()) {
|
||||||
|
ServerChangeEvent change = (ServerChangeEvent) changes.next();
|
||||||
|
key = change.socket.keyFor(this.selector);
|
||||||
|
if(key != null) {
|
||||||
|
if(key.isValid()) { // drop pending request for closed/cancelled channel
|
||||||
|
switch(change.type) {
|
||||||
|
case ServerChangeEvent.CHANGEOPS:
|
||||||
|
key.interestOps(change.ops);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ServerChangeEvent.FORCECLOSE:
|
||||||
|
this.close(key);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.changeRequests.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for an event on the registered channels
|
||||||
|
this.selector.select();
|
||||||
|
|
||||||
|
// Iterate over the set of keys for which events are available
|
||||||
|
Iterator selectedKeys = this.selector.selectedKeys().iterator();
|
||||||
|
while (selectedKeys.hasNext()) {
|
||||||
|
key = (SelectionKey) selectedKeys.next();
|
||||||
|
selectedKeys.remove();
|
||||||
|
|
||||||
|
if (!key.isValid()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check what event is available and deal with it
|
||||||
|
if (key.isValid() && key.isAcceptable()) {
|
||||||
|
this.accept(key);
|
||||||
|
} else if (key.isValid() && key.isReadable()) {
|
||||||
|
this.read(key);
|
||||||
|
} else if (key.isValid() && key.isWritable()) {
|
||||||
|
this.write(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logging.println("Gameserver iteration exception caught!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// closing a connection
|
||||||
|
private void close(SelectionKey key) throws IOException {
|
||||||
|
try {
|
||||||
|
SocketChannel socketChannel = (SocketChannel) key.channel();
|
||||||
|
Logging.println("Gameserver closes connection to :" + socketChannel.getRemoteAddress());
|
||||||
|
key.channel().close();
|
||||||
|
key.cancel();
|
||||||
|
|
||||||
|
// cleanup
|
||||||
|
this.readbuffers.remove(socketChannel);
|
||||||
|
this.pendingData.remove(socketChannel);
|
||||||
|
this.packethandler.removeNoDisconnectClient(this, socketChannel);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// nothing ...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// accepting a new connection
|
||||||
|
private void accept(SelectionKey key) throws IOException {
|
||||||
|
// For an accept to be pending the channel must be a server socket channel.
|
||||||
|
ServerSocketChannel serverSocketChannel = (ServerSocketChannel) key.channel();
|
||||||
|
|
||||||
|
// Accept the connection and make it non-blocking
|
||||||
|
SocketChannel socketChannel = serverSocketChannel.accept();
|
||||||
|
Socket socket = socketChannel.socket();
|
||||||
|
socketChannel.configureBlocking(false);
|
||||||
|
|
||||||
|
// Register the new SocketChannel with our Selector, indicating
|
||||||
|
// we'd like to be notified when there's data waiting to be read
|
||||||
|
socketChannel.register(this.selector, SelectionKey.OP_READ);
|
||||||
|
|
||||||
|
// and we need a readbuffer for this channel
|
||||||
|
if(readbuffers.get(socketChannel) == null) {
|
||||||
|
readbuffers.put(socketChannel, new ServerStreamBuffer());
|
||||||
|
}
|
||||||
|
|
||||||
|
// send the first packet to initiate the protocol
|
||||||
|
this.packethandler.GSsendLogin(this, socketChannel);
|
||||||
|
}
|
||||||
|
|
||||||
|
// read from socket
|
||||||
|
private void read(SelectionKey key) throws IOException {
|
||||||
|
SocketChannel socketChannel = (SocketChannel) key.channel();
|
||||||
|
int numRead;
|
||||||
|
|
||||||
|
// get the buffer for this channel
|
||||||
|
this.readBuffer = (ServerStreamBuffer) readbuffers.get(socketChannel);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// read / append to buffer
|
||||||
|
numRead = socketChannel.read(this.readBuffer.buf);
|
||||||
|
} catch (IOException e) {
|
||||||
|
// The remote forcibly closed the connection, cancel
|
||||||
|
// the selection key and close the channel.
|
||||||
|
// also remove this client list
|
||||||
|
this.close(key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (numRead == -1) {
|
||||||
|
// Remote entity shut the socket down cleanly. Do the
|
||||||
|
// same from our end and cancel the channel.
|
||||||
|
this.close(key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hand the data off to our worker thread
|
||||||
|
byte[] data = this.readBuffer.getCompleteGameMessages();
|
||||||
|
if(data != null) this.packethandler.processData(this, socketChannel, data, data.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// write to socket
|
||||||
|
private void write(SelectionKey key) throws IOException {
|
||||||
|
SocketChannel socketChannel = (SocketChannel) key.channel();
|
||||||
|
|
||||||
|
synchronized (this.pendingData) {
|
||||||
|
List queue = (List) this.pendingData.get(socketChannel);
|
||||||
|
|
||||||
|
// Write until there's not more data ...
|
||||||
|
while (!queue.isEmpty()) {
|
||||||
|
ByteBuffer buf = (ByteBuffer) queue.get(0);
|
||||||
|
try {
|
||||||
|
socketChannel.write(buf);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// something's wrong on writing, e.g. timeout
|
||||||
|
queue.clear();
|
||||||
|
this.close(key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (buf.remaining() > 0) {
|
||||||
|
// ... or the socket's buffer fills up
|
||||||
|
queue.clear();
|
||||||
|
this.close(key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
queue.remove(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (queue.isEmpty()) {
|
||||||
|
// We wrote away all data, so we're no longer interested
|
||||||
|
// in writing on this socket. Switch back to waiting for
|
||||||
|
// data.
|
||||||
|
key.interestOps(SelectionKey.OP_READ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// send to a connection
|
||||||
|
public void send(SocketChannel socket, byte[] data) {
|
||||||
|
synchronized (this.changeRequests) {
|
||||||
|
// Indicate we want the interest ops set changed
|
||||||
|
this.changeRequests.add(new ServerChangeEvent(socket, ServerChangeEvent.CHANGEOPS, SelectionKey.OP_WRITE));
|
||||||
|
|
||||||
|
// And queue the data we want written
|
||||||
|
synchronized (this.pendingData) {
|
||||||
|
List queue = (List) this.pendingData.get(socket);
|
||||||
|
if (queue == null) {
|
||||||
|
queue = new ArrayList();
|
||||||
|
this.pendingData.put(socket, queue);
|
||||||
|
}
|
||||||
|
queue.add(ByteBuffer.wrap(data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Finally, wake up our selecting thread so it can make the required changes
|
||||||
|
this.selector.wakeup();
|
||||||
|
}
|
||||||
|
|
||||||
|
// close a connection server sided
|
||||||
|
public void disconnect(SocketChannel socket) {
|
||||||
|
synchronized (this.changeRequests) {
|
||||||
|
this.changeRequests.add(new ServerChangeEvent(socket, ServerChangeEvent.FORCECLOSE, 0));
|
||||||
|
}
|
||||||
|
this.selector.wakeup();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
84
bioserver/HNPair.java
Normal file
84
bioserver/HNPair.java
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle / Nickname pair
|
||||||
|
*/
|
||||||
|
public class HNPair {
|
||||||
|
private byte[] handle;
|
||||||
|
private byte[] nickname;
|
||||||
|
|
||||||
|
// constructor for given handle and nickname Byte
|
||||||
|
public HNPair(byte[] handle, byte[] nickname) {
|
||||||
|
this.handle = handle;
|
||||||
|
this.nickname = nickname;
|
||||||
|
}
|
||||||
|
|
||||||
|
// constructor for given handle and nickname array
|
||||||
|
public HNPair(String handle, String nickname) {
|
||||||
|
this.handle = handle.getBytes();
|
||||||
|
try {
|
||||||
|
this.nickname = nickname.getBytes("SJIS");
|
||||||
|
} catch (UnsupportedEncodingException ex) {
|
||||||
|
this.nickname = "sjis".getBytes();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// create a random handle
|
||||||
|
public void createHandle(Database db) {
|
||||||
|
byte[] d = ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ").getBytes();
|
||||||
|
boolean flag = false;
|
||||||
|
while(!flag) {
|
||||||
|
for(int i=0; i<6; i++) {
|
||||||
|
Double dd = 36*Math.random();
|
||||||
|
this.handle[i] = d[dd.intValue()];
|
||||||
|
}
|
||||||
|
flag = db.checkHandle(handle.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getHandle() {
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getNickname() {
|
||||||
|
return nickname;
|
||||||
|
}
|
||||||
|
|
||||||
|
// create an array with the HNpair
|
||||||
|
public byte[] getHNPair() {
|
||||||
|
byte[] hnpair = new byte[handle.length + nickname.length + 4];
|
||||||
|
|
||||||
|
hnpair[0] = 0;
|
||||||
|
hnpair[1] = 6;
|
||||||
|
System.arraycopy(handle, 0, hnpair, 2, 6);
|
||||||
|
hnpair[8] = 0;
|
||||||
|
hnpair[9] = (byte) nickname.length;
|
||||||
|
System.arraycopy(nickname, 0, hnpair, 10, nickname.length);
|
||||||
|
|
||||||
|
return hnpair;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
64
bioserver/HNPairs.java
Normal file
64
bioserver/HNPairs.java
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* special class for multiple HNPairs
|
||||||
|
*/
|
||||||
|
public class HNPairs {
|
||||||
|
// byte number of ids (max 3)
|
||||||
|
// int length id (6)
|
||||||
|
// string id
|
||||||
|
// int length
|
||||||
|
// string handle (16)
|
||||||
|
// word end marker
|
||||||
|
|
||||||
|
// for simplicity we create a maxmimum buffer for 3 handles
|
||||||
|
private byte[] hnpairs = new byte[85];
|
||||||
|
private int count;
|
||||||
|
private int length;
|
||||||
|
|
||||||
|
public HNPairs() {
|
||||||
|
count = 0;
|
||||||
|
length = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getArray() {
|
||||||
|
hnpairs[0] = (byte) count; // set count
|
||||||
|
|
||||||
|
byte[] retval = new byte[length];
|
||||||
|
System.arraycopy(this.hnpairs, 0, retval, 0, length);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
// add a pair to buffer
|
||||||
|
public void add(HNPair hnpair) {
|
||||||
|
byte[] hn = hnpair.getHNPair();
|
||||||
|
|
||||||
|
System.arraycopy(hn, 0, hnpairs, length, hn.length);
|
||||||
|
length = length+hn.length;
|
||||||
|
hnpairs[length++] = 0;
|
||||||
|
hnpairs[length++] = 0; // add end marker
|
||||||
|
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
91
bioserver/HeartBeatThread.java
Normal file
91
bioserver/HeartBeatThread.java
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send a PING packet to all connected clients every 30 secs
|
||||||
|
*/
|
||||||
|
public class HeartBeatThread implements Runnable {
|
||||||
|
PacketHandler packethandler;
|
||||||
|
GameServerPacketHandler gspackethandler;
|
||||||
|
ServerThread server;
|
||||||
|
GameServerThread gsserver;
|
||||||
|
int counter, counter2;
|
||||||
|
|
||||||
|
public HeartBeatThread(ServerThread server, PacketHandler packethandler,
|
||||||
|
GameServerThread gsserver, GameServerPacketHandler packethandler2) {
|
||||||
|
this.packethandler = packethandler;
|
||||||
|
this.gspackethandler = packethandler2;
|
||||||
|
this.server = server;
|
||||||
|
this.gsserver = gsserver;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
counter = 0;
|
||||||
|
counter2 = 0;
|
||||||
|
|
||||||
|
try {
|
||||||
|
Thread.sleep(10*1000);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
Logger.getLogger(HeartBeatThread.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// loop forever
|
||||||
|
while(true) {
|
||||||
|
try {
|
||||||
|
// servers send every 30 secs that he is alive, no answer needed
|
||||||
|
packethandler.broadcastPing(server);
|
||||||
|
|
||||||
|
// remove dead clients in gameserver
|
||||||
|
gspackethandler.connCheck(gsserver);
|
||||||
|
|
||||||
|
// also check if any slots have to be autostarted
|
||||||
|
packethandler.checkAutoStart(server);
|
||||||
|
|
||||||
|
// server asks for client every 60 secs
|
||||||
|
// client will be deleted from list and disconnected if not answered
|
||||||
|
if(counter == 1) {
|
||||||
|
packethandler.broadcastConnCheck(server);
|
||||||
|
counter = 0;
|
||||||
|
} else {
|
||||||
|
counter++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// clean up the rooms every 5 minutes
|
||||||
|
if(counter2 == 9) {
|
||||||
|
packethandler.cleanGhostRooms(server);
|
||||||
|
counter2 = 0;
|
||||||
|
} else {
|
||||||
|
counter2++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// sleep for 30 secs
|
||||||
|
Thread.sleep(30*1000);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
Logging.println("Heartbeat exception caught!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
110
bioserver/Information.java
Normal file
110
bioserver/Information.java
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Organize the urls in lobby
|
||||||
|
*
|
||||||
|
* preliminary class, we need url to data mapping
|
||||||
|
* currently always the same page is delivered
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class Information {
|
||||||
|
|
||||||
|
// beware of the quotes, they need to be backslashed !
|
||||||
|
String contents_s =
|
||||||
|
"<HTML>"
|
||||||
|
+ "<HEAD>"
|
||||||
|
+ "<!--"
|
||||||
|
+ " <GAME-STYLE>"
|
||||||
|
+ " \"MOUSE=OFF\","
|
||||||
|
+ " \"SCROLL=OFF\","
|
||||||
|
+ " \"TITLE=OFF\","
|
||||||
|
+ " \"BACK=ON:mmbb://BUTTON_NG\","
|
||||||
|
+ " \"FORWARD=OFF\","
|
||||||
|
+ " \"CANCEL=OFF\","
|
||||||
|
+ " \"RELOAD=OFF\","
|
||||||
|
+ " \"CHOICE_MV=OFF\","
|
||||||
|
+ " \"X_SHOW=OFF\","
|
||||||
|
+ " \"FRONT_LABEL=ON:6\","
|
||||||
|
+ " </GAME-STYLE>"
|
||||||
|
+ "-->"
|
||||||
|
+ "<TITLE>database</TITLE><meta http-equiv=\"Content-Type\" content=\"text/html; charset=Shift_JIS\"></HEAD>"
|
||||||
|
+ ""
|
||||||
|
+ "<BODY bgcolor=\"#000033\" text=#FFFFFF>"
|
||||||
|
+ "<!-- Choices -->"
|
||||||
|
+ "<br>"
|
||||||
|
+ "<IMG SRC=\"\" width=0 height=0 USEMAP=#CENTER_MAP BORDER=0>"
|
||||||
|
+ "<MAP NAME=CENTER_MAP>"
|
||||||
|
+ "<!--CHG-IMG-BUTTON-2--><AREA SHAPE=RECT COORDS=\"164, 30,416, 60\" HREF=lbs://lbs/02/INFOR/INFOR00.HTM>"
|
||||||
|
+ "<!--CHG-IMG-BUTTON-2--><AREA SHAPE=RECT COORDS=\"164, 92,416,118\" HREF=lbs://lbs/02/RANKING.HTM>"
|
||||||
|
+ "<!--CHG-IMG-BUTTON-2--><AREA SHAPE=RECT COORDS=\"164,154,416,219\" HREF=afs://02/2>"
|
||||||
|
+ "<!--CHG-IMG-BUTTON-2--><AREA SHAPE=RECT COORDS=\"164,216,416,266\" HREF=afs://02/4>"
|
||||||
|
+ "</MAP> "
|
||||||
|
+ ""
|
||||||
|
+ ""
|
||||||
|
+ "<table width=584 cellspacing=30 cellpadding=0>"
|
||||||
|
+ " <tr> "
|
||||||
|
+ " <td align=center> </td>"
|
||||||
|
+ " <td width=256 height=32 align=center background=afs://02/123.PNG>INFORMATION</td>"
|
||||||
|
+ " <td align=center> </td>"
|
||||||
|
+ " </tr>"
|
||||||
|
+ " <tr> "
|
||||||
|
+ " <td align=center> </td>"
|
||||||
|
+ " <td width=256 height=32 align=center background=afs://02/123.PNG>RANKING</td>"
|
||||||
|
+ " <td align=center> </td>"
|
||||||
|
+ " </tr>"
|
||||||
|
+ " <tr> "
|
||||||
|
+ " <td align=center> </td>"
|
||||||
|
+ " <td width=256 height=32 align=center background=afs://02/123.PNG>TERMS OF USE</td>"
|
||||||
|
+ " <td align=center> </td>"
|
||||||
|
+ " </tr>"
|
||||||
|
+ " <tr> "
|
||||||
|
+ " <td align=center> </td>"
|
||||||
|
+ " <td width=256 height=32 align=center background=afs://02/123.PNG>REGISTER / CHANGE</td>"
|
||||||
|
+ " <td align=center> </td>"
|
||||||
|
+ " </tr>"
|
||||||
|
+ "</table>"
|
||||||
|
+ "</BODY>"
|
||||||
|
+ "</HTML>";
|
||||||
|
|
||||||
|
public Information() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// retrieve the desired URL
|
||||||
|
public byte[] getData(String url) {
|
||||||
|
byte[] content_b = null;
|
||||||
|
url = ("htm/"+url).replace("..", "X");
|
||||||
|
Logging.println("requested url: "+url);
|
||||||
|
try {
|
||||||
|
content_b = Files.readAllBytes(Paths.get(url));
|
||||||
|
} catch (IOException ex) {
|
||||||
|
Logging.println("Error reading file: "+url);
|
||||||
|
content_b = contents_s.getBytes();
|
||||||
|
}
|
||||||
|
return content_b;
|
||||||
|
}
|
||||||
|
}
|
||||||
62
bioserver/Logging.java
Normal file
62
bioserver/Logging.java
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* a simple class to print the hexdump of a byte buffer
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class Logging {
|
||||||
|
// how many bytes should be shown in one line ?
|
||||||
|
private static final int WIDTH = 16;
|
||||||
|
|
||||||
|
public static void printBuffer(byte[] buffer, int length) {
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
while(length>0) {
|
||||||
|
// print a full line or rest of the buffer
|
||||||
|
int j = Math.min(length, WIDTH);
|
||||||
|
for(int i=0; i<j; i++) System.out.printf("%02x ", buffer[index+i]);
|
||||||
|
for(int i=0; i<(WIDTH+1-j); i++) System.out.printf(" ");
|
||||||
|
for(int i=0; i<j; i++) {
|
||||||
|
char c = (char) buffer[index+i];
|
||||||
|
System.out.printf("%c", Character.isLetterOrDigit(c)||Character.isSpaceChar(c) ? c:'.');
|
||||||
|
}
|
||||||
|
System.out.printf("\n");
|
||||||
|
|
||||||
|
length -= WIDTH;
|
||||||
|
index += WIDTH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// print the complete buffer
|
||||||
|
public static void printBuffer(byte[] buffer) {
|
||||||
|
printBuffer(buffer, buffer.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
// print a message to console
|
||||||
|
public static void println(String msg) {
|
||||||
|
Date date = new Date();
|
||||||
|
System.out.println(date.toString()+" "+msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
46
bioserver/MessageOfTheDay.java
Normal file
46
bioserver/MessageOfTheDay.java
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object for Message of the day
|
||||||
|
*/
|
||||||
|
public class MessageOfTheDay {
|
||||||
|
private byte number;
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
public MessageOfTheDay(int number, String message) {
|
||||||
|
this.message = message;
|
||||||
|
this.number = (byte) number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getPacket() {
|
||||||
|
byte[] retval = new byte[3 + message.length()];
|
||||||
|
retval[0] = number;
|
||||||
|
if(message.length() == 0) retval[0] = 0;
|
||||||
|
retval[1] = (byte)(message.length() >> 8);
|
||||||
|
retval[2] = (byte)(message.length() & 0xFF);
|
||||||
|
System.arraycopy(message.getBytes(), 0, retval, 3, message.length());
|
||||||
|
return(retval);
|
||||||
|
}
|
||||||
|
}
|
||||||
252
bioserver/Packet.java
Normal file
252
bioserver/Packet.java
Normal file
@@ -0,0 +1,252 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
|
public class Packet {
|
||||||
|
final static int HEADERSIZE = 12;
|
||||||
|
|
||||||
|
private byte who; // server or client packet
|
||||||
|
private byte qsw; // question or answer
|
||||||
|
private int cmd; // command
|
||||||
|
private int len; // length including header
|
||||||
|
private int pid; // packet ID
|
||||||
|
private byte err; // error occured
|
||||||
|
private byte[] pay; // the payload
|
||||||
|
|
||||||
|
// constructor with payload
|
||||||
|
public Packet(int command, byte questionanswer, byte whosends, int packetid, byte[] payload) {
|
||||||
|
cmd = command;
|
||||||
|
who = whosends;
|
||||||
|
qsw = questionanswer;
|
||||||
|
len = payload.length;
|
||||||
|
pid = packetid;
|
||||||
|
pay = payload;
|
||||||
|
err = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// constructor without payload
|
||||||
|
public Packet(int command, byte questionanswer, byte whosends, int packetid) {
|
||||||
|
cmd = command;
|
||||||
|
who = whosends;
|
||||||
|
qsw = questionanswer;
|
||||||
|
len = 0;
|
||||||
|
pay = null;
|
||||||
|
pid = packetid;
|
||||||
|
err = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// constructor for raw data
|
||||||
|
public Packet(byte[] packetdata) {
|
||||||
|
who = (byte) packetdata[0];
|
||||||
|
qsw = (byte) packetdata[1];
|
||||||
|
cmd = (((int) packetdata[2] << 8)&0xFF00) | ((int) packetdata[3] &0xFF);
|
||||||
|
len = (((int) packetdata[4] << 8)&0xFF00) | ((int) packetdata[5] &0xFF);
|
||||||
|
pid = (((int) packetdata[6] << 8)&0xFF00) | ((int) packetdata[7] &0xFF);
|
||||||
|
err = (byte) packetdata[8];
|
||||||
|
pay = new byte[len];
|
||||||
|
if((len + HEADERSIZE) > packetdata.length) {
|
||||||
|
System.out.println("ERROR: packet constructor!!\n");
|
||||||
|
Logging.printBuffer(packetdata);
|
||||||
|
}
|
||||||
|
System.arraycopy(packetdata, HEADERSIZE, pay, 0, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
// construct the raw packet
|
||||||
|
public byte[] getPacketData() {
|
||||||
|
byte[] result = new byte[len + HEADERSIZE];
|
||||||
|
|
||||||
|
// build the header
|
||||||
|
result[0] = (byte) who;
|
||||||
|
result[1] = (byte) qsw;
|
||||||
|
result[2] = (byte) ((cmd >> 8) & 0xff);
|
||||||
|
result[3] = (byte) (cmd & 0xff);
|
||||||
|
result[4] = (byte) ((len >> 8) & 0xff);
|
||||||
|
result[5] = (byte) (len & 0xff);
|
||||||
|
result[6] = (byte) ((pid >> 8) & 0xff);
|
||||||
|
result[7] = (byte) (pid & 0xff);
|
||||||
|
result[8] = (byte) err;
|
||||||
|
result[9] = (byte) 0xff;
|
||||||
|
result[10] = (byte) 0xff;
|
||||||
|
result[11] = (byte) 0xff;
|
||||||
|
|
||||||
|
// copy the payload
|
||||||
|
if(len >0) System.arraycopy(pay, 0, result, HEADERSIZE, pay.length);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLength() {
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCmd() {
|
||||||
|
return cmd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getqsw() {
|
||||||
|
return qsw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getwho() {
|
||||||
|
return who;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPacketID() {
|
||||||
|
return pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getPayload() {
|
||||||
|
return pay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPacketID(int packetid) {
|
||||||
|
this.pid = packetid;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the error flag for a packet !
|
||||||
|
public void setErr() {
|
||||||
|
this.err = (byte) 0xff;
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte calc_shift(byte i, byte p) {
|
||||||
|
byte[] fixval = { 21, 23, 10, 17, 23, 19, 6, 13};
|
||||||
|
byte[] masks = {0x33, 0x30, 0x3c, 0x34, 0x2d, 0x30, 0x3c, 0x34};
|
||||||
|
return(byte) (fixval[i&7] - (i&(byte)0xf8) - p + ((p - 9 + i)&masks[i&7])*2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// encrypt/decrypt the payload
|
||||||
|
// 2 bytes len, 2 bytes sum, rest string
|
||||||
|
public void cryptString() {
|
||||||
|
int length = (((int)pay[0] << 8)|((int)pay[1])) -2; // skip the sum
|
||||||
|
for(int i=0; i<length; i++) pay[4+i] = (byte) (pay[4+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// return a byte array with decrypted string
|
||||||
|
public byte[] getDecryptedString() {
|
||||||
|
int length = (((int)pay[0] << 8)|((int)pay[1])) -2; // skip the sum
|
||||||
|
for(int i=0; i<length; i++) pay[4+i] = (byte) (pay[4+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
|
||||||
|
|
||||||
|
byte[] retval = new byte[length];
|
||||||
|
System.arraycopy(pay, 4, retval, 0, length);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
// decrypt the slotpassword
|
||||||
|
public byte[] getPassword() {
|
||||||
|
int length = (((int)pay[2] << 8)|((int)pay[3])) -2; // skip the sum
|
||||||
|
for(int i=0; i<length; i++) pay[6+i] = (byte) (pay[6+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
|
||||||
|
|
||||||
|
byte[] retval = new byte[length];
|
||||||
|
System.arraycopy(pay, 6, retval, 0, length);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
// decrypt chosen handle/nickname
|
||||||
|
public HNPair getDecryptedHNpair() {
|
||||||
|
int hlen = (((int)pay[0] << 8)|((int)pay[1])) -2; // skip the sum
|
||||||
|
int nlen = (((int)pay[hlen +4] << 8)|((int)pay[hlen +5])) -2; // skip the sum
|
||||||
|
|
||||||
|
for(int i=0; i<hlen; i++) pay[4+i] = (byte) (pay[4+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
|
||||||
|
for(int i=0; i<nlen; i++) pay[hlen+8+i] = (byte) (pay[hlen+8+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
|
||||||
|
|
||||||
|
byte[] handle = new byte[hlen];
|
||||||
|
byte[] nickname = new byte[nlen];
|
||||||
|
System.arraycopy(pay, 4, handle, 0, hlen);
|
||||||
|
System.arraycopy(pay, hlen+8, nickname, 0, nlen);
|
||||||
|
return(new HNPair(handle, nickname));
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getCharacterStats(){
|
||||||
|
for(int i=0; i<0xD0; i++) pay[4+i] = (byte) (pay[4+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
|
||||||
|
byte[] retval = new byte[0xD0];
|
||||||
|
System.arraycopy(pay, 4, retval, 0, 0xD0);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
// this returns the first two bytes of the payload as int
|
||||||
|
public int getNumber() {
|
||||||
|
return((((int)pay[0] << 8)&0xFF00) | ((int)pay[1] & 0xFF));
|
||||||
|
}
|
||||||
|
|
||||||
|
// decrypts and returns chat data
|
||||||
|
public byte[] getChatOutData() {
|
||||||
|
this.cryptString();
|
||||||
|
int length = (((int)pay[0] << 8)|((int)pay[1])) -2;
|
||||||
|
byte[] retval = new byte[length];
|
||||||
|
System.arraycopy(pay, 4, retval, 0, length);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
// decrypts handle and event data in pregame and after game lobby
|
||||||
|
// and returns the broadcast data
|
||||||
|
public byte[] getEvenData() {
|
||||||
|
int hlen = (((int)pay[0] << 8)|((int)pay[1])) -2; // skip the sum
|
||||||
|
int elen = ((((int)pay[hlen +4]&0xff) << 8)|((int)pay[hlen +5])&0xff) -2; // skip the sum
|
||||||
|
|
||||||
|
for(int i=0; i<hlen; i++) pay[4+i] = (byte) (pay[4+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
|
||||||
|
for(int i=0; i<elen; i++) pay[hlen+8+i] = (byte) (pay[hlen+8+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
|
||||||
|
|
||||||
|
ByteBuffer z = ByteBuffer.wrap(new byte[hlen+elen+4]);
|
||||||
|
z.putShort((short)hlen);
|
||||||
|
z.put(pay,4,hlen);
|
||||||
|
z.putShort((short)elen);
|
||||||
|
z.put(pay,hlen+8,elen);
|
||||||
|
byte[] retval = new byte[z.position()];
|
||||||
|
z.rewind();
|
||||||
|
z.get(retval);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
// decrypt a private message and create broadcast in one step
|
||||||
|
public PrivateMessage getDecryptedPvtMess(Client sender) {
|
||||||
|
int hlen = (((int)pay[0] << 8)|((int)pay[1])) -2; // skip the sum
|
||||||
|
int nlen = (((int)pay[hlen +4] << 8)|((int)pay[hlen +5])) -2; // skip the sum
|
||||||
|
|
||||||
|
for(int i=0; i<hlen; i++) pay[4+i] = (byte) (pay[4+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
|
||||||
|
for(int i=0; i<nlen; i++) pay[hlen+8+i] = (byte) (pay[hlen+8+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
|
||||||
|
|
||||||
|
byte[] recipient = new byte[hlen];
|
||||||
|
byte[] message = new byte[nlen];
|
||||||
|
System.arraycopy(pay, 4, recipient, 0, hlen);
|
||||||
|
System.arraycopy(pay, hlen+8, message, 0, nlen);
|
||||||
|
return(new PrivateMessage(sender.getHNPair().getHandle(), sender.getHNPair().getNickname(), recipient, message));
|
||||||
|
}
|
||||||
|
|
||||||
|
// helper function
|
||||||
|
private int decryptBuff(byte[] b, int offset) {
|
||||||
|
int mlen = ((((int)b[offset]&0xff) << 8)|((int)b[offset+1]&0xff)) -2;
|
||||||
|
for(int i=0; i<mlen; i++) pay[offset+4+i] = (byte) (pay[offset+4+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
|
||||||
|
return mlen;
|
||||||
|
}
|
||||||
|
|
||||||
|
// decrypt the version string
|
||||||
|
public byte[] getVersion() {
|
||||||
|
int length = (((int)pay[3] << 8)|((int)pay[4])) -2; // skip the sum
|
||||||
|
for(int i=0; i<length; i++) pay[7+i] = (byte) (pay[7+i] ^ calc_shift((byte)i, (byte)(pid & (byte)0xff)));
|
||||||
|
|
||||||
|
byte[] retval = new byte[length];
|
||||||
|
System.arraycopy(pay, 7, retval, 0, length);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
218
bioserver/Packet6881.java
Normal file
218
bioserver/Packet6881.java
Normal file
@@ -0,0 +1,218 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A mysterious packet :D
|
||||||
|
*/
|
||||||
|
public class Packet6881 {
|
||||||
|
private static final byte[][] data = new byte[][]{
|
||||||
|
{
|
||||||
|
(byte) 0x01,(byte) 0x01,(byte) 0x01,(byte) 0x94,(byte) 0xAD,(byte) 0x90,(byte) 0xB6,(byte) 0x20,(byte) 0x20,(byte) 0x6F,(byte) 0x75,(byte) 0x74,(byte) 0x62,(byte) 0x72,(byte) 0x65,(byte) 0x61,(byte) 0x6B,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x09,(byte) 0x02,(byte) 0x03,(byte) 0x04,(byte) 0x02,(byte) 0x03,(byte) 0x04,(byte) 0x02,(byte) 0x03,(byte) 0x04,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x02,(byte) 0x05,(byte) 0x05,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x02,(byte) 0x01,(byte) 0x02,(byte) 0x97,(byte) 0xEB,(byte) 0x89,(byte) 0xBA,(byte) 0x20,(byte) 0x20,(byte) 0x62,(byte) 0x65,(byte) 0x6C,
|
||||||
|
(byte) 0x6F,(byte) 0x77,(byte) 0x20,(byte) 0x66,(byte) 0x72,(byte) 0x65,(byte) 0x65,(byte) 0x7A,(byte) 0x69,(byte) 0x6E,(byte) 0x67,(byte) 0x20,(byte) 0x70,(byte) 0x6F,(byte) 0x69,(byte) 0x6E,(byte) 0x74,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x05,(byte) 0x03,(byte) 0x04,(byte) 0x03,(byte) 0x04,
|
||||||
|
(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x01,(byte) 0x05,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0xB2,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x03,(byte) 0x01,(byte) 0x03,(byte) 0x91,(byte) 0x83,(byte) 0x8C,(byte) 0x41,(byte) 0x20,(byte) 0x20,(byte) 0x74,(byte) 0x68,(byte) 0x65,(byte) 0x20,(byte) 0x68,(byte) 0x69,(byte) 0x76,(byte) 0x65,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x02,(byte) 0x04,(byte) 0x02,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x02,(byte) 0x05,(byte) 0x05,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x68,(byte) 0x01,(byte) 0x00,(byte) 0x00,(byte) 0x04,(byte) 0x01,(byte) 0x04,(byte) 0x8D,(byte) 0x96,(byte) 0x89,(byte) 0x8A,(byte) 0x20,
|
||||||
|
(byte) 0x20,(byte) 0x68,(byte) 0x65,(byte) 0x6C,(byte) 0x6C,(byte) 0x66,(byte) 0x69,(byte) 0x72,(byte) 0x65,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x05,
|
||||||
|
(byte) 0x02,(byte) 0x03,(byte) 0x02,(byte) 0x03,(byte) 0x02,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x02,(byte) 0x05,(byte) 0x05,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x1E,(byte) 0x02,(byte) 0x00,(byte) 0x00,(byte) 0x05,(byte) 0x01,(byte) 0x05,(byte) 0x8C,(byte) 0x88,(byte) 0x88,(byte) 0xD3,(byte) 0x20,(byte) 0x20,(byte) 0x64,(byte) 0x65,(byte) 0x63,(byte) 0x69,(byte) 0x73,(byte) 0x69,(byte) 0x6F,(byte) 0x6E,(byte) 0x73,(byte) 0x2C,(byte) 0x20,
|
||||||
|
(byte) 0x64,(byte) 0x65,(byte) 0x63,(byte) 0x69,(byte) 0x73,(byte) 0x69,(byte) 0x6F,(byte) 0x6E,(byte) 0x73,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x01,(byte) 0x05,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x01,(byte) 0x05,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xD8,(byte) 0x02,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x82,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x83,(byte) 0x03,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x84,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x85,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x86,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x87,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x88,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x89,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x8A,(byte) 0x03,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x8B,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x8C,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x8D,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xB5,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xDD,(byte) 0x03,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x05,(byte) 0x04,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x2D,(byte) 0x04,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0xFF,(byte) 0x00,(byte) 0x06,(byte) 0x1F,(byte) 0x00,(byte) 0x53,(byte) 0x4C,(byte) 0x50,(byte) 0x4D,(byte) 0x2D,(byte) 0x36,(byte) 0x35,(byte) 0x34,(byte) 0x32,(byte) 0x38,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x53,(byte) 0x4C,(byte) 0x50,(byte) 0x4D,(byte) 0x2D,(byte) 0x36,(byte) 0x35,(byte) 0x34,(byte) 0x32,(byte) 0x39,(byte) 0x00,(byte) 0x00,(byte) 0x53,(byte) 0x4C,(byte) 0x50,(byte) 0x4D,(byte) 0x2D,(byte) 0x36,(byte) 0x35,(byte) 0x34,(byte) 0x33,(byte) 0x30,(byte) 0x00,(byte) 0x00,(byte) 0x42,(byte) 0x49,(byte) 0x4F,(byte) 0x48,
|
||||||
|
(byte) 0x41,(byte) 0x5A,(byte) 0x41,(byte) 0x52,(byte) 0x44,(byte) 0x20,(byte) 0x4F,(byte) 0x55,(byte) 0x54,(byte) 0x42,(byte) 0x52,(byte) 0x45,(byte) 0x41,(byte) 0x4B,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x42,(byte) 0x49,(byte) 0x4F,(byte) 0x48,(byte) 0x41,(byte) 0x5A,(byte) 0x41,(byte) 0x52,(byte) 0x44,(byte) 0x20,(byte) 0x4F,(byte) 0x55,(byte) 0x54,(byte) 0x42,(byte) 0x52,(byte) 0x45,(byte) 0x41,(byte) 0x4B,(byte) 0x20,(byte) 0x82,(byte) 0x51,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x42,(byte) 0x49,(byte) 0x4F,(byte) 0x48,(byte) 0x41,(byte) 0x5A,(byte) 0x41,(byte) 0x52,(byte) 0x44,(byte) 0x20,(byte) 0x4F,(byte) 0x55,(byte) 0x54,(byte) 0x42,(byte) 0x52,(byte) 0x45,(byte) 0x41,(byte) 0x4B,(byte) 0x20,(byte) 0x82,(byte) 0x52,(byte) 0x00,(byte) 0x00,(byte) 0x00,
|
||||||
|
(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x82,(byte) 0xA0,(byte) 0x82,(byte) 0xE9,(byte) 0x95,(byte) 0xBD,(byte) 0x89,(byte) 0xB8,(byte) 0x82,(byte) 0xC8,(byte) 0x96,(byte) 0xE9,(byte) 0x81,(byte) 0x41,
|
||||||
|
(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x82,(byte) 0xBB,(byte) 0x82,(byte) 0xEA,(byte) 0x82,(byte) 0xCD,(byte) 0x83,(byte) 0x6F,(byte) 0x81,(byte) 0x5B,(byte) 0x82,(byte) 0xCC,(byte) 0x94,(byte) 0xE0,(byte) 0x82,(byte) 0xF0,(byte) 0x8A,(byte) 0x4A,
|
||||||
|
(byte) 0x82,(byte) 0xAF,(byte) 0x82,(byte) 0xC4,(byte) 0x82,(byte) 0xE2,(byte) 0x82,(byte) 0xC1,(byte) 0x82,(byte) 0xC4,(byte) 0x82,(byte) 0xAB,(byte) 0x82,(byte) 0xBD,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x8B,(byte) 0xB0,
|
||||||
|
(byte) 0x95,(byte) 0x7C,(byte) 0x82,(byte) 0xC6,(byte) 0x82,(byte) 0xA2,(byte) 0x82,(byte) 0xA4,(byte) 0x96,(byte) 0xBC,(byte) 0x82,(byte) 0xCC,(byte) 0x81,(byte) 0x41,(byte) 0x8F,(byte) 0xB5,(byte) 0x82,(byte) 0xA9,(byte) 0x82,(byte) 0xEA,(byte) 0x82,(byte) 0xB4,(byte) 0x82,(byte) 0xE9,(byte) 0x8B,(byte) 0x71,(byte) 0x81,(byte) 0x42,
|
||||||
|
(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x89,(byte) 0xE4,(byte) 0x81,(byte) 0x58,(byte) 0x82,(byte) 0xC9,(byte) 0x82,(byte) 0xC5,(byte) 0x82,(byte) 0xAB,(byte) 0x82,(byte) 0xE9,(byte) 0x82,(byte) 0xCC,(byte) 0x82,(byte) 0xCD,(byte) 0x81,(byte) 0x41,
|
||||||
|
(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x82,(byte) 0xBD,(byte) 0x82,(byte) 0xBE,(byte) 0x93,(byte) 0xA6,(byte) 0x82,(byte) 0xB0,(byte) 0x98,(byte) 0x66,(byte) 0x82,(byte) 0xA4,(byte) 0x82,(byte) 0xB1,(byte) 0x82,(byte) 0xC6,(byte) 0x82,(byte) 0xBE,
|
||||||
|
(byte) 0x82,(byte) 0xAF,(byte) 0x82,(byte) 0xBE,(byte) 0x82,(byte) 0xC1,(byte) 0x82,(byte) 0xBD,(byte) 0x81,(byte) 0x63,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x8B,(byte) 0xB6,(byte) 0x91,(byte) 0x9B,
|
||||||
|
(byte) 0x82,(byte) 0xA9,(byte) 0x82,(byte) 0xE7,(byte) 0x93,(byte) 0xA6,(byte) 0x82,(byte) 0xEA,(byte) 0x81,(byte) 0x41,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x89,(byte) 0xE4,(byte) 0x81,(byte) 0x58,(byte) 0x82,(byte) 0xCD,(byte) 0x82,(byte) 0xC6,
|
||||||
|
(byte) 0x82,(byte) 0xA0,(byte) 0x82,(byte) 0xE9,(byte) 0x92,(byte) 0x6E,(byte) 0x89,(byte) 0xBA,(byte) 0x8E,(byte) 0x7B,(byte) 0x90,(byte) 0xDD,(byte) 0x82,(byte) 0xD6,(byte) 0x82,(byte) 0xC6,(byte) 0x97,(byte) 0x55,(byte) 0x82,(byte) 0xED,(byte) 0x82,(byte) 0xEA,(byte) 0x82,(byte) 0xE9,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,
|
||||||
|
(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x82,(byte) 0xBB,(byte) 0x82,(byte) 0xB1,(byte) 0x82,(byte) 0xCD,(byte) 0x97,(byte) 0xE2,(byte) 0x8B,(byte) 0x43,(byte) 0x82,(byte) 0xC6,(byte) 0x90,(byte) 0xC3,(byte) 0x8E,(byte) 0xE2,(byte) 0x81,(byte) 0x41,(byte) 0x3C,(byte) 0x42,
|
||||||
|
(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x82,(byte) 0xBB,(byte) 0x82,(byte) 0xB5,(byte) 0x82,(byte) 0xC4,(byte) 0x8E,(byte) 0x80,(byte) 0x82,(byte) 0xCC,(byte) 0x95,(byte) 0x61,(byte) 0x82,(byte) 0xAA,(byte) 0x96,(byte) 0xA0,(byte) 0x89,(byte) 0x84,(byte) 0x82,(byte) 0xB5,
|
||||||
|
(byte) 0x82,(byte) 0xC4,(byte) 0x82,(byte) 0xA2,(byte) 0x82,(byte) 0xBD,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x8B,(byte) 0xA9,(byte) 0x8A,(byte) 0xAB,(byte) 0x82,(byte) 0xCC,(byte) 0x89,(byte) 0xCA,(byte) 0x82,(byte) 0xC4,
|
||||||
|
(byte) 0x81,(byte) 0x41,(byte) 0x82,(byte) 0xBD,(byte) 0x82,(byte) 0xC7,(byte) 0x82,(byte) 0xE8,(byte) 0x92,(byte) 0x85,(byte) 0x82,(byte) 0xAD,(byte) 0x90,(byte) 0x5E,(byte) 0x8E,(byte) 0xC0,(byte) 0x82,(byte) 0xC6,(byte) 0x82,(byte) 0xCD,(byte) 0x84,(byte) 0x9F,(byte) 0x84,(byte) 0x9F,(byte) 0x81,(byte) 0x48,(byte) 0x3C,(byte) 0x45,
|
||||||
|
(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x96,(byte) 0x7B,(byte) 0x94,(byte) 0x5C,(byte) 0x82,(byte) 0xCC,(byte) 0x82,(byte) 0xDC,(byte) 0x82,(byte) 0xDC,(byte) 0x82,(byte) 0xA4,(byte) 0x82,(byte) 0xB2,(byte) 0x82,(byte) 0xDF,(byte) 0x82,(byte) 0xAD,
|
||||||
|
(byte) 0x96,(byte) 0xB3,(byte) 0x90,(byte) 0x94,(byte) 0x82,(byte) 0xCC,(byte) 0x97,(byte) 0xA5,(byte) 0x93,(byte) 0xAE,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x81,(byte) 0x5C,(byte) 0x81,(byte) 0x5C,(byte) 0x88,(byte) 0xC3,(byte) 0x88,(byte) 0xC5,
|
||||||
|
(byte) 0x82,(byte) 0xCD,(byte) 0x8A,(byte) 0xF9,(byte) 0x82,(byte) 0xC9,(byte) 0x94,(byte) 0xDE,(byte) 0x82,(byte) 0xE7,(byte) 0x82,(byte) 0xC9,(byte) 0x8E,(byte) 0x78,(byte) 0x94,(byte) 0x7A,(byte) 0x82,(byte) 0xB3,(byte) 0x82,(byte) 0xEA,(byte) 0x82,(byte) 0xC4,(byte) 0x82,(byte) 0xA2,(byte) 0x82,(byte) 0xBD,(byte) 0x81,(byte) 0x42,
|
||||||
|
(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x96,(byte) 0x82,(byte) 0x8C,(byte) 0x41,(byte) 0x82,(byte) 0xC6,(byte) 0x89,(byte) 0xBB,(byte) 0x82,(byte) 0xB5,(byte) 0x82,(byte) 0xBD,(byte) 0x95,(byte) 0x61,(byte) 0x89,(byte) 0x40,(byte) 0x82,(byte) 0xC5,
|
||||||
|
(byte) 0x81,(byte) 0x41,(byte) 0x9C,(byte) 0xDF,(byte) 0x82,(byte) 0xE8,(byte) 0x82,(byte) 0xC2,(byte) 0x82,(byte) 0xAD,(byte) 0x88,(byte) 0xAB,(byte) 0x96,(byte) 0xB2,(byte) 0x82,(byte) 0xF0,(byte) 0x92,(byte) 0xC7,(byte) 0x82,(byte) 0xA2,(byte) 0x95,(byte) 0xA5,(byte) 0x82,(byte) 0xA4,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,
|
||||||
|
(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x82,(byte) 0xB1,(byte) 0x82,(byte) 0xCC,(byte) 0x8B,(byte) 0xB6,(byte) 0x91,(byte) 0xD4,(byte) 0x82,(byte) 0xCD,(byte) 0x81,(byte) 0x41,(byte) 0x82,(byte) 0xA2,(byte) 0x82,(byte) 0xC2,(byte) 0x82,(byte) 0xDC,(byte) 0x82,(byte) 0xC5,
|
||||||
|
(byte) 0x91,(byte) 0xB1,(byte) 0x82,(byte) 0xAD,(byte) 0x82,(byte) 0xCC,(byte) 0x82,(byte) 0xA9,(byte) 0x81,(byte) 0x63,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x8D,(byte) 0x95,(byte) 0x89,(byte) 0x8C,
|
||||||
|
(byte) 0x82,(byte) 0xC9,(byte) 0x95,(byte) 0xEF,(byte) 0x82,(byte) 0xDC,(byte) 0x82,(byte) 0xEA,(byte) 0x82,(byte) 0xBD,(byte) 0x83,(byte) 0x7A,(byte) 0x83,(byte) 0x65,(byte) 0x83,(byte) 0x8B,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,
|
||||||
|
(byte) 0x89,(byte) 0x8A,(byte) 0x82,(byte) 0xCD,(byte) 0x90,(byte) 0x6C,(byte) 0x82,(byte) 0xCC,(byte) 0x96,(byte) 0xB3,(byte) 0x97,(byte) 0xCD,(byte) 0x82,(byte) 0xB3,(byte) 0x82,(byte) 0xF0,(byte) 0x82,(byte) 0xA0,(byte) 0x82,(byte) 0xB4,(byte) 0x8F,(byte) 0xCE,(byte) 0x82,(byte) 0xA2,(byte) 0x81,(byte) 0x41,(byte) 0x3C,(byte) 0x42,
|
||||||
|
(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x88,(byte) 0xD9,(byte) 0x8C,(byte) 0x60,(byte) 0x82,(byte) 0xCC,(byte) 0x8F,(byte) 0x62,(byte) 0x82,(byte) 0xC6,(byte) 0x82,(byte) 0xC8,(byte) 0x82,(byte) 0xC1,(byte) 0x82,(byte) 0xC4,(byte) 0x97,(byte) 0x78,(byte) 0x82,(byte) 0xE8,
|
||||||
|
(byte) 0x8B,(byte) 0xB6,(byte) 0x82,(byte) 0xA4,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x82,(byte) 0xAD,(byte) 0x82,(byte) 0xAE,(byte) 0x82,(byte) 0xE8,(byte) 0x94,(byte) 0xB2,(byte) 0x82,(byte) 0xAF,(byte) 0x82,(byte) 0xCB,
|
||||||
|
(byte) 0x82,(byte) 0xCE,(byte) 0x81,(byte) 0x41,(byte) 0x8E,(byte) 0x80,(byte) 0x82,(byte) 0xA0,(byte) 0x82,(byte) 0xE9,(byte) 0x82,(byte) 0xCC,(byte) 0x82,(byte) 0xDD,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x81,(byte) 0x5C,(byte) 0x81,(byte) 0x5C,
|
||||||
|
(byte) 0x8A,(byte) 0xE8,(byte) 0x82,(byte) 0xED,(byte) 0x82,(byte) 0xAD,(byte) 0x82,(byte) 0xCE,(byte) 0x88,(byte) 0xEA,(byte) 0x88,(byte) 0xAC,(byte) 0x82,(byte) 0xE8,(byte) 0x82,(byte) 0xCC,(byte) 0x97,(byte) 0x45,(byte) 0x8B,(byte) 0x43,(byte) 0x82,(byte) 0xC6,(byte) 0x8D,(byte) 0x4B,(byte) 0x89,(byte) 0x5E,(byte) 0x82,(byte) 0xF0,
|
||||||
|
(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x8A,(byte) 0x58,(byte) 0x82,(byte) 0xC9,(byte) 0x94,(byte) 0x97,(byte) 0x82,(byte) 0xE9,(byte) 0x95,(byte) 0xF6,(byte) 0x89,(byte) 0xF3,(byte) 0x82,(byte) 0xCC,
|
||||||
|
(byte) 0x91,(byte) 0xAB,(byte) 0x89,(byte) 0xB9,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x97,(byte) 0xA7,(byte) 0x82,(byte) 0xBF,(byte) 0x82,(byte) 0xD3,(byte) 0x82,(byte) 0xB3,(byte) 0x82,(byte) 0xAA,(byte) 0x82,(byte) 0xE9,
|
||||||
|
(byte) 0x8E,(byte) 0xBD,(byte) 0x8D,(byte) 0x95,(byte) 0x82,(byte) 0xCC,(byte) 0x90,(byte) 0xE2,(byte) 0x96,(byte) 0x5D,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x89,(byte) 0x5E,(byte) 0x96,(byte) 0xBD,(byte) 0x82,(byte) 0xCC,
|
||||||
|
(byte) 0x8A,(byte) 0xF2,(byte) 0x98,(byte) 0x48,(byte) 0x82,(byte) 0xC5,(byte) 0x81,(byte) 0x41,(byte) 0x96,(byte) 0xC0,(byte) 0x82,(byte) 0xA2,(byte) 0x97,(byte) 0xAF,(byte) 0x82,(byte) 0xDC,(byte) 0x82,(byte) 0xC1,(byte) 0x82,(byte) 0xC4,(byte) 0x82,(byte) 0xA2,(byte) 0x82,(byte) 0xE9,(byte) 0x97,(byte) 0x50,(byte) 0x97,(byte) 0x5C,
|
||||||
|
(byte) 0x82,(byte) 0xCD,(byte) 0x82,(byte) 0xC8,(byte) 0x82,(byte) 0xA2,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x42,(byte) 0x52,(byte) 0x3E,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x96,(byte) 0xE9,(byte) 0x96,(byte) 0xBE,(byte) 0x82,(byte) 0xAF,(byte) 0x82,(byte) 0xC6,(byte) 0x82,(byte) 0xC6,
|
||||||
|
(byte) 0x82,(byte) 0xE0,(byte) 0x82,(byte) 0xC9,(byte) 0x96,(byte) 0x4B,(byte) 0x82,(byte) 0xEA,(byte) 0x82,(byte) 0xE9,(byte) 0x82,(byte) 0xCC,(byte) 0x82,(byte) 0xCD,(byte) 0x81,(byte) 0x41,(byte) 0x8A,(byte) 0xF3,(byte) 0x96,(byte) 0x5D,(byte) 0x82,(byte) 0xA9,(byte) 0x81,(byte) 0x41,(byte) 0x8F,(byte) 0x49,(byte) 0xE0,(byte) 0x81,
|
||||||
|
(byte) 0x82,(byte) 0xA9,(byte) 0x81,(byte) 0x42,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x83,
|
||||||
|
(byte) 0x66,(byte) 0x83,(byte) 0x42,(byte) 0x83,(byte) 0x58,(byte) 0x83,(byte) 0x4E,(byte) 0x82,(byte) 0x51,(byte) 0x81,(byte) 0x40,(byte) 0x83,(byte) 0x56,(byte) 0x83,(byte) 0x69,(byte) 0x83,(byte) 0x8A,(byte) 0x83,(byte) 0x49,(byte) 0x82,(byte) 0x50,(byte) 0x90,(byte) 0xE0,(byte) 0x96,(byte) 0xBE,(byte) 0x95,(byte) 0xB6,(byte) 0x3C,
|
||||||
|
(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x83,(byte) 0x66,(byte) 0x83,(byte) 0x42,(byte) 0x83,(byte) 0x58,(byte) 0x83,(byte) 0x4E,(byte) 0x82,(byte) 0x51,(byte) 0x81,(byte) 0x40,(byte) 0x83,(byte) 0x56,(byte) 0x83,(byte) 0x69,(byte) 0x83,
|
||||||
|
(byte) 0x8A,(byte) 0x83,(byte) 0x49,(byte) 0x82,(byte) 0x51,(byte) 0x90,(byte) 0xE0,(byte) 0x96,(byte) 0xBE,(byte) 0x95,(byte) 0xB6,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x83,(byte) 0x66,(byte) 0x83,(byte) 0x42,(byte) 0x83,
|
||||||
|
(byte) 0x58,(byte) 0x83,(byte) 0x4E,(byte) 0x82,(byte) 0x51,(byte) 0x81,(byte) 0x40,(byte) 0x83,(byte) 0x56,(byte) 0x83,(byte) 0x69,(byte) 0x83,(byte) 0x8A,(byte) 0x83,(byte) 0x49,(byte) 0x82,(byte) 0x52,(byte) 0x90,(byte) 0xE0,(byte) 0x96,(byte) 0xBE,(byte) 0x95,(byte) 0xB6,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,
|
||||||
|
(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x83,(byte) 0x66,(byte) 0x83,(byte) 0x42,(byte) 0x83,(byte) 0x58,(byte) 0x83,(byte) 0x4E,(byte) 0x82,(byte) 0x51,(byte) 0x81,(byte) 0x40,(byte) 0x83,(byte) 0x56,(byte) 0x83,(byte) 0x69,(byte) 0x83,(byte) 0x8A,(byte) 0x83,(byte) 0x49,(byte) 0x82,
|
||||||
|
(byte) 0x53,(byte) 0x90,(byte) 0xE0,(byte) 0x96,(byte) 0xBE,(byte) 0x95,(byte) 0xB6,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00,(byte) 0x3C,(byte) 0x42,(byte) 0x4F,(byte) 0x44,(byte) 0x59,(byte) 0x3E,(byte) 0x83,(byte) 0x66,(byte) 0x83,(byte) 0x42,(byte) 0x83,(byte) 0x58,(byte) 0x83,(byte) 0x4E,(byte) 0x82,
|
||||||
|
(byte) 0x51,(byte) 0x81,(byte) 0x40,(byte) 0x83,(byte) 0x56,(byte) 0x83,(byte) 0x69,(byte) 0x83,(byte) 0x8A,(byte) 0x83,(byte) 0x49,(byte) 0x82,(byte) 0x54,(byte) 0x90,(byte) 0xE0,(byte) 0x96,(byte) 0xBE,(byte) 0x95,(byte) 0xB6,(byte) 0x3C,(byte) 0x45,(byte) 0x4E,(byte) 0x44,(byte) 0x3E,(byte) 0x00
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
public static byte[] getData(int nr, int offset, int sizeL) {
|
||||||
|
byte[] d = new byte[sizeL + 11];
|
||||||
|
// check if more bytes are requested than left in buffer
|
||||||
|
if(sizeL > (data[nr].length-offset)) sizeL = data[nr].length - offset;
|
||||||
|
d[0] = (byte)nr;
|
||||||
|
d[1] = (byte)((offset>>24)&0xff);
|
||||||
|
d[2] = (byte)((offset>>16)&0xff);
|
||||||
|
d[3] = (byte)((offset>>8)&0xff);
|
||||||
|
d[4] = (byte)((offset)&0xff);
|
||||||
|
d[5] = (byte)((sizeL>>24)&0xff);
|
||||||
|
d[6] = (byte)((sizeL>>16)&0xff);
|
||||||
|
d[7] = (byte)((sizeL>>8)&0xff);
|
||||||
|
d[8] = (byte)((sizeL)&0xff);
|
||||||
|
d[9] = d[7];
|
||||||
|
d[10] = d[8];
|
||||||
|
System.arraycopy(data[nr], offset, d, 11, sizeL);
|
||||||
|
return(d);
|
||||||
|
}
|
||||||
|
}
|
||||||
2314
bioserver/PacketHandler.java
Normal file
2314
bioserver/PacketHandler.java
Normal file
File diff suppressed because it is too large
Load Diff
43
bioserver/PacketString.java
Normal file
43
bioserver/PacketString.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* object for representation of strings in packetdata
|
||||||
|
*/
|
||||||
|
public class PacketString {
|
||||||
|
private byte[] buffer;
|
||||||
|
|
||||||
|
// construct it from a string
|
||||||
|
public PacketString(String string) {
|
||||||
|
this.buffer = string.getBytes();
|
||||||
|
}
|
||||||
|
|
||||||
|
// convert to data used in packets
|
||||||
|
public byte[] getData() {
|
||||||
|
ByteBuffer zwi = ByteBuffer.wrap(new byte[buffer.length + 2]);
|
||||||
|
zwi.putShort((short) buffer.length);
|
||||||
|
zwi.put(buffer);
|
||||||
|
return zwi.array();
|
||||||
|
}
|
||||||
|
}
|
||||||
81
bioserver/Patch.java
Normal file
81
bioserver/Patch.java
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File#1 had a patch to version 1.01
|
||||||
|
* this class holds the patch data
|
||||||
|
*/
|
||||||
|
public class Patch {
|
||||||
|
|
||||||
|
// patch length is 0x7aa0
|
||||||
|
private byte[] patchData;
|
||||||
|
|
||||||
|
public Patch() {
|
||||||
|
try {
|
||||||
|
File file = new File("patch.raw");
|
||||||
|
this.patchData = new byte[(int) file.length()];
|
||||||
|
|
||||||
|
FileInputStream fis = new FileInputStream(file);
|
||||||
|
fis.read(this.patchData);
|
||||||
|
fis.close();
|
||||||
|
} catch (IOException ex) {
|
||||||
|
Logger.getLogger(Patch.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
Logging.println("Patch loaded: " + this.patchData.length + " bytes");
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getData(int nr) {
|
||||||
|
// use a chunk of 0x100 bytes, last chunk might be different
|
||||||
|
int size = 0x100;
|
||||||
|
|
||||||
|
// check if more bytes are requested than left in buffer
|
||||||
|
if(this.patchData.length < (nr * 0x100 + 0x100)) size = patchData.length - (nr * 0x100);
|
||||||
|
if(size < 0 ) {
|
||||||
|
size = 0;
|
||||||
|
nr = 0;
|
||||||
|
}
|
||||||
|
byte[] d = new byte[size + 4];
|
||||||
|
|
||||||
|
// set chunk number and size
|
||||||
|
d[0] = (byte) ((nr >> 8) & 0xff);
|
||||||
|
d[1] = (byte) (nr & 0xff);
|
||||||
|
d[2] = (byte) ((size >> 8) & 0xff);
|
||||||
|
d[3] = (byte) (size & 0xff);
|
||||||
|
System.arraycopy(this.patchData, nr * 0x100, d, 4, size);
|
||||||
|
return(d);
|
||||||
|
}
|
||||||
|
|
||||||
|
// calculate the amount of chunks we can send
|
||||||
|
public int cntChunks(int nr) {
|
||||||
|
int max = 8;
|
||||||
|
int chunksLeft = (byte)((this.patchData.length - (nr * 0x100)) >> 8);
|
||||||
|
if(chunksLeft < 0) chunksLeft = 0;
|
||||||
|
if(chunksLeft < max) max = chunksLeft + 1;
|
||||||
|
return(max);
|
||||||
|
}
|
||||||
|
}
|
||||||
72
bioserver/PrivateMessage.java
Normal file
72
bioserver/PrivateMessage.java
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object for the private messaging system
|
||||||
|
*/
|
||||||
|
public class PrivateMessage {
|
||||||
|
private byte[] senderhandle;
|
||||||
|
private byte[] sendername;
|
||||||
|
private byte[] recipient;
|
||||||
|
private byte[] message;
|
||||||
|
|
||||||
|
public PrivateMessage(byte[] senderhandle, byte[] sendername, byte[] recipient, byte[] message) {
|
||||||
|
this.senderhandle = senderhandle;
|
||||||
|
this.sendername = sendername;
|
||||||
|
this.recipient = recipient;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getRecipient() {
|
||||||
|
return this.recipient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getSenderHandle() {
|
||||||
|
return this.senderhandle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getMessage() {
|
||||||
|
return this.message;
|
||||||
|
}
|
||||||
|
|
||||||
|
// create a packet for broadcast
|
||||||
|
public byte[] getPacketData() {
|
||||||
|
ByteBuffer z = ByteBuffer.wrap(new byte[200]);
|
||||||
|
|
||||||
|
// handle and name of sender
|
||||||
|
z.putShort((short) senderhandle.length);
|
||||||
|
z.put(senderhandle);
|
||||||
|
z.putShort((short) sendername.length);
|
||||||
|
z.put(sendername);
|
||||||
|
|
||||||
|
// message
|
||||||
|
z.putShort((short) message.length);
|
||||||
|
z.put(message);
|
||||||
|
|
||||||
|
byte[] retval = new byte[z.position()];
|
||||||
|
z.rewind();
|
||||||
|
z.get(retval);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
}
|
||||||
52
bioserver/Room.java
Normal file
52
bioserver/Room.java
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object for rooms within areas
|
||||||
|
*/
|
||||||
|
public class Room {
|
||||||
|
public static final byte STATUS_ACTIVE = 3;
|
||||||
|
public static final byte STATUS_INACTIVE = 0;
|
||||||
|
|
||||||
|
private int areanumber;
|
||||||
|
private String name;
|
||||||
|
private byte status;
|
||||||
|
|
||||||
|
public Room(int area, String name, byte status) {
|
||||||
|
this.name = name;
|
||||||
|
this.status = status;
|
||||||
|
this.areanumber = area;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getStatus() {
|
||||||
|
return this.status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAreaNumber() {
|
||||||
|
return this.areanumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
65
bioserver/Rooms.java
Normal file
65
bioserver/Rooms.java
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* a class containing all rooms
|
||||||
|
*/
|
||||||
|
public class Rooms {
|
||||||
|
private List rooms;
|
||||||
|
private int numberOfAreas;
|
||||||
|
private final int numberOfRooms = 10;
|
||||||
|
|
||||||
|
public Rooms(int numberOfAreas) {
|
||||||
|
rooms = new LinkedList();
|
||||||
|
this.numberOfAreas = numberOfAreas;
|
||||||
|
|
||||||
|
for(int i=1; i<=numberOfAreas; i++) {
|
||||||
|
rooms.add(new Room(i, "R1", Room.STATUS_ACTIVE));
|
||||||
|
rooms.add(new Room(i, "R2", Room.STATUS_ACTIVE));
|
||||||
|
rooms.add(new Room(i, "R3", Room.STATUS_ACTIVE));
|
||||||
|
rooms.add(new Room(i, "R4", Room.STATUS_ACTIVE));
|
||||||
|
rooms.add(new Room(i, "R5", Room.STATUS_ACTIVE));
|
||||||
|
rooms.add(new Room(i, "R6", Room.STATUS_ACTIVE));
|
||||||
|
rooms.add(new Room(i, "R7", Room.STATUS_ACTIVE));
|
||||||
|
rooms.add(new Room(i, "R8", Room.STATUS_ACTIVE));
|
||||||
|
rooms.add(new Room(i, "R9", Room.STATUS_ACTIVE));
|
||||||
|
rooms.add(new Room(i, "RA", Room.STATUS_ACTIVE));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getStatus(int areanr, int roomnr) {
|
||||||
|
Room r = (Room) rooms.get((areanr-1)*this.numberOfRooms + roomnr-1);
|
||||||
|
return r.getStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName(int areanr, int roomnr) {
|
||||||
|
Room r = (Room) rooms.get((areanr-1)*this.numberOfRooms + roomnr-1);
|
||||||
|
return r.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRoomCount() {
|
||||||
|
return this.numberOfRooms;
|
||||||
|
}
|
||||||
|
}
|
||||||
170
bioserver/RuleSet.java
Normal file
170
bioserver/RuleSet.java
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object for a rule
|
||||||
|
* rules are organzied in rulesets
|
||||||
|
* each slot has one ruleset
|
||||||
|
*/
|
||||||
|
public class RuleSet {
|
||||||
|
public class Rule {
|
||||||
|
private String name;
|
||||||
|
private byte attribute; // TODO: what happens if <>1 ?
|
||||||
|
private byte value;
|
||||||
|
|
||||||
|
public Rule(String name, int attribute, int value){
|
||||||
|
this.name = name;
|
||||||
|
this.attribute = (byte) (attribute & 0xff);
|
||||||
|
this.value = (byte) (value & 0xff);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getAttribute() {
|
||||||
|
return attribute;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(byte value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// standard setting
|
||||||
|
// four players, ten mins wait, very hard
|
||||||
|
public Rule[] ruleset = {
|
||||||
|
new Rule("number of players", 1, 2),
|
||||||
|
new Rule("wait limit", 1, 2),
|
||||||
|
new Rule("difficulty level", 1, 3),
|
||||||
|
new Rule("friendly fire", 1, 0),
|
||||||
|
};
|
||||||
|
|
||||||
|
public Rule[][] attributes = {
|
||||||
|
{
|
||||||
|
new Rule("two players", 0, 0),
|
||||||
|
new Rule("three players", 0, 0),
|
||||||
|
new Rule("four players", 0, 0)
|
||||||
|
}, {
|
||||||
|
new Rule("three minutes", 0, 0),
|
||||||
|
new Rule("five minutes", 0, 0),
|
||||||
|
new Rule("ten minutes", 0, 0),
|
||||||
|
new Rule("fifteen minutes", 0, 0),
|
||||||
|
new Rule("thirty minutes", 0, 0)
|
||||||
|
}, {
|
||||||
|
new Rule("easy", 0, 0),
|
||||||
|
new Rule("normal", 0, 0),
|
||||||
|
new Rule("hard", 0, 0),
|
||||||
|
new Rule("very hard", 0, 0)
|
||||||
|
}, {
|
||||||
|
new Rule("off", 0,0),
|
||||||
|
new Rule("on", 0,0),
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public void RuleSet() {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// helper function to get a database field from the different rulesets of areas
|
||||||
|
public static String getRuleField(int area, byte rulenr) {
|
||||||
|
switch(rulenr) {
|
||||||
|
case 0: return("maxplayers");
|
||||||
|
case 1: return(null); //return("waittime");
|
||||||
|
case 2: return("difficulty");
|
||||||
|
case 3: return("friendlyfire");
|
||||||
|
default: return(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reset() {
|
||||||
|
// reset to standard
|
||||||
|
ruleset[0].setValue((byte) 2);
|
||||||
|
ruleset[1].setValue((byte) 2);
|
||||||
|
ruleset[2].setValue((byte) 3);
|
||||||
|
ruleset[3].setValue((byte) 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
public String getRuleName(int nr) {
|
||||||
|
return ruleset[nr].getName();
|
||||||
|
};
|
||||||
|
|
||||||
|
public byte getRuleAttribute(int nr) {
|
||||||
|
return ruleset[nr].getAttribute();
|
||||||
|
};
|
||||||
|
|
||||||
|
public String getRuleAttName(int nr, int nratt) {
|
||||||
|
return attributes[nr][nratt].getName();
|
||||||
|
};
|
||||||
|
|
||||||
|
public byte getRuleAttAtt(int nr, int nratt) {
|
||||||
|
return attributes[nr][nratt].getAttribute();
|
||||||
|
};
|
||||||
|
|
||||||
|
public int getRulesCount() {
|
||||||
|
return ruleset.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRulesAttCount(int rulenr) {
|
||||||
|
return attributes[rulenr].length;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getRuleValue(int rulenr) {
|
||||||
|
return ruleset[rulenr].getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRuleValue(int rulenr, byte value) {
|
||||||
|
ruleset[rulenr].setValue(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getDifficulty() {
|
||||||
|
return ruleset[2].getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getFriendlyFire() {
|
||||||
|
return ruleset[3].getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getWaitTime() {
|
||||||
|
switch (ruleset[1].getValue()) {
|
||||||
|
case 0: return(3);
|
||||||
|
case 1: return(5);
|
||||||
|
case 2: return(10);
|
||||||
|
case 3: return(15);
|
||||||
|
case 4: return(30);
|
||||||
|
default: return(30);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getNumberOfPlayers() {
|
||||||
|
switch (ruleset[0].getValue()) {
|
||||||
|
case 0: return(2);
|
||||||
|
case 1: return(3);
|
||||||
|
case 2: return(4);
|
||||||
|
default: return(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
42
bioserver/ServerChangeEvent.java
Normal file
42
bioserver/ServerChangeEvent.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.nio.channels.SocketChannel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object for the request queue
|
||||||
|
*/
|
||||||
|
public class ServerChangeEvent {
|
||||||
|
public static final int REGISTER = 1;
|
||||||
|
public static final int CHANGEOPS = 2;
|
||||||
|
public static final int FORCECLOSE = 3;
|
||||||
|
|
||||||
|
public SocketChannel socket;
|
||||||
|
public int type;
|
||||||
|
public int ops;
|
||||||
|
|
||||||
|
public ServerChangeEvent(SocketChannel socket, int type, int ops) {
|
||||||
|
this.socket = socket;
|
||||||
|
this.type = type;
|
||||||
|
this.ops = ops;
|
||||||
|
}
|
||||||
|
}
|
||||||
38
bioserver/ServerDataEvent.java
Normal file
38
bioserver/ServerDataEvent.java
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.nio.channels.SocketChannel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object for the packet server is sending
|
||||||
|
*/
|
||||||
|
class ServerDataEvent {
|
||||||
|
public ServerThread server;
|
||||||
|
public SocketChannel socket;
|
||||||
|
public byte[] data;
|
||||||
|
|
||||||
|
public ServerDataEvent(ServerThread server, SocketChannel socket, byte[] data) {
|
||||||
|
this.server = server;
|
||||||
|
this.socket = socket;
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
76
bioserver/ServerMain.java
Normal file
76
bioserver/ServerMain.java
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main class for initialisation
|
||||||
|
*/
|
||||||
|
public class ServerMain {
|
||||||
|
// the server listens on this port
|
||||||
|
public final static int LOBBYPORT = 8300;
|
||||||
|
public final static int GAMEPORT = 8690; // if you change this, search for gs_info
|
||||||
|
|
||||||
|
// Entry point
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
System.out.println("------------------------------\n"+
|
||||||
|
"- fanmade server for -\n"+
|
||||||
|
"- Biohazard Outbreak File #1 -\n"+
|
||||||
|
"- -\n"+
|
||||||
|
"- (c) 2013-2019 obsrv.org -\n"+
|
||||||
|
"- no23@deathless.net -\n"+
|
||||||
|
"------------------------------\n");
|
||||||
|
|
||||||
|
// setup the packethandler in his own thread
|
||||||
|
PacketHandler packethandler = new PacketHandler();
|
||||||
|
new Thread(packethandler).start();
|
||||||
|
|
||||||
|
// create the server thread
|
||||||
|
ServerThread server = new ServerThread(null, LOBBYPORT, packethandler);
|
||||||
|
new Thread(server).start();
|
||||||
|
|
||||||
|
// create a simple gameserver
|
||||||
|
GameServerPacketHandler packethandler2 = new GameServerPacketHandler();
|
||||||
|
new Thread(packethandler2).start();
|
||||||
|
GameServerThread gsserver = new GameServerThread(null, GAMEPORT, packethandler2);
|
||||||
|
new Thread(gsserver).start();
|
||||||
|
|
||||||
|
// allow usage
|
||||||
|
packethandler.setGameServerPacketHandler(packethandler2);
|
||||||
|
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
Logger.getLogger(ServerMain.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// last but not least
|
||||||
|
// create a thread for the keepalivepings and cleanups
|
||||||
|
new Thread(new HeartBeatThread(server, packethandler, gsserver, packethandler2)).start();
|
||||||
|
|
||||||
|
Date date = new Date();
|
||||||
|
System.out.println(date.toString()+" server started");
|
||||||
|
}
|
||||||
|
}
|
||||||
133
bioserver/ServerStreamBuffer.java
Normal file
133
bioserver/ServerStreamBuffer.java
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* handling of messages that were fragmented by tcp
|
||||||
|
*/
|
||||||
|
public class ServerStreamBuffer {
|
||||||
|
// maximum of packetsize to exspect
|
||||||
|
private static final int RECEIVESIZE = 8192;
|
||||||
|
|
||||||
|
// we need a ByteBuffer
|
||||||
|
public ByteBuffer buf = ByteBuffer.allocate(RECEIVESIZE);
|
||||||
|
|
||||||
|
// pointer to actual message
|
||||||
|
private int messptr;
|
||||||
|
|
||||||
|
public ServerStreamBuffer () {
|
||||||
|
this.messptr = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// return a buffer with complete messages (lobby)
|
||||||
|
public byte[] getCompleteMessages() {
|
||||||
|
byte[] b = buf.array();
|
||||||
|
int size = this.buf.position()-this.messptr;
|
||||||
|
int total = 0;
|
||||||
|
int plen;
|
||||||
|
|
||||||
|
// enough data for a complete message?
|
||||||
|
if(size >= Packet.HEADERSIZE) {
|
||||||
|
// determine size of complete messages
|
||||||
|
while(size>0) {
|
||||||
|
// length of this mesage
|
||||||
|
plen = (((int) b[messptr+total+4] << 8)&0xFF00) | ((int) b[messptr+total+5] &0xFF);
|
||||||
|
size = size - plen - Packet.HEADERSIZE;
|
||||||
|
// if it's a full message, add to total
|
||||||
|
if(size >= 0) {
|
||||||
|
total = total + plen + Packet.HEADERSIZE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// not enough data for a message
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// total holds the size of our new buffer
|
||||||
|
byte[] retval = new byte[total];
|
||||||
|
System.arraycopy(b, messptr, retval, 0, total);
|
||||||
|
|
||||||
|
// size indicates fragmentation
|
||||||
|
if(size == 0) {
|
||||||
|
this.messptr = 0;
|
||||||
|
buf.clear();
|
||||||
|
} else {
|
||||||
|
// let's continue next time
|
||||||
|
this.messptr = this.messptr + total;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
// return a buffer with complete messages (gameserver)
|
||||||
|
public byte[] getCompleteGameMessages() {
|
||||||
|
byte[] b = buf.array();
|
||||||
|
// is it a gameplay packet to check, or a lobby packet ?
|
||||||
|
// for simplicity we assume that session packet is always complete!
|
||||||
|
if((b[0]==(byte)0x82) && (b[1]==0x02)) {
|
||||||
|
byte[] retval = new byte[buf.position()];
|
||||||
|
buf.rewind();
|
||||||
|
buf.get(retval);
|
||||||
|
this.buf.clear();
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
int size = this.buf.position()-this.messptr;
|
||||||
|
int total = 0;
|
||||||
|
int plen;
|
||||||
|
|
||||||
|
// enough data for a complete message? at least 2 bytes needed!
|
||||||
|
if(size >= 1) {
|
||||||
|
// determine size of complete messages
|
||||||
|
while(size>0) {
|
||||||
|
// length of this mesage
|
||||||
|
plen = (byte) b[messptr+total] & 0x0FF;
|
||||||
|
size = size - plen;
|
||||||
|
// if it's a full message, add to total
|
||||||
|
if(size >= 0) {
|
||||||
|
total = total + plen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// not enough data for a message
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// total holds the size of our new buffer
|
||||||
|
byte[] retval = new byte[total];
|
||||||
|
System.arraycopy(b, messptr, retval, 0, total);
|
||||||
|
|
||||||
|
// size indicates fragmentation
|
||||||
|
if(size == 0) {
|
||||||
|
this.messptr = 0;
|
||||||
|
this.buf.clear();
|
||||||
|
} else {
|
||||||
|
// let's continue next time
|
||||||
|
this.messptr = this.messptr + total;
|
||||||
|
}
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
304
bioserver/ServerThread.java
Normal file
304
bioserver/ServerThread.java
Normal file
@@ -0,0 +1,304 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.channels.SelectionKey;
|
||||||
|
import java.nio.channels.Selector;
|
||||||
|
import java.nio.channels.ServerSocketChannel;
|
||||||
|
import java.nio.channels.SocketChannel;
|
||||||
|
import java.nio.channels.spi.SelectorProvider;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* this thread handles connections and traffic queues
|
||||||
|
*/
|
||||||
|
class ServerThread implements Runnable {
|
||||||
|
|
||||||
|
// host:port combination to listen
|
||||||
|
private InetAddress hostAddress;
|
||||||
|
private int port;
|
||||||
|
|
||||||
|
// selector to monitor
|
||||||
|
private Selector selector;
|
||||||
|
|
||||||
|
// The channel on which we'll accept connections
|
||||||
|
private ServerSocketChannel serverChannel;
|
||||||
|
|
||||||
|
// thread of the packethandler
|
||||||
|
private PacketHandler packethandler;
|
||||||
|
|
||||||
|
// A list of ChangeRequest instances
|
||||||
|
private List changeRequests = new LinkedList();
|
||||||
|
|
||||||
|
// Maps a SocketChannel to a list of ByteBuffer instances
|
||||||
|
private Map pendingData = new HashMap();
|
||||||
|
|
||||||
|
// The buffer into which we'll read data when it's available
|
||||||
|
private ServerStreamBuffer readBuffer;
|
||||||
|
|
||||||
|
// Maps a SocketChannel to a ServerStreamBuffer (allows messaging)
|
||||||
|
private Map readbuffers = new HashMap();
|
||||||
|
|
||||||
|
// was initialisation ok ?
|
||||||
|
private boolean initOK;
|
||||||
|
|
||||||
|
// function to initialise the selector
|
||||||
|
private Selector initSelector() throws IOException {
|
||||||
|
// Create a new selector
|
||||||
|
Selector socketSelector = SelectorProvider.provider().openSelector();
|
||||||
|
|
||||||
|
// Create a new non-blocking server socket channel
|
||||||
|
this.serverChannel = ServerSocketChannel.open();
|
||||||
|
serverChannel.configureBlocking(false);
|
||||||
|
|
||||||
|
// Bind the server socket to the specified address and port
|
||||||
|
InetSocketAddress isa = new InetSocketAddress(this.hostAddress, this.port);
|
||||||
|
serverChannel.socket().bind(isa);
|
||||||
|
|
||||||
|
// Register the server socket channel, indicating an interest in
|
||||||
|
// accepting new connections
|
||||||
|
serverChannel.register(socketSelector, SelectionKey.OP_ACCEPT);
|
||||||
|
|
||||||
|
return socketSelector;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ServerThread(InetAddress hostAddress, int port, PacketHandler packethandler) {
|
||||||
|
this.initOK = true;
|
||||||
|
try {
|
||||||
|
this.hostAddress = hostAddress;
|
||||||
|
this.port = port;
|
||||||
|
this.selector = this.initSelector();
|
||||||
|
this.packethandler = packethandler;
|
||||||
|
} catch (IOException ex) {
|
||||||
|
Logging.println("Lobbyserver constructor exception caught!");
|
||||||
|
this.initOK = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// iteration of selector, deal accept, read and write
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
SelectionKey key;
|
||||||
|
|
||||||
|
while (this.initOK) {
|
||||||
|
try {
|
||||||
|
// Process any pending changes
|
||||||
|
synchronized(this.changeRequests) {
|
||||||
|
Iterator changes = this.changeRequests.iterator();
|
||||||
|
while (changes.hasNext()) {
|
||||||
|
ServerChangeEvent change = (ServerChangeEvent) changes.next();
|
||||||
|
key = change.socket.keyFor(this.selector);
|
||||||
|
if(key != null) {
|
||||||
|
if(key.isValid()) { // drop pending request for closed/cancelled channel
|
||||||
|
switch(change.type) {
|
||||||
|
case ServerChangeEvent.CHANGEOPS:
|
||||||
|
key.interestOps(change.ops);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ServerChangeEvent.FORCECLOSE:
|
||||||
|
this.close(key);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.changeRequests.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for an event on the registered channels
|
||||||
|
this.selector.select();
|
||||||
|
|
||||||
|
// Iterate over the set of keys for which events are available
|
||||||
|
Iterator selectedKeys = this.selector.selectedKeys().iterator();
|
||||||
|
while (selectedKeys.hasNext()) {
|
||||||
|
key = (SelectionKey) selectedKeys.next();
|
||||||
|
selectedKeys.remove();
|
||||||
|
|
||||||
|
if (!key.isValid()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check what event is available and deal with it
|
||||||
|
if (key.isValid() && key.isAcceptable()) {
|
||||||
|
this.accept(key);
|
||||||
|
} else if (key.isValid() && key.isReadable()) {
|
||||||
|
this.read(key);
|
||||||
|
} else if (key.isValid() && key.isWritable()) {
|
||||||
|
this.write(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logging.println("Lobbyserver iteration exception caught!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// closing a connection
|
||||||
|
private synchronized void close(SelectionKey key) throws IOException {
|
||||||
|
try {
|
||||||
|
SocketChannel socketChannel = (SocketChannel) key.channel();
|
||||||
|
Logging.println("Lobbyserver closes connection to :" + socketChannel.getRemoteAddress());
|
||||||
|
key.channel().close();
|
||||||
|
key.cancel();
|
||||||
|
|
||||||
|
// cleanup
|
||||||
|
this.readbuffers.remove(socketChannel);
|
||||||
|
this.pendingData.remove(socketChannel);
|
||||||
|
this.packethandler.removeClientNoDisconnect(this, socketChannel);
|
||||||
|
} catch (Exception e){
|
||||||
|
// nothing ...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// accepting a new connection
|
||||||
|
private void accept(SelectionKey key) throws IOException {
|
||||||
|
// For an accept to be pending the channel must be a server socket channel.
|
||||||
|
ServerSocketChannel serverSocketChannel = (ServerSocketChannel) key.channel();
|
||||||
|
|
||||||
|
// Accept the connection and make it non-blocking
|
||||||
|
SocketChannel socketChannel = serverSocketChannel.accept();
|
||||||
|
Socket socket = socketChannel.socket();
|
||||||
|
socketChannel.configureBlocking(false);
|
||||||
|
|
||||||
|
// Register the new SocketChannel with our Selector, indicating
|
||||||
|
// we'd like to be notified when there's data waiting to be read
|
||||||
|
socketChannel.register(this.selector, SelectionKey.OP_READ);
|
||||||
|
|
||||||
|
// and we need a readbuffer for this channel
|
||||||
|
if(readbuffers.get(socketChannel) == null) {
|
||||||
|
readbuffers.put(socketChannel, new ServerStreamBuffer());
|
||||||
|
}
|
||||||
|
|
||||||
|
// send the first packet to initiate the protocol
|
||||||
|
this.packethandler.sendLogin(this, socketChannel);
|
||||||
|
}
|
||||||
|
|
||||||
|
// read from socket
|
||||||
|
private void read(SelectionKey key) throws IOException {
|
||||||
|
SocketChannel socketChannel = (SocketChannel) key.channel();
|
||||||
|
int numRead;
|
||||||
|
|
||||||
|
// get the buffer for this channel
|
||||||
|
this.readBuffer = (ServerStreamBuffer) readbuffers.get(socketChannel);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// read / append to buffer
|
||||||
|
numRead = socketChannel.read(this.readBuffer.buf);
|
||||||
|
} catch (IOException e) {
|
||||||
|
// The remote forcibly closed the connection, cancel
|
||||||
|
// the selection key and close the channel.
|
||||||
|
// also remove this client list
|
||||||
|
this.close(key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (numRead == -1) {
|
||||||
|
// Remote entity shut the socket down cleanly. Do the
|
||||||
|
// same from our end and cancel the channel.
|
||||||
|
this.close(key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hand the data off to our worker thread
|
||||||
|
byte[] data = this.readBuffer.getCompleteMessages();
|
||||||
|
if(data != null) this.packethandler.processData(this, socketChannel, data, data.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// write to socket
|
||||||
|
private void write(SelectionKey key) throws IOException {
|
||||||
|
SocketChannel socketChannel = (SocketChannel) key.channel();
|
||||||
|
|
||||||
|
synchronized (this.pendingData) {
|
||||||
|
List queue = (List) this.pendingData.get(socketChannel);
|
||||||
|
|
||||||
|
// Write until there's no more data ...
|
||||||
|
while (!queue.isEmpty()) {
|
||||||
|
ByteBuffer buf = (ByteBuffer) queue.get(0);
|
||||||
|
try {
|
||||||
|
socketChannel.write(buf);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// something's wrong on writing, e.g. timeout
|
||||||
|
queue.clear();
|
||||||
|
this.close(key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (buf.remaining() > 0) {
|
||||||
|
// ... or the socket's buffer fills up
|
||||||
|
queue.clear();
|
||||||
|
this.close(key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
queue.remove(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (queue.isEmpty()) {
|
||||||
|
// We wrote away all data, so we're no longer interested
|
||||||
|
// in writing on this socket. Switch back to waiting for
|
||||||
|
// data.
|
||||||
|
key.interestOps(SelectionKey.OP_READ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// send to a connection
|
||||||
|
public void send(SocketChannel socket, byte[] data) {
|
||||||
|
synchronized (this.changeRequests) {
|
||||||
|
// Indicate we want the interest ops set changed
|
||||||
|
this.changeRequests.add(new ServerChangeEvent(socket, ServerChangeEvent.CHANGEOPS, SelectionKey.OP_WRITE));
|
||||||
|
|
||||||
|
// And queue the data we want written
|
||||||
|
synchronized (this.pendingData) {
|
||||||
|
List queue = (List) this.pendingData.get(socket);
|
||||||
|
if (queue == null) {
|
||||||
|
queue = new ArrayList();
|
||||||
|
this.pendingData.put(socket, queue);
|
||||||
|
}
|
||||||
|
queue.add(ByteBuffer.wrap(data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Finally, wake up our selecting thread so it can make the required changes
|
||||||
|
this.selector.wakeup();
|
||||||
|
}
|
||||||
|
|
||||||
|
// close a connection server sided
|
||||||
|
public void disconnect(SocketChannel socket) {
|
||||||
|
synchronized (this.changeRequests) {
|
||||||
|
this.changeRequests.add(new ServerChangeEvent(socket, ServerChangeEvent.FORCECLOSE, 0));
|
||||||
|
}
|
||||||
|
this.selector.wakeup();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
208
bioserver/Slot.java
Normal file
208
bioserver/Slot.java
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.nio.channels.SocketChannel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* class for a gameslot
|
||||||
|
* here are games organized
|
||||||
|
*/
|
||||||
|
public class Slot {
|
||||||
|
public final static byte STATUS_DISABLED = 0;
|
||||||
|
public final static byte STATUS_FREE = 1;
|
||||||
|
public final static byte STATUS_INCREATE = 2; // TODO: find this out
|
||||||
|
public final static byte STATUS_GAMESET = 3; // while creating ruleset
|
||||||
|
public final static byte STATUS_BUSY = 4; // FULL
|
||||||
|
|
||||||
|
// 0=training ground, 1=WT, ..., 6=elimination1
|
||||||
|
// TODO: possibly more ?
|
||||||
|
public final static byte SCENARIO_TRAINING = 0;
|
||||||
|
public final static byte SCENARIO_WILDTHINGS = 1;
|
||||||
|
public final static byte SCENARIO_UNDERBELLY = 2;
|
||||||
|
public final static byte SCENARIO_FLASHBACK = 3;
|
||||||
|
public final static byte SCENARIO_DESPERATETIMES = 4;
|
||||||
|
public final static byte SCENARIO_ENDOFTHEROAD = 5;
|
||||||
|
public final static byte SCENARIO_ELIMINATION1 = 6;
|
||||||
|
|
||||||
|
// 0 = not set 1 = dvd-rom 2 = hdd
|
||||||
|
// TODO: there are more! what means 0x11 ?
|
||||||
|
public final static byte LOAD_NOTSET = 0;
|
||||||
|
public final static byte LOAD_DVDROM = 1;
|
||||||
|
public final static byte LOAD_HARDSK = 2;
|
||||||
|
|
||||||
|
public final static byte PROTECTION_OFF = 0;
|
||||||
|
public final static byte PROTECTION_ON = 1;
|
||||||
|
|
||||||
|
public final static long WAITTIME_MILLSEC = 30*1000*1000;
|
||||||
|
|
||||||
|
public int area;
|
||||||
|
public int room;
|
||||||
|
public int slotnum;
|
||||||
|
public int gamenr;
|
||||||
|
public int betatest;
|
||||||
|
|
||||||
|
private byte[] name;
|
||||||
|
private byte status;
|
||||||
|
private byte[] password;
|
||||||
|
|
||||||
|
private byte protection; // using password ?
|
||||||
|
private byte scenario;
|
||||||
|
private byte slottype;
|
||||||
|
|
||||||
|
// rules for the game in slot
|
||||||
|
private RuleSet rules;
|
||||||
|
|
||||||
|
// timeout
|
||||||
|
private long livetime;
|
||||||
|
|
||||||
|
// room master's userid
|
||||||
|
private String host;
|
||||||
|
|
||||||
|
// create an empty slot
|
||||||
|
public Slot(int area, int room, int slotnum) {
|
||||||
|
this.area = area;
|
||||||
|
this.room = room;
|
||||||
|
this.slotnum = slotnum;
|
||||||
|
this.gamenr = 0;
|
||||||
|
this.betatest = 0;
|
||||||
|
|
||||||
|
this.name = "(free)".getBytes();
|
||||||
|
this.status = Slot.STATUS_FREE;
|
||||||
|
this.scenario = Slot.SCENARIO_TRAINING;
|
||||||
|
this.slottype = Slot.LOAD_NOTSET;
|
||||||
|
this.protection = Slot.PROTECTION_OFF;
|
||||||
|
this.rules = new RuleSet();
|
||||||
|
this.livetime = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reset() {
|
||||||
|
this.name = "(free)".getBytes();
|
||||||
|
this.status = Slot.STATUS_FREE;
|
||||||
|
this.scenario = Slot.SCENARIO_TRAINING;
|
||||||
|
this.slottype = Slot.LOAD_NOTSET;
|
||||||
|
this.protection = Slot.PROTECTION_OFF;
|
||||||
|
this.gamenr = 0;
|
||||||
|
this.betatest = 0;
|
||||||
|
rules.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(byte[] name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getPassword() {
|
||||||
|
return this.password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(byte[] passwd) {
|
||||||
|
this.password = passwd;
|
||||||
|
if(passwd.length > 0) this.protection = Slot.PROTECTION_ON;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getStatus() {
|
||||||
|
return this.status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(byte status) {
|
||||||
|
this.status= status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getProtection() {
|
||||||
|
return this.protection;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getSscenario() {
|
||||||
|
return this.scenario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSscenario(byte scenario) {
|
||||||
|
this.scenario = scenario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getSlotType() {
|
||||||
|
return this.slottype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSlotType(byte slottype) {
|
||||||
|
this.slottype = slottype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getRulesCount() {
|
||||||
|
return (byte) (this.rules.getRulesCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getRulesAttCount(int rulenr) {
|
||||||
|
return (byte) (this.rules.getRulesAttCount(rulenr));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRuleName(int rulenr) {
|
||||||
|
return rules.getRuleName(rulenr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getRuleValue(int rulenr) {
|
||||||
|
return rules.getRuleValue(rulenr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRuleValue(int rulenr, byte value) {
|
||||||
|
rules.setRuleValue(rulenr, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getRuleAttribute(int rulenr) {
|
||||||
|
return rules.getRuleAttribute(rulenr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRuleAttributeDescription(int rulenr, int attnr) {
|
||||||
|
return rules.getRuleAttName(rulenr, attnr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getRuleAttributeAtt(int rulenr, int attnr) {
|
||||||
|
return rules.getRuleAttAtt(rulenr, attnr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLivetime() {
|
||||||
|
this.livetime = System.currentTimeMillis() + this.rules.getWaitTime()*60*1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 0x0708 = 1800 seconds = 30 minutes
|
||||||
|
// on timeout always return 0, game will be started
|
||||||
|
public long getLivetime() {
|
||||||
|
long retval = (livetime - System.currentTimeMillis())/1000;
|
||||||
|
if (retval <0) retval = 0;
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RuleSet getRuleSet() {
|
||||||
|
return this.rules;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHost(String host) {
|
||||||
|
this.host = host;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHost() {
|
||||||
|
return this.host;
|
||||||
|
}
|
||||||
|
}
|
||||||
134
bioserver/Slots.java
Normal file
134
bioserver/Slots.java
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
/*
|
||||||
|
BioServer - Emulation of the long gone server for
|
||||||
|
Biohazard Outbreak File #1 (Playstation 2)
|
||||||
|
|
||||||
|
Copyright (C) 2013-2019 obsrv.org (no23@deathless.net)
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package bioserver;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Slots {
|
||||||
|
private List slots;
|
||||||
|
private int numberOfAreas;
|
||||||
|
private int numberOfRooms;
|
||||||
|
private final int numberOfSlots = 20;
|
||||||
|
|
||||||
|
// create a list of empty slots
|
||||||
|
public Slots(int numberOfAreas, int numberOfRooms) {
|
||||||
|
slots = new LinkedList();
|
||||||
|
this.numberOfAreas = numberOfAreas;
|
||||||
|
this.numberOfRooms = numberOfRooms;
|
||||||
|
|
||||||
|
for(int area=1; area<=numberOfAreas; area ++) {
|
||||||
|
for(int room=1; room<=numberOfRooms; room++) {
|
||||||
|
for(int slot=0; slot<20; slot++) {
|
||||||
|
slots.add(new Slot(area, room, slot));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int calcSlotnr(int area, int room, int slotnr) {
|
||||||
|
return ((slotnr-1) + ((room-1)*this.numberOfSlots) + ((area-1)*this.numberOfRooms*this.numberOfSlots));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Slot getSlot(int area, int room, int slotnr) {
|
||||||
|
return (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSlotCount() {
|
||||||
|
return this.numberOfSlots;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getStatus(int area, int room, int slotnr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getName(int area, int room, int slotnr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getScenario(int area, int room, int slotnr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getSscenario();
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getProtection(int area, int room, int slotnr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getProtection();
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getSlotType(int area, int room, int slotnr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getSlotType();
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getRulesCount(int area, int room, int slotnr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getRulesCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getRulesAttCount(int area, int room, int slotnr, int rulenr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getRulesAttCount(rulenr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRuleName(int area, int room, int slotnr, int rulenr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getRuleName(rulenr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getRuleValue(int area, int room, int slotnr, int rulenr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getRuleValue(rulenr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getRuleAttribute(int area, int room, int slotnr, int rulenr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getRuleAttribute(rulenr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRuleAttributeDescription(int area, int room, int slotnr, int rulenr, int attnr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getRuleAttributeDescription(rulenr, attnr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getRuleAttributeAtt(int area, int room, int slotnr, int rulenr, int attnr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getRuleAttributeAtt(rulenr, attnr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getDifficulty(int area, int room, int slotnr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getRuleSet().getDifficulty();
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getFriendlyFire(int area, int room, int slotnr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getRuleSet().getFriendlyFire();
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte getMaximumPlayers(int area, int room, int slotnr) {
|
||||||
|
Slot slot = (Slot) slots.get(calcSlotnr(area, room, slotnr));
|
||||||
|
return slot.getRuleSet().getNumberOfPlayers();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
8
bioserver/config.properties
Normal file
8
bioserver/config.properties
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Configuration for the server
|
||||||
|
|
||||||
|
# IP address for gameserver
|
||||||
|
gs_ip=192.168.6.66
|
||||||
|
|
||||||
|
# credentials for the database
|
||||||
|
db_user=bioserver
|
||||||
|
db_password=xxxxxxxxxxxxxxxx
|
||||||
48
database/bioserver.sql
Normal file
48
database/bioserver.sql
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||||
|
SET time_zone = "+00:00";
|
||||||
|
|
||||||
|
|
||||||
|
CREATE USER 'bioserver'@'localhost' IDENTIFIED BY 'xxxxxxxxxxxxxxxx';
|
||||||
|
CREATE DATABASE IF NOT EXISTS `bioserver` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
|
||||||
|
GRANT ALL PRIVILEGES ON `bioserver`.* TO 'bioserver'@'localhost';
|
||||||
|
|
||||||
|
USE `bioserver`;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `sessions` (
|
||||||
|
`userid` varchar(14) NOT NULL,
|
||||||
|
`ip` varchar(15) NOT NULL,
|
||||||
|
`port` int(11) NOT NULL,
|
||||||
|
`sessid` varchar(8) NOT NULL,
|
||||||
|
`gamesess` bigint(20) NOT NULL DEFAULT '0',
|
||||||
|
`lastlogin` timestamp NULL DEFAULT NULL,
|
||||||
|
`area` int(11) DEFAULT '-1',
|
||||||
|
`room` int(11) DEFAULT '0',
|
||||||
|
`slot` int(11) DEFAULT '0',
|
||||||
|
`state` int(11) DEFAULT '0',
|
||||||
|
KEY `gamesess` (`gamesess`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `hnpairs` (
|
||||||
|
`userid` varchar(14) NOT NULL,
|
||||||
|
`handle` varchar(6) NOT NULL,
|
||||||
|
`nickname` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
|
||||||
|
KEY `userid` (`userid`),
|
||||||
|
KEY `handle` (`handle`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `motd` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`message` varchar(2000) NOT NULL,
|
||||||
|
`active` int(11) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=27 ;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `users` (
|
||||||
|
`userid` varchar(14) NOT NULL,
|
||||||
|
`passwd` varchar(32) NOT NULL,
|
||||||
|
PRIMARY KEY (`userid`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
1
www/CRS-top.jsp
Normal file
1
www/CRS-top.jsp
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<html><head><meta http-equiv="Refresh" content="1; url=login.php"></head></html>
|
||||||
4
www/README.txt
Normal file
4
www/README.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
- The content of this folder must be served by a webserver.
|
||||||
|
- DNS of https://www01.kddi-mmbb.jp/00000002/ must be redirected to this folder.
|
||||||
|
- Keep an eye on the used SSL-ciphers, most of them are weak and you should harden your webserver
|
||||||
|
- using a self-signed certificate works
|
||||||
12
www/db_cred.php
Normal file
12
www/db_cred.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
$serv = 'localhost';
|
||||||
|
$datb = 'bioserver';
|
||||||
|
$user = 'bioserver';
|
||||||
|
$pass = 'xxxxxxxxxxxxxxxx';
|
||||||
|
|
||||||
|
$conn = mysql_connect($serv, $user, $pass)
|
||||||
|
or die ("connection error");
|
||||||
|
|
||||||
|
mysql_select_db($datb, $conn)
|
||||||
|
or die("database failure");
|
||||||
|
?>
|
||||||
38
www/enterareas.html
Normal file
38
www/enterareas.html
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<!--CRS-lbs-info-get-->
|
||||||
|
<META HTTP-EQUIV=Content-Type CONTENT=text/html;CHARSET=UTF-8>
|
||||||
|
</head>
|
||||||
|
<!-- Results -->
|
||||||
|
<!-- LBS domain name + port number -->
|
||||||
|
<!-- connection number -->
|
||||||
|
<!-- Maximum number of connections -->
|
||||||
|
<!-- Additional Information 1 -->
|
||||||
|
<!-- Additional Information 2 -->
|
||||||
|
<!-- Additional Information 3 -->
|
||||||
|
<!-- LBS domain name + port number -->
|
||||||
|
<!-- connection number -->
|
||||||
|
<!-- Maximum number of connections -->
|
||||||
|
<!-- Additional Information 1 -->
|
||||||
|
<!-- Additional Information 2 -->
|
||||||
|
<!-- Additional Information 3 -->
|
||||||
|
<!--
|
||||||
|
<CSV>
|
||||||
|
"OK",
|
||||||
|
"www01.kddi-mmbb.jp:8300",
|
||||||
|
"0",
|
||||||
|
"999",
|
||||||
|
"0ad601082008,WEST TOWN,2",
|
||||||
|
"<BODY><SIZE=4>Free AREA<BR><BODY>Create your own
|
||||||
|
games<BR><BODY>obsrv.org<END>",
|
||||||
|
"<BODY><SIZE=4>Not much to say<BR><BODY>have fun<BR><BODY>cu, the_fog<END>",
|
||||||
|
"www01.kddi-mmbb.jp:8300",
|
||||||
|
"0",
|
||||||
|
"999",
|
||||||
|
"0ad601082008,EAST TOWN,1",
|
||||||
|
"<BODY><SIZE=4>Scenario Mode<BR><BODY>DEFUNC!<BR><BODY>obsrv.org<END>",
|
||||||
|
"<BODY><SIZE=4>This mode is not<BR><BODY>fully implemented yet.<BR><BODY>cu,
|
||||||
|
the_fog<END>",
|
||||||
|
</CSV>
|
||||||
|
-->
|
||||||
|
</html>
|
||||||
14
www/footer.php
Normal file
14
www/footer.php
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<br></br>
|
||||||
|
<br></br>
|
||||||
|
|
||||||
|
<font size="-2"><br></br><br></br></font>
|
||||||
|
<table border="1" width="80%" cellspacing="0" cellpadding="0"></table>
|
||||||
|
<font size="-2"><br></br></font>
|
||||||
|
|
||||||
|
<font size="-2" color="#aaaaaa">
|
||||||
|
OBSRV - Fan Made Biohazard Outbreak(tm) Server
|
||||||
|
<br></br>
|
||||||
|
(c)2013-<?php echo date('Y'); ?> obsrv.org
|
||||||
|
</font>
|
||||||
|
</center>
|
||||||
|
</body></html>
|
||||||
10
www/header.php
Normal file
10
www/header.php
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<html><head><!--CRS-top-->
|
||||||
|
<title><?php echo 'non production server'; ?></title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
</head>
|
||||||
|
<body text="#D7E0FF" background="ps2_bg.png" bgcolor="black" link="#224EAB">
|
||||||
|
<center>
|
||||||
|
<img src="ps2_logo.png" width="320" height="109"></img>
|
||||||
|
|
||||||
|
<br></br>
|
||||||
|
<font size="-2"><br></br></font>
|
||||||
53
www/login.php
Normal file
53
www/login.php
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
include('header.php');
|
||||||
|
?>
|
||||||
|
|
||||||
|
<font size="-2"><br></br></font>
|
||||||
|
<table align="center" width="100%" cellspacing="0" cellpadding="0">
|
||||||
|
<tr align="center" valign="top">
|
||||||
|
<td align="center" width="50%">
|
||||||
|
<form method="post" action="login_form.php">
|
||||||
|
Login with existing account:<br></br>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>ID:</td>
|
||||||
|
<td><input type="text" name="username"></input></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>Password:</td>
|
||||||
|
<td><input type="password" name="password"></input></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<input type="hidden" name="login" value="manual"></input>
|
||||||
|
<tr><td></td><td><input type="submit" value="LOGIN"></input></td></tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td align="center" width="50%">
|
||||||
|
<form method="post" action="login_form.php">
|
||||||
|
Create new account and login:<br></br>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>ID:</td>
|
||||||
|
<td><input type="text" name="username"></input></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>Password:</td>
|
||||||
|
<td><input type="password" name="password"></input></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<input type="hidden" name="login" value="newaccount"></input>
|
||||||
|
<tr><td></td><td><input type="submit" value="LOGIN"></input></td></tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<?php include('footer.php'); ?>
|
||||||
92
www/login_form.php
Normal file
92
www/login_form.php
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
require_once('db_cred.php');
|
||||||
|
|
||||||
|
function create_sessid() {
|
||||||
|
for(;;) {
|
||||||
|
$sessid = (mt_rand(10000000,99999999));
|
||||||
|
$res = mysql_query('select count(*) as cnt from sessions where sessid='.$sessid);
|
||||||
|
$row = mysql_fetch_array($res);
|
||||||
|
if($row["cnt"] == 0) break;
|
||||||
|
}
|
||||||
|
return($sessid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$login_result = '';
|
||||||
|
if ($_POST["login"] == 'manual') {
|
||||||
|
// kind of sanitizing
|
||||||
|
$username = substr(preg_replace("/[^A-Za-z0-9 _]/", "", $_POST["username"]), 0, 14);
|
||||||
|
$password = substr(preg_replace("/[^A-Za-z0-9 _]/", "", $_POST["password"]), 0, 14);
|
||||||
|
|
||||||
|
// no password entered, return to login page
|
||||||
|
if($password == "" || $username=="") {
|
||||||
|
header('Location: CRS-top.jsp');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
$res = mysql_query('select count(*) as cnt from users where userid="'.$username.'" and passwd="'.$password.'"');
|
||||||
|
$row = mysql_fetch_array($res);
|
||||||
|
$authc = false;
|
||||||
|
if($row["cnt"] == 1) $authc = true;
|
||||||
|
|
||||||
|
if($authc == false) {
|
||||||
|
$login_result = 'Login failed. Your login/password combination is wrong.';
|
||||||
|
$login_result .= '<br><a href="CRS-top.jsp">back</a>';
|
||||||
|
} else {
|
||||||
|
// login was successful, now delete old sessions and create a new one
|
||||||
|
mysql_query('delete from sessions where lower(userid) = lower("'.$username.'")');
|
||||||
|
$ip = $_SERVER["REMOTE_ADDR"]; // get the ip number of the user
|
||||||
|
$port = $_SERVER["REMOTE_PORT"]; // get the port of the user
|
||||||
|
|
||||||
|
// setup session
|
||||||
|
$sessid = create_sessid();
|
||||||
|
$res = mysql_query('insert into sessions (userid,ip,port,sessid,lastlogin) values(lower("'.$username.'"),"'.$ip.'","'.$port.'","'.$sessid.'",now())');
|
||||||
|
if(!$res) $login_result = 'Login successful. Session creation failed.<br><a href="login.php">Back to menu</a>';
|
||||||
|
else $login_result = 'Login successful.<br><a href="startsession.php?sessid='.$sessid.'.">Enter lobbies</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if ($_POST["login"] == 'newaccount') {
|
||||||
|
// kind of sanitizing
|
||||||
|
$username = substr(preg_replace("/[^A-Za-z0-9 _]/", "", $_POST["username"]), 0, 14);
|
||||||
|
$password = substr(preg_replace("/[^A-Za-z0-9 _]/", "", $_POST["password"]), 0, 14);
|
||||||
|
|
||||||
|
// no password entered, return to login page
|
||||||
|
if($password == "" || $username=="") {
|
||||||
|
header('Location: CRS-top.jsp');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
// add new user
|
||||||
|
$res2 = mysql_query('insert into users (userid, passwd) values("'.$username.'","'.$password.'")');
|
||||||
|
if($res2) {
|
||||||
|
$ip = $_SERVER["REMOTE_ADDR"]; // get the ip number of the user
|
||||||
|
$port = $_SERVER["REMOTE_PORT"]; // get the port of the user
|
||||||
|
|
||||||
|
// setup session
|
||||||
|
$sessid = create_sessid();
|
||||||
|
$res = mysql_query('insert into sessions (userid,ip,port,sessid,lastlogin) values(lower("'.$username.'"),"'.$ip.'","'.$port.'","'.$sessid.'",now())');
|
||||||
|
if(!$res) $login_result = 'Login successful. Session creation failed.<br><a href="login.php">Back to menu</a>';
|
||||||
|
else $login_result = 'Login successful.<br><a href="startsession.php?sessid='.$sessid.'.">Enter lobbies</a>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$login_result = 'Login failed. User already exists.<br><a href="CRS-top.jsp">back</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$login_result = 'Login failed.<br><a href="CRS-top.jsp">back</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
include('header.php');
|
||||||
|
?>
|
||||||
|
|
||||||
|
<br></br>
|
||||||
|
<br></br>
|
||||||
|
|
||||||
|
<?php echo $login_result; ?>
|
||||||
|
|
||||||
|
<br></br>
|
||||||
|
<br></br>
|
||||||
|
|
||||||
|
<?php include('footer.php'); ?>
|
||||||
BIN
www/ps2_bg.png
Normal file
BIN
www/ps2_bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
BIN
www/ps2_logo.png
Normal file
BIN
www/ps2_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.6 KiB |
8
www/startsession.php
Normal file
8
www/startsession.php
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
echo ("<html><head><!--CRS-game-start-->");
|
||||||
|
echo ("<META HTTP-EQUIV=Content-Type CONTENT=text/html;CHARSET=EUC-JP></head>");
|
||||||
|
echo ("<!--result--><!--connection id--><!--start the game url--><!--exit game url-->");
|
||||||
|
echo ("<!--<CSV>\"OK\",\"".$_GET["sessid"]."\",");
|
||||||
|
echo ("\"https://www01.kddi-mmbb.jp/00000002/enterareas.html\",");
|
||||||
|
echo ("\"https://www01.kddi-mmbb.jp/00000002/login.php\",</CSV>--></html>");
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user