Initial
This commit is contained in:
commit
5bece41980
31
.gitignore
vendored
Normal file
31
.gitignore
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
661
LICENSE.md
Normal file
661
LICENSE.md
Normal file
@ -0,0 +1,661 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://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 <https://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
|
||||
<https://www.gnu.org/licenses/>.
|
5
README.md
Normal file
5
README.md
Normal file
@ -0,0 +1,5 @@
|
||||

|
||||

|
||||

|
||||
# Shararam server
|
||||
> Feels like a distant memory
|
162
pom.xml
Normal file
162
pom.xml
Normal file
@ -0,0 +1,162 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.alterdekim.game</groupId>
|
||||
<artifactId>rtmpSpring</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>gitea</id>
|
||||
<url>https://gitea.awain.net/api/packages/alterwain/maven</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>gitea</id>
|
||||
<url>https://gitea.awain.net/api/packages/alterwain/maven</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>gitea</id>
|
||||
<url>https://gitea.awain.net/api/packages/alterwain/maven</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
|
||||
<url>https://blog.awain.net</url>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>Michael Wain</name>
|
||||
<email>alterwain@protonmail.com</email>
|
||||
<organization>The God</organization>
|
||||
<organizationUrl>https://blog.awain.net</organizationUrl>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alterdekim.game</groupId>
|
||||
<artifactId>actionScriptDecompiler</artifactId>
|
||||
<version>0.0.10</version>
|
||||
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.thymeleaf.extras</groupId>
|
||||
<artifactId>thymeleaf-extras-springsecurity6</artifactId>
|
||||
<!-- Temporary explicit version to fix Thymeleaf bug -->
|
||||
<version>3.1.1.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.33</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-xml</artifactId>
|
||||
<version>2.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
<version>2.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
<version>1.18.28</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.javatuples</groupId>
|
||||
<artifactId>javatuples</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>14</source>
|
||||
<target>14</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
39
src/main/java/com/alterdekim/game/Application.java
Normal file
39
src/main/java/com/alterdekim/game/Application.java
Normal file
@ -0,0 +1,39 @@
|
||||
package com.alterdekim.game;
|
||||
|
||||
import com.alterdekim.game.storage.StorageService;
|
||||
import org.apache.catalina.connector.Connector;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
|
||||
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.web.filter.CharacterEncodingFilter;
|
||||
|
||||
@EnableScheduling
|
||||
@SpringBootApplication
|
||||
public class Application {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
CommandLineRunner init(StorageService storageService) {
|
||||
return (args) -> {
|
||||
storageService.init();
|
||||
};
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ConfigurableServletWebServerFactory webServerFactory() {
|
||||
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
|
||||
factory.addConnectorCustomizers(connector -> {
|
||||
connector.setProperty("relaxedQueryChars", "[]");
|
||||
connector.setProperty("relaxedPathChars", "[]");
|
||||
});
|
||||
return factory;
|
||||
}
|
||||
}
|
230
src/main/java/com/alterdekim/game/component/GameServer.java
Normal file
230
src/main/java/com/alterdekim/game/component/GameServer.java
Normal file
@ -0,0 +1,230 @@
|
||||
package com.alterdekim.game.component;
|
||||
|
||||
import com.alterdekim.game.component.game.*;
|
||||
import com.alterdekim.game.component.rtmp.ConnectedProcessor;
|
||||
import com.alterdekim.game.message.*;
|
||||
import com.alterdekim.game.message.amf.AMFDeserializer;
|
||||
import com.alterdekim.game.message.amf.AMFObject;
|
||||
import com.alterdekim.game.message.amf.AMFSerializer;
|
||||
import com.alterdekim.game.message.amf.AMFValueType;
|
||||
import com.alterdekim.game.security.AuthenticationUtil;
|
||||
import com.alterdekim.game.service.LocationService;
|
||||
import com.alterdekim.game.service.UserService;
|
||||
import com.alterdekim.game.utils.GameUtils;
|
||||
import com.alterdekim.game.utils.StringUtils;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class GameServer {
|
||||
|
||||
@Autowired
|
||||
private UserService users;
|
||||
|
||||
@Autowired
|
||||
private LocationService locationService;
|
||||
|
||||
private Map<Long, Player> players;
|
||||
|
||||
public GameServer() {
|
||||
this.players = new HashMap<>();
|
||||
}
|
||||
|
||||
public void onConnect(long playerId, String hwId, ConnectedProcessor connectedProcessor) {
|
||||
log.warn("GameServer.onConnect() connect: {}", playerId);
|
||||
Optional<String> username = users.getUsernameById(playerId);
|
||||
if( username.isEmpty() || !AuthenticationUtil.hwIdAuth(users.findByUsername(username.get()), hwId) ) {
|
||||
connectedProcessor.close();
|
||||
return;
|
||||
}
|
||||
this.players.put(playerId, new Player(connectedProcessor, username.get()));
|
||||
}
|
||||
|
||||
public void onMessage(long playerId, List<AMFObject> params ) {
|
||||
try {
|
||||
log.info("GameServer.onMessage() pid: {}, params: {}", playerId, params);
|
||||
switch(CommandType.fromString( (String) params.get(0).getValue() )) {
|
||||
case UserCommand:
|
||||
processUserMessage(playerId, AMFDeserializer.deserialize(params.subList(1, params.size()), UserMessage.class));
|
||||
break;
|
||||
case SetLocation:
|
||||
setPlayerLocation(playerId, AMFDeserializer.deserialize(params.subList(1, params.size()), SetLocationMessage.class));
|
||||
break;
|
||||
case SetUserAvatarState:
|
||||
setPlayerAvatarState(playerId, AMFDeserializer.deserialize(params.subList(1, params.size()), SetPlayerAvatarState.class));
|
||||
break;
|
||||
case SetUserAvatarPosition:
|
||||
setPlayerAvatarPosition(playerId, AMFDeserializer.deserialize(params.subList(1, params.size()), SetPlayerAvatarPosition.class));
|
||||
break;
|
||||
default:
|
||||
log.warn("GameServer.onMessage() unknown command: {}", params.get(0));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("GameServer.onMessage() error: {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private void setPlayerAvatarPosition(long playerId, SetPlayerAvatarPosition message) {
|
||||
players.get(playerId).setX((Double) message.getCoordinates().get("x").getValue());
|
||||
players.get(playerId).setY((Double) message.getCoordinates().get("y").getValue());
|
||||
this.sendInPlayersLocation(playerId, CommandType.SetUserAvatarPosition,
|
||||
new SetPlayerPosition(
|
||||
playerId,
|
||||
new Point((Double) message.getCoordinates().get("x").getValue(), (Double) message.getCoordinates().get("y").getValue()),
|
||||
message.getTweenerId().longValue()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
private void setPlayerAvatarState(long playerId, SetPlayerAvatarState message) {
|
||||
players.get(playerId).setState(message.getState());
|
||||
this.sendInPlayersLocation(playerId, CommandType.SetUserAvatarState,
|
||||
new SetPlayerState(playerId, message.getState())
|
||||
);
|
||||
}
|
||||
|
||||
private void processUserMessage(long playerId, UserMessage message) throws JsonProcessingException {
|
||||
log.info("GameServer.processUserMessage() message: {}", message);
|
||||
switch (UserCommandType.fromString(message.getCommandType())) {
|
||||
case GetUserInitData: // todo: add more info about user (see decompiled sources)
|
||||
String r = new XmlMapper().registerModule(new JavaTimeModule()).writeValueAsString(users.getUserInitInfoByUserId(playerId));
|
||||
this.sendResult(playerId, message.getTransactionId(), r);
|
||||
break;
|
||||
case UserFriendsGet: // todo: implement
|
||||
this.sendResult(playerId, message.getTransactionId(), new HashMap<>());
|
||||
break;
|
||||
case UserFriendsRequests: // todo: implement
|
||||
this.sendResult(playerId, message.getTransactionId(), new HashMap<>());
|
||||
break;
|
||||
case GetClubMap: // todo: implement
|
||||
this.sendResult(playerId, message.getTransactionId(), "</clubmap>");
|
||||
break;
|
||||
case GetFriendPanelData:
|
||||
this.sendResult(playerId, message.getTransactionId(), "");
|
||||
break;
|
||||
case UpdateUserData:
|
||||
this.sendResult(playerId, message.getTransactionId(), null);
|
||||
break;
|
||||
case GetUserLocation:
|
||||
double prevLocation = (Double) message.getArguments().get(2).getValue();
|
||||
if( prevLocation == 0.0d ) {
|
||||
this.sendResult(playerId,
|
||||
message.getTransactionId(),
|
||||
new XmlMapper().writeValueAsString(
|
||||
locationService.getDefaultLocation()
|
||||
)
|
||||
);
|
||||
}
|
||||
break;
|
||||
case ChatMessage:
|
||||
String text = (String) message.getArguments().get(1).getValue();
|
||||
sendInPlayersLocation(playerId, CommandType.ChatMessage, new ChatMessage(playerId, text));
|
||||
break;
|
||||
case Shoot:
|
||||
if( message.getSrv().equals("ROOM") ) {
|
||||
double x = (double) message.getArguments().get(1).getValue();
|
||||
double y = (double) message.getArguments().get(2).getValue();
|
||||
sendInPlayersLocation(playerId, CommandType.Shoot, new Shoot(playerId, x, y));
|
||||
break;
|
||||
}
|
||||
this.sendInPlayersLocation(playerId, CommandType.SetUserAvatarState,
|
||||
new SetPlayerState(playerId, players.get(playerId).getState())
|
||||
);
|
||||
break;
|
||||
case GetUserInfo:
|
||||
getUserInfo(playerId, message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// todo: add more info about user (see decompiled sources)
|
||||
private void getUserInfo(long playerId, UserMessage message) throws JsonProcessingException {
|
||||
String r = new XmlMapper().registerModule(new JavaTimeModule()).writeValueAsString(users.getUserInfoByUserId(playerId));
|
||||
this.sendResult(playerId, message.getTransactionId(), r);
|
||||
}
|
||||
|
||||
private void setPlayerLocation(long playerId, SetLocationMessage message) {
|
||||
Player p = this.players.get(playerId);
|
||||
this.deleteSelf(playerId, p.getLocationId());
|
||||
int prevLocation = p.getLocationId();
|
||||
p.setLocationId(GameUtils.extractLocationId(message.getLocation()));
|
||||
p.setX((Double) message.getCoordinates().get("x").getValue());
|
||||
p.setY((Double) message.getCoordinates().get("y").getValue());
|
||||
p.setState(message.getStartState());
|
||||
this.updateLocationPlayers(playerId, prevLocation);
|
||||
this.sendResult(playerId, message.getTransactionId(), "");
|
||||
}
|
||||
|
||||
private void deleteSelf(long playerId, int locationId) {
|
||||
this.sendInLocation(locationId, CommandType.RemoveUserFromLocation, playerId);
|
||||
}
|
||||
|
||||
private void updateLocationPlayers(long playerId, int prevLocation) {
|
||||
int locationId = this.players.get(playerId).getLocationId();
|
||||
this.sendInLocation(prevLocation, CommandType.RemoveUserFromLocation, playerId);
|
||||
for( int i = 0; i < 5; i++ ) {
|
||||
this.sendInPlayersLocation(playerId, CommandType.AddUserToLocation, new AddUserToLocation(
|
||||
playerId,
|
||||
users.getAvatarById(playerId, this.players.get(playerId))
|
||||
));
|
||||
}
|
||||
this.players.keySet().forEach(pid -> {
|
||||
Player p = this.players.get(pid);
|
||||
if( p.getLocationId() != locationId ) return;
|
||||
this.call(playerId, CommandType.AddUserToLocation, new AddUserToLocation(
|
||||
pid,
|
||||
users.getAvatarById(pid, this.players.get(pid))
|
||||
));
|
||||
this.call(playerId, CommandType.SetUserAvatarState, new SetPlayerState(
|
||||
pid,
|
||||
this.players.get(pid).getState()
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
private void sendInPlayersLocation(long playerId, CommandType type, Object obj) {
|
||||
this.sendInLocation(players.get(playerId).getLocationId(), type, obj);
|
||||
}
|
||||
|
||||
private void sendInLocation(int locationId, CommandType type, Object obj) {
|
||||
players.keySet().forEach(k -> {
|
||||
if( locationId != players.get(k).getLocationId() ) return;
|
||||
this.call(k, type, obj);
|
||||
});
|
||||
}
|
||||
|
||||
private void sendResult(long playerId, double tid, Object obj) {
|
||||
this.sendMessage(playerId, new CallMessage("_result", tid, null, obj));
|
||||
}
|
||||
|
||||
private void call(long playerId, CommandType function, Object obj) {
|
||||
this.sendMessage(playerId, new CallMessage(function.getValue(), 0d, null, obj));
|
||||
}
|
||||
|
||||
private void sendMessage(long playerId, Object obj) {
|
||||
try {
|
||||
this.players.get(playerId)
|
||||
.getConnection()
|
||||
.write_packet(AMFSerializer.serialize(obj));
|
||||
} catch (IOException e) {
|
||||
log.error("Unable to send message: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void onDisconnect(long playerId) {
|
||||
log.warn("GameServer.onDisconnect() close: {}", playerId);
|
||||
if( !this.players.containsKey(playerId) ) return;
|
||||
this.deleteSelf(playerId, this.players.get(playerId).getLocationId());
|
||||
this.players.remove(playerId);
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.alterdekim.game.component;
|
||||
|
||||
import com.alterdekim.game.component.rtmp.ConnectedProcessor;
|
||||
import com.alterdekim.game.component.rtmp.ConnectionProcessor;
|
||||
import com.alterdekim.game.component.rtmp.ConnectionState;
|
||||
import com.alterdekim.game.component.rtmp.HandshakeProcessor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
public class RTMPListener extends Thread {
|
||||
|
||||
private Socket sock;
|
||||
|
||||
private RTMPServer parent;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
private Integer uid;
|
||||
private InputStream in;
|
||||
private OutputStream out;
|
||||
|
||||
private ConnectionState connectionState;
|
||||
|
||||
private final Map<ConnectionState, ConnectionProcessor> connectionProcessors = new HashMap<>();
|
||||
|
||||
public RTMPListener(Socket sock, RTMPServer parent, Integer uid, GameServer gameServer) {
|
||||
try {
|
||||
this.uid = uid;
|
||||
this.parent = parent;
|
||||
this.sock = sock;
|
||||
this.in = sock.getInputStream();
|
||||
this.out = sock.getOutputStream();
|
||||
this.connectionState = ConnectionState.HANDSHAKE;
|
||||
this.connectionProcessors.put(ConnectionState.HANDSHAKE, new HandshakeProcessor(this.in, this.out, this.sock));
|
||||
this.connectionProcessors.put(ConnectionState.CONNECTED, new ConnectedProcessor(this.in, this.out, this.sock, gameServer));
|
||||
} catch( Exception e ) {
|
||||
log.error("RTMPListener error", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
while(!sock.isClosed()) {
|
||||
this.connectionState = this.connectionProcessors.get(this.connectionState).process();
|
||||
}
|
||||
this.parent.close(this.getUid());
|
||||
} catch( Exception e ) {
|
||||
log.error("RTMPListener.run() error", e);
|
||||
} finally {
|
||||
try {
|
||||
sock.close();
|
||||
} catch (Exception e) {
|
||||
log.error("RTMPListener.run() error", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
60
src/main/java/com/alterdekim/game/component/RTMPServer.java
Normal file
60
src/main/java/com/alterdekim/game/component/RTMPServer.java
Normal file
@ -0,0 +1,60 @@
|
||||
package com.alterdekim.game.component;
|
||||
|
||||
import com.alterdekim.game.config.ServerConfig;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.ServerSocket;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class RTMPServer {
|
||||
|
||||
@Autowired
|
||||
private ServerConfig config;
|
||||
|
||||
private final ConcurrentHashMap<Integer, RTMPListener> clients;
|
||||
private ServerSocket serverSocket;
|
||||
|
||||
@Autowired
|
||||
private GameServer gameServer;
|
||||
|
||||
|
||||
public RTMPServer() {
|
||||
this.clients = new ConcurrentHashMap<>();
|
||||
}
|
||||
|
||||
public void close( Integer id ) {
|
||||
clients.remove(id);
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay = 5000)
|
||||
public void start() {
|
||||
try {
|
||||
this.serverSocket = new ServerSocket(config.getGameServerPort());
|
||||
log.info("RTMPServer.start() started");
|
||||
while(true) {
|
||||
Integer guid = (int) (Math.random() * 10000);
|
||||
RTMPListener listener = new RTMPListener(serverSocket.accept(), this, guid, gameServer);
|
||||
log.info("RTMPServer.start() got client");
|
||||
this.clients.put(guid, listener);
|
||||
listener.start();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error("RTMPServer.start() error", e);
|
||||
} finally {
|
||||
try {
|
||||
serverSocket.close();
|
||||
} catch (IOException e) {
|
||||
log.error("RTMPServer.server.close() error", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
346
src/main/java/com/alterdekim/game/component/StartUpListener.java
Normal file
346
src/main/java/com/alterdekim/game/component/StartUpListener.java
Normal file
@ -0,0 +1,346 @@
|
||||
package com.alterdekim.game.component;
|
||||
|
||||
import com.alterdekim.flash.decompiler.FlashDecompiler;
|
||||
import com.alterdekim.flash.decompiler.ShockwaveFile;
|
||||
import com.alterdekim.flash.decompiler.compiler.FlashCompiler;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashMapper;
|
||||
import com.alterdekim.flash.decompiler.mapper.OutputObject;
|
||||
import com.alterdekim.flash.decompiler.tag.DoAction;
|
||||
import com.alterdekim.flash.decompiler.tag.TagType;
|
||||
import com.alterdekim.flash.decompiler.translator.Flash2Java;
|
||||
import com.alterdekim.flash.decompiler.translator.Java2Flash;
|
||||
import com.alterdekim.game.component.game.BodyPartType;
|
||||
import com.alterdekim.game.config.ServerConfig;
|
||||
import com.alterdekim.game.entity.*;
|
||||
import com.alterdekim.game.repository.BodyPartRepository;
|
||||
import com.alterdekim.game.repository.SmileRepository;
|
||||
import com.alterdekim.game.service.*;
|
||||
import com.alterdekim.game.storage.StorageProperties;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.util.*;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class StartUpListener {
|
||||
|
||||
private static final String ADMIN_USERNAME = "admin";
|
||||
|
||||
@Autowired
|
||||
private ServerConfig config;
|
||||
|
||||
@Autowired
|
||||
private StorageProperties storageProperties;
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Autowired
|
||||
private MRTService mrtService;
|
||||
|
||||
@Autowired
|
||||
private MRService mrService;
|
||||
|
||||
@Autowired
|
||||
private TRService trService;
|
||||
|
||||
@Autowired
|
||||
private ROService roService;
|
||||
|
||||
@Autowired
|
||||
private GoodsService goodsService;
|
||||
|
||||
@Autowired
|
||||
private GoodTagService goodTagService;
|
||||
|
||||
@Autowired
|
||||
private CatalogService catalogService;
|
||||
|
||||
@Autowired
|
||||
private GoodMagicService goodMagicService;
|
||||
|
||||
@Autowired
|
||||
private GoodSmileService goodSmileService;
|
||||
|
||||
@Autowired
|
||||
private GCDService gcdService;
|
||||
|
||||
@Autowired
|
||||
private MAService maService;
|
||||
|
||||
@Autowired
|
||||
private AchievementService achievementService;
|
||||
|
||||
@Autowired
|
||||
private BackgroundService backgroundService;
|
||||
|
||||
@Autowired
|
||||
private LibraryService libraryService;
|
||||
|
||||
@Autowired
|
||||
private SportInventoryService sportInventoryService;
|
||||
|
||||
@Autowired
|
||||
private VisaService visaService;
|
||||
|
||||
@Autowired
|
||||
private MissionService missionService;
|
||||
|
||||
@Autowired
|
||||
private GAAccountService gaAccountService;
|
||||
|
||||
@Autowired
|
||||
private PriceExchangeService priceExchangeService;
|
||||
|
||||
@Autowired
|
||||
private PriceLicenseService priceLicenseService;
|
||||
|
||||
@Autowired
|
||||
private PhoneIconService phoneIconService;
|
||||
|
||||
@Autowired
|
||||
private GameIconService gameIconService;
|
||||
|
||||
@Autowired
|
||||
private IncompatibleService incompatibleService;
|
||||
|
||||
@Autowired
|
||||
private LevelExperienceService levelExperienceService;
|
||||
|
||||
@Autowired
|
||||
private SmileService smileService;
|
||||
|
||||
@Autowired
|
||||
private AvatarInventoryService avatarInventoryService;
|
||||
|
||||
@Autowired
|
||||
private LocationService locationService;
|
||||
|
||||
@Autowired
|
||||
private PreloaderService preloaderService;
|
||||
|
||||
@Autowired
|
||||
private PromotionService promotionService;
|
||||
|
||||
@Autowired
|
||||
private PromotionBannerService promotionBannerService;
|
||||
|
||||
@EventListener
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
|
||||
// todo: compile other swf's
|
||||
if( userService.findByUsername(ADMIN_USERNAME) != null ) {
|
||||
Map<String, Object> root = new HashMap<>();
|
||||
Map<String, Object> mr = new HashMap<>();
|
||||
mr.put("MR", FlashMapper.objToMap(mrService.getAll()));
|
||||
mr.put("RO", FlashMapper.objToMap(roService.getAll()));
|
||||
mr.put("TR", FlashMapper.objToMap(trService.getAll()));
|
||||
mr.put("MRT", FlashMapper.simpleToMap(mrtService.getAll()));
|
||||
root.put("resources", mr);
|
||||
|
||||
try {
|
||||
Files.write(Path.of("cache/resources.swf"), new FlashCompiler(new Java2Flash().convert(root)).compile(), StandardOpenOption.CREATE);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( userService.findByUsername(ADMIN_USERNAME) != null ) return;
|
||||
String pwd = UUID.randomUUID().toString();
|
||||
log.info("Your admin account password is: {}\nChange it later.", pwd);
|
||||
userService.saveUser(ADMIN_USERNAME, pwd);
|
||||
|
||||
log.info("Moving pre-compiled data to our database.");
|
||||
try {
|
||||
processResources(storageProperties.getLocation() + File.separator + config.getDefaultResourcesPath());
|
||||
processBase(storageProperties.getLocation() + File.separator + config.getDefaultBasePath());
|
||||
// todo: implements miniquests
|
||||
String miniquests = storageProperties.getLocation() + File.separator + config.getDefaultMiniquestsPath();
|
||||
processCatalogs(storageProperties.getLocation() + File.separator + config.getDefaultCatalogsPath());
|
||||
} catch (IOException e) {
|
||||
log.error("Unable to move pre-compiled data to the server's database: {}", e.getMessage());
|
||||
}
|
||||
log.info("Pushing default data blobs to the database");
|
||||
pushPreloaders();
|
||||
pushPromotions();
|
||||
pushPromotionBanners();
|
||||
|
||||
pushBodyParts();
|
||||
pushLocations();
|
||||
log.info("Initialization complete");
|
||||
}
|
||||
|
||||
private void pushPromotionBanners() {
|
||||
promotionBannerService.savePromotionBanner(new PromotionBanner(9841, true));
|
||||
promotionBannerService.savePromotionBanner(new PromotionBanner(9955, true));
|
||||
promotionBannerService.savePromotionBanner(new PromotionBanner(12512, true));
|
||||
}
|
||||
|
||||
private void pushPromotions() {
|
||||
promotionService.savePromotion(new Promotion(5778, "1", true));
|
||||
promotionService.savePromotion(new Promotion(5891, "1", true));
|
||||
promotionService.savePromotion(new Promotion(9818, "1", true));
|
||||
}
|
||||
|
||||
private void pushPreloaders() {
|
||||
preloaderService.savePreloader(new Preloader(6857, 2000, true));
|
||||
preloaderService.savePreloader(new Preloader(11774, 2000, true));
|
||||
preloaderService.savePreloader(new Preloader(11994, 2000, true));
|
||||
}
|
||||
|
||||
private void pushLocations() {
|
||||
locationService.addLocation(new Location(47l, 3849l, 400.0d, 250.0d, "Площадь у больнички", true, true));
|
||||
}
|
||||
|
||||
private void pushBodyParts() {
|
||||
List<BodyPart> l = new ArrayList<>();
|
||||
|
||||
l.add(new BodyPart(56L, 56, true, BodyPartType.Body));
|
||||
l.add(new BodyPart(60L, 60, true, BodyPartType.Body));
|
||||
l.add(new BodyPart(64L, 64, true, BodyPartType.Body));
|
||||
l.add(new BodyPart(69L, 69, true, BodyPartType.Body));
|
||||
l.add(new BodyPart(73L, 73, true, BodyPartType.Body));
|
||||
l.add(new BodyPart(77L, 77, true, BodyPartType.Body));
|
||||
l.add(new BodyPart(83L, 83, true, BodyPartType.Body));
|
||||
l.add(new BodyPart(89L, 89, true, BodyPartType.Body));
|
||||
|
||||
l.add(new BodyPart(55L, 55, true, BodyPartType.Legs));
|
||||
l.add(new BodyPart(62L, 62, true, BodyPartType.Legs));
|
||||
l.add(new BodyPart(66L, 66, true, BodyPartType.Legs));
|
||||
l.add(new BodyPart(71L, 71, true, BodyPartType.Legs));
|
||||
l.add(new BodyPart(75L, 75, true, BodyPartType.Legs));
|
||||
l.add(new BodyPart(80L, 80, true, BodyPartType.Legs));
|
||||
l.add(new BodyPart(86L, 86, true, BodyPartType.Legs));
|
||||
l.add(new BodyPart(92L, 92, true, BodyPartType.Legs));
|
||||
|
||||
l.add(new BodyPart(78L, 78, true, BodyPartType.Ears));
|
||||
l.add(new BodyPart(84L, 84, true, BodyPartType.Ears));
|
||||
l.add(new BodyPart(90L, 90, true, BodyPartType.Ears));
|
||||
l.add(new BodyPart(95L, 95, true, BodyPartType.Ears));
|
||||
l.add(new BodyPart(96L, 96, true, BodyPartType.Ears));
|
||||
l.add(new BodyPart(97L, 97, true, BodyPartType.Ears));
|
||||
|
||||
l.add(new BodyPart(59L, 59, false, BodyPartType.Eyes));
|
||||
l.add(new BodyPart(61L, 61, false, BodyPartType.Eyes));
|
||||
l.add(new BodyPart(65L, 65, false, BodyPartType.Eyes));
|
||||
l.add(new BodyPart(70L, 70, false, BodyPartType.Eyes));
|
||||
l.add(new BodyPart(74L, 74, false, BodyPartType.Eyes));
|
||||
l.add(new BodyPart(79L, 79, false, BodyPartType.Eyes));
|
||||
l.add(new BodyPart(85L, 85, false, BodyPartType.Eyes));
|
||||
l.add(new BodyPart(91L, 91, false, BodyPartType.Eyes));
|
||||
|
||||
l.add(new BodyPart(58L, 58, false, BodyPartType.Nose));
|
||||
l.add(new BodyPart(68L, 68, false, BodyPartType.Nose));
|
||||
l.add(new BodyPart(82L, 82, false, BodyPartType.Nose));
|
||||
l.add(new BodyPart(88L, 88, false, BodyPartType.Nose));
|
||||
l.add(new BodyPart(94L, 94, false, BodyPartType.Nose));
|
||||
|
||||
l.add(new BodyPart(57L, 57, false, BodyPartType.Mouth));
|
||||
l.add(new BodyPart(67L, 67, false, BodyPartType.Mouth));
|
||||
l.add(new BodyPart(81L, 81, false, BodyPartType.Mouth));
|
||||
l.add(new BodyPart(87L, 87, false, BodyPartType.Mouth));
|
||||
l.add(new BodyPart(93L, 93, false, BodyPartType.Mouth));
|
||||
|
||||
l.add(new BodyPart(63L, 63, false, BodyPartType.Beak));
|
||||
l.add(new BodyPart(72L, 72, false, BodyPartType.Beak));
|
||||
l.add(new BodyPart(76L, 76, false, BodyPartType.Beak));
|
||||
|
||||
l.add(new BodyPart(99L, 99, false, BodyPartType.Horn));
|
||||
l.add(new BodyPart(100L, 100, false, BodyPartType.Horn));
|
||||
l.add(new BodyPart(101L, 101, false, BodyPartType.Horn));
|
||||
l.add(new BodyPart(102L, 102, false, BodyPartType.Horn));
|
||||
l.add(new BodyPart(103L, 103, false, BodyPartType.Horn));
|
||||
|
||||
l.add(new BodyPart(457L, 457, false, BodyPartType.Caps));
|
||||
l.add(new BodyPart(458L, 458, false, BodyPartType.Caps));
|
||||
l.add(new BodyPart(459L, 459, false, BodyPartType.Caps));
|
||||
l.add(new BodyPart(460L, 460, false, BodyPartType.Caps));
|
||||
l.add(new BodyPart(461L, 461, false, BodyPartType.Caps));
|
||||
l.add(new BodyPart(462L, 462, false, BodyPartType.Caps));
|
||||
l.add(new BodyPart(463L, 463, false, BodyPartType.Caps));
|
||||
l.add(new BodyPart(464L, 464, false, BodyPartType.Caps));
|
||||
|
||||
l.forEach(i -> avatarInventoryService.saveBodyPart(i));
|
||||
}
|
||||
|
||||
private Map<String, Object> decompile(String path) throws IOException {
|
||||
FlashDecompiler decompiler = new FlashDecompiler();
|
||||
ShockwaveFile file = decompiler.loadFromFile(new File(path));
|
||||
DoAction da = (DoAction)file.getTags().stream().filter((p) -> p.getType() == TagType.DoAction).findFirst().get();
|
||||
return new Flash2Java(da).convert();
|
||||
}
|
||||
|
||||
private void processResources(String swf) throws IOException {
|
||||
log.info("Processing resources");
|
||||
|
||||
Map<String, Object> o = decompile(swf);
|
||||
|
||||
FlashMapper.mapToObj(
|
||||
o,
|
||||
List.of(
|
||||
new OutputObject(MediaResourcePath.class, true, mrtService),
|
||||
new OutputObject(TextResource.class, false, trService),
|
||||
new OutputObject(MediaResource.class, false, mrService),
|
||||
new OutputObject(ResourceObject.class, false, roService)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
private void processCatalogs(String swf) throws IOException {
|
||||
log.info("Processing catalogs");
|
||||
Map<String, Object> o = decompile(swf);
|
||||
|
||||
FlashMapper.mapToObj(
|
||||
o,
|
||||
List.of(
|
||||
new OutputObject(GoodTag.class, true, goodTagService),
|
||||
new OutputObject(Good.class, false, goodsService),
|
||||
new OutputObject(Catalog.class, false, catalogService),
|
||||
new OutputObject(GoodMagic.class, false, goodMagicService),
|
||||
new OutputObject(GoodSmile.class, false, goodSmileService),
|
||||
new OutputObject(GoodClubDancefloor.class, false, gcdService)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// todo: implement other stuff from base.swf
|
||||
private void processBase(String swf) throws IOException {
|
||||
log.info("Processing base");
|
||||
|
||||
Map<String, Object> o = decompile(swf);
|
||||
|
||||
FlashMapper.mapToObj(
|
||||
o,
|
||||
List.of(
|
||||
new OutputObject(MagicAbility.class, false, maService),
|
||||
new OutputObject(Achievement.class, false, achievementService),
|
||||
new OutputObject(Background.class, true, backgroundService),
|
||||
new OutputObject(Library.class, false, libraryService),
|
||||
new OutputObject(SportInventory.class, true, sportInventoryService),
|
||||
new OutputObject(Visa.class, false, visaService),
|
||||
new OutputObject(CatalogObject.class, false, catalogService),
|
||||
new OutputObject(Mission.class, false, missionService),
|
||||
new OutputObject(GAAccount.class, true, gaAccountService),
|
||||
new OutputObject(PriceExchange.class, false, priceExchangeService),
|
||||
new OutputObject(PriceLicense.class, false, priceLicenseService),
|
||||
new OutputObject(PhoneIcon.class, true, phoneIconService),
|
||||
new OutputObject(GameIcon.class, true, gameIconService),
|
||||
new OutputObject(Incompatible.class, false, incompatibleService),
|
||||
new OutputObject(LevelExperience.class, true, levelExperienceService),
|
||||
new OutputObject(Smile.class, false, smileService)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
@AllArgsConstructor
|
||||
public class AddUserToLocation {
|
||||
private Long playerId;
|
||||
private PlayerAvatar avatar;
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import com.alterdekim.game.xml.NumericBooleanSerializer;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public class AvatarInventoryItem {
|
||||
@JacksonXmlProperty(localName = "ID", isAttribute = true)
|
||||
private Long id;
|
||||
|
||||
@JacksonXmlProperty(localName = "TextResourceID", isAttribute = true)
|
||||
private Integer textResourceID;
|
||||
|
||||
@JacksonXmlProperty(localName = "BodyPartId", isAttribute = true)
|
||||
private Integer bodyPartId;
|
||||
|
||||
@JacksonXmlProperty(localName = "MediaResourceID", isAttribute = true)
|
||||
private Integer mediaResourceID;
|
||||
|
||||
@JacksonXmlProperty(localName = "IsUsed", isAttribute = true)
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean isUsed;
|
||||
|
||||
@JacksonXmlProperty(localName = "IsColorable", isAttribute = true)
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean isColorable;
|
||||
|
||||
@JacksonXmlProperty(localName = "Color", isAttribute = true)
|
||||
private Integer color;
|
||||
|
||||
@JacksonXmlProperty(localName = "IsLimited", isAttribute = true)
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean isLimited;
|
||||
|
||||
@JacksonXmlProperty(localName = "Date", isAttribute = true)
|
||||
private LocalDateTime date;
|
||||
|
||||
@JacksonXmlProperty(localName = "Pollution", isAttribute = true)
|
||||
private Integer pollution;
|
||||
|
||||
@JacksonXmlProperty(localName = "IsBodyPart", isAttribute = true)
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean isBodyPart;
|
||||
|
||||
@JacksonXmlProperty(localName = "GoodID", isAttribute = true)
|
||||
public Long getGoodId() {
|
||||
return this.id;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
public enum AvatarInventoryType {
|
||||
Clothes,
|
||||
Magic,
|
||||
Smile,
|
||||
House,
|
||||
HouseFurniture,
|
||||
Club,
|
||||
ClubFurniture,
|
||||
BodyParts
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import com.alterdekim.game.message.amf.AMFKey;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class BodyAvatarItem {
|
||||
@AMFKey(name = "BodyPartTypeId")
|
||||
private Integer bodyPartTypeId;
|
||||
|
||||
@AMFKey(name = "Id")
|
||||
private Long id;
|
||||
|
||||
@AMFKey(name = "Color")
|
||||
private Integer color;
|
||||
|
||||
@AMFKey(name = "IsBodyPart")
|
||||
private Boolean isBodyPart;
|
||||
|
||||
@AMFKey(name = "BodyPartId")
|
||||
private Integer bodyPartId;
|
||||
|
||||
@AMFKey(name = "GoodID")
|
||||
private Long goodId;
|
||||
|
||||
@AMFKey(name = "MediaResourceID")
|
||||
private Integer mediaResourceId;
|
||||
|
||||
@AMFKey(name = "LayerID")
|
||||
private Integer layerId;
|
||||
|
||||
@AMFKey(name = "GoodTypeID")
|
||||
private Integer goodTypeId;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BodyPartType {
|
||||
Body(3, 202, true, 20),
|
||||
Legs(2, 201, true, 10),
|
||||
Ears(8, 206, false, 50),
|
||||
Eyes(7, 205, false, 30),
|
||||
Nose(6, 204, false, 40),
|
||||
Mouth(5, 203, false, 26),
|
||||
Beak(11, 208, false, 41),
|
||||
Horn(12, 209, false, 55),
|
||||
Caps(4, 207, false, 45);
|
||||
|
||||
private final int value;
|
||||
private final long mediaResourceId;
|
||||
private final boolean isShape;
|
||||
private final int layerId;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
public enum CatalogType {
|
||||
|
||||
Collection("collection"),
|
||||
Filter("filter"),
|
||||
Shop("shop");
|
||||
|
||||
public final String value;
|
||||
|
||||
CatalogType(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static CatalogType fromType(String c) {
|
||||
for (CatalogType type : values()) {
|
||||
if (type.value.equals(c)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return CatalogType.Shop;
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class ChatMessage {
|
||||
private Long playerId;
|
||||
private String text;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ClubAccessType {
|
||||
OPEN(1),
|
||||
CLOSED(0),
|
||||
FRIENDS_ONLY(2);
|
||||
|
||||
private final Integer value;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CommandType {
|
||||
UserCommand("$"),
|
||||
SetLocation("_LS"),
|
||||
RemoveUserFromLocation("_UL"),
|
||||
AddUserToLocation("_UE"),
|
||||
SetUserAvatarState("_S"),
|
||||
SetUserAvatarPosition("_P"),
|
||||
ChatMessage("_C"),
|
||||
Shoot("_NUS"),
|
||||
Unknown("");
|
||||
|
||||
private final String value;
|
||||
public static CommandType fromString(String s) {
|
||||
for( CommandType t : values() ) {
|
||||
if( t.getValue().equals(s) ) return t;
|
||||
}
|
||||
return CommandType.Unknown;
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum GoodClothType {
|
||||
Clothes(1, 212, 36),
|
||||
Caps(4, 211, 45),
|
||||
Glasses(14, 210, 31),
|
||||
Boots(32, 213, 11),
|
||||
Bangles(36, 214, 56),
|
||||
Suits(40, 429, 27);
|
||||
|
||||
private final int val;
|
||||
private final long tabMediaResourceId;
|
||||
private final int layerId;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import com.alterdekim.game.xml.NumericBooleanSerializer;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class InitMagicAbility {
|
||||
@JacksonXmlProperty(localName = "Id", isAttribute = true)
|
||||
private Integer id;
|
||||
@JacksonXmlProperty(localName = "ExpirationDate", isAttribute = true)
|
||||
private String expirationDate;
|
||||
@JacksonXmlProperty(localName = "IsLimited", isAttribute = true)
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean isLimited;
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import com.alterdekim.game.xml.NumericBooleanSerializer;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@JacksonXmlRootElement(localName = "location")
|
||||
public class LocationObject {
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "ID")
|
||||
private Long id;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsHome")
|
||||
@JsonSerialize(using = NumericBooleanSerializer.class)
|
||||
private Boolean isHome;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsClub")
|
||||
@JsonSerialize(using = NumericBooleanSerializer.class)
|
||||
private Boolean isClub;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsLocked")
|
||||
@JsonSerialize(using = NumericBooleanSerializer.class)
|
||||
private Boolean isLocked;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsVisaAccessPermitted")
|
||||
@JsonSerialize(using = NumericBooleanSerializer.class)
|
||||
private Boolean isVisaAccessPermitted;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "MediaResourceID")
|
||||
private Long mediaResourceId;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Double x;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Double y;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Name")
|
||||
private String name;
|
||||
|
||||
//todo: add location objects
|
||||
@JacksonXmlProperty(isAttribute = false, localName = "object")
|
||||
@JacksonXmlElementWrapper(useWrapping = false, localName = "object")
|
||||
private List<LocationObjectInstance> objects;
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@NoArgsConstructor
|
||||
public class LocationObjectInstance {
|
||||
}
|
18
src/main/java/com/alterdekim/game/component/game/Player.java
Normal file
18
src/main/java/com/alterdekim/game/component/game/Player.java
Normal file
@ -0,0 +1,18 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import com.alterdekim.game.component.rtmp.ConnectedProcessor;
|
||||
import lombok.*;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@RequiredArgsConstructor
|
||||
public class Player {
|
||||
private final ConnectedProcessor connection;
|
||||
private final String username;
|
||||
private double x;
|
||||
private double y;
|
||||
private int locationId;
|
||||
private double state;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import com.alterdekim.game.message.amf.AMFKey;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class PlayerAvatar {
|
||||
@AMFKey(name = "RoleFlags")
|
||||
private String roleFlags;
|
||||
|
||||
@AMFKey(name = "User")
|
||||
private UserAvatar user;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum PlayerProperties {
|
||||
LocationServerName(PlayerPropertyType.String),
|
||||
RoleFlags(PlayerPropertyType.Enum),
|
||||
InstructorLevel(PlayerPropertyType.Integer),
|
||||
MagicLevel(PlayerPropertyType.Integer),
|
||||
RaceLevel(PlayerPropertyType.Integer),
|
||||
UsualTickets(PlayerPropertyType.Integer),
|
||||
MagicTickets(PlayerPropertyType.Integer),
|
||||
Experience(PlayerPropertyType.Integer),
|
||||
Level(PlayerPropertyType.Integer),
|
||||
//PositiveEnergy(PlayerPropertyType.Integer),
|
||||
VisaId(PlayerPropertyType.Integer),
|
||||
CurrentUseCount(PlayerPropertyType.Integer),
|
||||
LastNewspaperId(PlayerPropertyType.Integer),
|
||||
IsClubLocked(PlayerPropertyType.Boolean),
|
||||
ClubAccessType(PlayerPropertyType.Enum),
|
||||
IsMinorSecretAgent(PlayerPropertyType.Boolean),
|
||||
HasSnFriends(PlayerPropertyType.Boolean),
|
||||
IsHomeLocked(PlayerPropertyType.Boolean),
|
||||
IsLimited(PlayerPropertyType.Boolean),
|
||||
CampId(PlayerPropertyType.Integer),
|
||||
NiftTotalCount(PlayerPropertyType.Integer),
|
||||
DateRegistered(PlayerPropertyType.Date),
|
||||
MinsLeft(PlayerPropertyType.Integer),
|
||||
TimesUsed(PlayerPropertyType.Integer),
|
||||
PhoneCardBalance(PlayerPropertyType.Integer),
|
||||
WeaponsCount(PlayerPropertyType.Integer),
|
||||
OxygenUnits(PlayerPropertyType.Integer);
|
||||
|
||||
private final PlayerPropertyType valueType;
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
public enum PlayerPropertyType {
|
||||
String,
|
||||
Integer,
|
||||
Enum,
|
||||
Date,
|
||||
Boolean
|
||||
}
|
11
src/main/java/com/alterdekim/game/component/game/Point.java
Normal file
11
src/main/java/com/alterdekim/game/component/game/Point.java
Normal file
@ -0,0 +1,11 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class Point {
|
||||
private Double x;
|
||||
private Double y;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum RoleFlags {
|
||||
NONE(0),
|
||||
MEMBER(2),
|
||||
SA(8),
|
||||
MODERATOR(131072),
|
||||
ADMINISTRATOR(262144),
|
||||
CHIEF(524288),
|
||||
HIDDEN(1048576);
|
||||
|
||||
private final Integer value;
|
||||
|
||||
public static RoleFlags fromId(int id) {
|
||||
for (RoleFlags type : values()) {
|
||||
if (type.value == id) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return RoleFlags.NONE;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class SetPlayerPosition {
|
||||
private Long userId;
|
||||
private Point point;
|
||||
private Long tweenerId;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class SetPlayerState {
|
||||
private Long playerId;
|
||||
private Double state;
|
||||
}
|
12
src/main/java/com/alterdekim/game/component/game/Shoot.java
Normal file
12
src/main/java/com/alterdekim/game/component/game/Shoot.java
Normal file
@ -0,0 +1,12 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class Shoot {
|
||||
private Long playerId;
|
||||
private Double x;
|
||||
private Double y;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public class UserAccount {
|
||||
@JacksonXmlProperty(localName = "PhoneCardBalance", isAttribute = true)
|
||||
private Integer phoneCardBalance;
|
||||
|
||||
@JacksonXmlProperty(localName = "WeaponsCount", isAttribute = true)
|
||||
private Integer weaponsCount;
|
||||
|
||||
@JacksonXmlProperty(localName = "OxigenUnits", isAttribute = true)
|
||||
private Integer oxygenUnits;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import com.alterdekim.game.message.amf.AMFKey;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserAvatar {
|
||||
@AMFKey(name = "Level")
|
||||
private Integer level;
|
||||
|
||||
@AMFKey(name = "Name")
|
||||
private String name;
|
||||
|
||||
private Double x;
|
||||
|
||||
private Double y;
|
||||
|
||||
@AMFKey(name = "State")
|
||||
private Double state;
|
||||
|
||||
@AMFKey(name = "Body")
|
||||
private Map<String, BodyAvatarItem> body;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum UserCommandType {
|
||||
GetUserInitData("_I"),
|
||||
UserFriendsGet("_UFG"),
|
||||
UserFriendsRequests("_UFR"),
|
||||
GetClubMap("_CM"),
|
||||
GetFriendPanelData("_SNFP"),
|
||||
UpdateUserData("_D"),
|
||||
GetUserLocation("_LG"),
|
||||
ChatMessage("_C"),
|
||||
Shoot("_NUS"),
|
||||
GetUserInfo("_UI"),
|
||||
Unknown("");
|
||||
|
||||
private final String value;
|
||||
|
||||
public static UserCommandType fromString(String s) {
|
||||
for( UserCommandType t : values() ) {
|
||||
if( t.getValue().equals(s) ) return t;
|
||||
}
|
||||
return UserCommandType.Unknown;
|
||||
}
|
||||
}
|
120
src/main/java/com/alterdekim/game/component/game/UserInfo.java
Normal file
120
src/main/java/com/alterdekim/game/component/game/UserInfo.java
Normal file
@ -0,0 +1,120 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import com.alterdekim.game.xml.ClubAccessTypeSerializer;
|
||||
import com.alterdekim.game.xml.LocalDateTimeSerializer;
|
||||
import com.alterdekim.game.xml.NumericBooleanSerializer;
|
||||
import com.alterdekim.game.xml.RoleFlagsSerializer;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
public class UserInfo {
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "UserId")
|
||||
private Long userId;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "RoleFlags")
|
||||
@JsonSerialize(using = RoleFlagsSerializer.class)
|
||||
private RoleFlags roleFlags;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsLimited")
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean isLimited;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsOnline")
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean isOnline;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsMinorSecretAgent")
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean isMinorSecretAgent;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsHomeLocked")
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean isHomeLocked;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsClubLocked")
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean isClubLocked;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsClubPresent")
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean isClubPresent;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "ClubAccessType")
|
||||
@JsonSerialize(using = ClubAccessTypeSerializer.class)
|
||||
private ClubAccessType clubAccessType;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsFriend")
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean isFriend;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Experience")
|
||||
private Integer experience;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Level")
|
||||
private Integer level;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "MagicLevel")
|
||||
private Integer magicLevel;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "RaceLevel")
|
||||
private Integer raceLevel;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "PhoneId")
|
||||
private Integer phoneId;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "BackgroundId")
|
||||
private Integer backgroundId;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "CampId")
|
||||
private Integer campId;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "NiftTotalCount")
|
||||
private Integer niftTotalCount;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "LocationServerName")
|
||||
private String locationServerName;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "DateRegistered")
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
private LocalDateTime dateRegistered;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "InstructorLevel")
|
||||
private Integer instructorLevel;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "UsualTickets")
|
||||
private Integer usualTickets;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "MagicTickets")
|
||||
private Integer magicTickets;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "VisaId")
|
||||
private Integer visaId;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "CurrentUseCount")
|
||||
private Integer currentUseCount;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "LastNewspaperId")
|
||||
private Integer lastNewspaperId;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "HasSnFriends")
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean hasSnFriends;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "MinsLeft")
|
||||
private Integer minsLeft;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "TimesUsed")
|
||||
private Integer timesUsed;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Name")
|
||||
private String name;
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@JsonRootName("response")
|
||||
public class UserInitInfo {
|
||||
@JacksonXmlProperty(localName = "account")
|
||||
private UserAccount userAccount;
|
||||
|
||||
@JacksonXmlProperty(localName = "user")
|
||||
private UserInfo userInfo;
|
||||
|
||||
@JacksonXmlProperty(localName = "user_phone")
|
||||
private UserPhone userPhone;
|
||||
|
||||
@JsonProperty(value = "user_magic_abilities")
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "user_magic_abilities")
|
||||
private List<InitMagicAbility> magicAbilities;
|
||||
|
||||
@JsonProperty(value = "avatar")
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "avatar")
|
||||
private List<AvatarInventoryItem> avatar;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.alterdekim.game.component.game;
|
||||
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public class UserPhone {
|
||||
@JacksonXmlProperty(localName = "BufferSize", isAttribute = true)
|
||||
private Integer bufferSize;
|
||||
|
||||
@JacksonXmlProperty(localName = "SkinMediaResourceID", isAttribute = true)
|
||||
private Long skinMediaResourceId;
|
||||
|
||||
@JacksonXmlProperty(localName = "PhoneId", isAttribute = true)
|
||||
private Integer phoneId;
|
||||
|
||||
@JacksonXmlProperty(localName = "Balance", isAttribute = true)
|
||||
private Integer balance;
|
||||
}
|
@ -0,0 +1,190 @@
|
||||
package com.alterdekim.game.component.rtmp;
|
||||
|
||||
import com.alterdekim.game.component.GameServer;
|
||||
import com.alterdekim.game.message.*;
|
||||
import com.alterdekim.game.message.amf.*;
|
||||
import com.alterdekim.game.message.serializer.BinaryMessageSerializer;
|
||||
import com.alterdekim.game.utils.StringUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.javatuples.Pair;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
public class ConnectedProcessor extends ConnectionProcessor {
|
||||
|
||||
private final Long startTimestamp;
|
||||
private ConnectedState state;
|
||||
private List<Byte> message;
|
||||
private Integer expectedMessageLength;
|
||||
private Integer lastStreamId;
|
||||
private byte[] previousHeader;
|
||||
private GameServer gameServer;
|
||||
private Long playerId;
|
||||
|
||||
public ConnectedProcessor(InputStream inputStream, OutputStream outputStream, Socket sock, GameServer gameServer) {
|
||||
super(inputStream, outputStream, sock);
|
||||
this.state = ConnectedState.WAIT_FOR_MESSAGE;
|
||||
this.message = new ArrayList<>();
|
||||
this.gameServer = gameServer;
|
||||
this.previousHeader = new byte[11];
|
||||
this.startTimestamp = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConnectionState getState() {
|
||||
return ConnectionState.CONNECTED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConnectionState process() throws IOException {
|
||||
int b = this.getInputStream().read();
|
||||
if (b == -1) {
|
||||
close(); return ConnectionState.CONNECTED;
|
||||
}
|
||||
if( this.state == ConnectedState.WAIT_FOR_MESSAGE && b != 0x03 && b != 0x43 && b != 0x83 && b != 0x02 && b != 0xC3 ) {
|
||||
log.info("process() WAIT_FOR_MESSAGE not 03,43,83");
|
||||
return ConnectionState.CONNECTED;
|
||||
}
|
||||
this.state = switch(state) {
|
||||
case WAIT_FOR_MESSAGE -> processWaitForMessage(parseChunkHeader(b));
|
||||
case LISTENS_FOR_MESSAGE -> processListensForMessage((byte) b);
|
||||
};
|
||||
return ConnectionState.CONNECTED;
|
||||
}
|
||||
|
||||
private ConnectedState processWaitForMessage(Pair<ChunkHeaderType, Integer> packetHeader) {
|
||||
try {
|
||||
byte[] header = switch (packetHeader.getValue0()) {
|
||||
case Full -> new byte[11];
|
||||
case WithoutStreamId -> new byte[7];
|
||||
case OnlyTimestamp -> new byte[3];
|
||||
default -> new byte[0];
|
||||
};
|
||||
if(this.getInputStream().read(header) == -1) return ConnectedState.WAIT_FOR_MESSAGE;
|
||||
if(header.length == 11) this.lastStreamId = BinaryMessageSerializer.deserializeInteger(Arrays.copyOfRange(header, 7, 11));
|
||||
this.message.clear();
|
||||
this.expectedMessageLength = BinaryMessageSerializer.deserializeInteger(
|
||||
Arrays.copyOfRange( header.length >= 7 ? header : this.previousHeader, 3, 6)
|
||||
);
|
||||
if( header.length >= 7 ) this.previousHeader = header;
|
||||
if( header.length == 11 && packetHeader.getValue1() == 2 ) {
|
||||
byte[] b = new byte[4];
|
||||
if( this.getInputStream().read(b) == -1 ) return ConnectedState.WAIT_FOR_MESSAGE;
|
||||
this.getOutputStream().write(new byte[] {0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, b[0], b[1], b[2], b[3]});
|
||||
this.getOutputStream().flush();
|
||||
return ConnectedState.WAIT_FOR_MESSAGE;
|
||||
}
|
||||
return ConnectedState.LISTENS_FOR_MESSAGE;
|
||||
} catch (IOException e) {
|
||||
log.error("ConnectedProcessor.processWaitForMessage()", e);
|
||||
}
|
||||
return ConnectedState.WAIT_FOR_MESSAGE;
|
||||
}
|
||||
|
||||
private ConnectedState processListensForMessage(byte b) {
|
||||
if(this.message.size() >= this.expectedMessageLength) {
|
||||
this.processMessage();
|
||||
return ConnectedState.WAIT_FOR_MESSAGE;
|
||||
}
|
||||
if( b == (byte) 0xC3 ) { this.expectedMessageLength--; return ConnectedState.LISTENS_FOR_MESSAGE; }
|
||||
this.message.add(b);
|
||||
if(this.message.size() >= this.expectedMessageLength) {
|
||||
this.processMessage();
|
||||
return ConnectedState.WAIT_FOR_MESSAGE;
|
||||
}
|
||||
return ConnectedState.LISTENS_FOR_MESSAGE;
|
||||
}
|
||||
|
||||
private void processMessage() {
|
||||
byte[] bytes = SerializerUtils.bytesToPrimitive(message);
|
||||
log.info("ConnectedProcessor.processMessage() messageString: {}", StringUtils.bytesToHex(bytes));
|
||||
try {
|
||||
List<AMFObject> mr = AMFDeserializer.deserialize(message);
|
||||
if( !mr.isEmpty() &&
|
||||
mr.get(0).getType() == AMFValueType.STRING &&
|
||||
mr.get(0).getValue().equals("connect") ) {
|
||||
this.playerId = Long.parseLong((String) mr.get(3).getValue());
|
||||
this.gameServer.onConnect(this.playerId, (String) mr.get(5).getValue(), this);
|
||||
this.getOutputStream().write( StringUtils.hexStringToByteArray("020000000000040500000000002625A0020000000000050600000000002625A00202000000000004010000000000001000030000000000F214000000000200075F726573756C74003FF0000000000000030006666D7356657202000E464D532F342C302C302C31313231000C6361706162696C697469657300406FE0000000000000046D6F6465003FF00000000000000000090300056C6576656C0200067374617475730004636F646502001D4E6574436F6E6E656374696F6E2E436F6E6E6563742E53756363657373000B6465736372697074696F6E020015436F6E6E656374696F6E207375636365656465642E000E6F626A656374456E636F64696E670000000000000000000004646174610800000000000776657273696F6E02000A342C302C302C31313231000009000009") );
|
||||
this.getOutputStream().flush();
|
||||
return;
|
||||
}
|
||||
this.gameServer.onMessage(this.playerId, mr);
|
||||
} catch (Exception e) {
|
||||
log.error("ConnectedProcessor.processMessage() error: {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
// returns chunk type and stream id
|
||||
private Pair<ChunkHeaderType, Integer> parseChunkHeader(int b) {
|
||||
return Pair.with(ChunkHeaderType.fromInt((b & 0xC0) >> 6), b & 0x3F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(List<Byte> bytes) throws IOException {
|
||||
List<Byte> l = new ArrayList<>(Arrays.asList((byte) 0x03, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x14, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00));
|
||||
l.addAll(bytes);
|
||||
super.write(l);
|
||||
}
|
||||
|
||||
public void write_packet(List<Byte> bytes) throws IOException {
|
||||
List<Byte> l = new ArrayList<>(Collections.singletonList((byte) 0x03));
|
||||
List<Byte> data = new ArrayList<>();
|
||||
int cnt = 0;
|
||||
for( int i = 0; i < bytes.size(); i++ ) {
|
||||
data.add(bytes.get(i));
|
||||
if( i >= 4095 && ((i+1) % 4096 == 0) && (i+1) < bytes.size() ) {
|
||||
data.add((byte) 0xC3);
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
l.addAll(int2bytes((int) ((System.currentTimeMillis() - this.startTimestamp) / 1000L), 3));
|
||||
l.addAll(int2bytes(data.size() - cnt, 3));
|
||||
l.add((byte) 0x14);
|
||||
l.addAll(int2bytes(this.lastStreamId, 4));
|
||||
l.addAll(data);
|
||||
super.write(l);
|
||||
}
|
||||
|
||||
private List<Byte> int2bytes(int u, int n) {
|
||||
List<Byte> b = new ArrayList<>();
|
||||
for( int i = n-1; i >= 0; i-- ) {
|
||||
b.add((byte) ((u >> i*8) & 0xFF));
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
this.gameServer.onDisconnect(this.playerId);
|
||||
super.close();
|
||||
}
|
||||
|
||||
@AllArgsConstructor
|
||||
private enum ChunkHeaderType {
|
||||
Full(0),
|
||||
WithoutStreamId(1),
|
||||
OnlyTimestamp(2),
|
||||
UsePrevious(3),
|
||||
Unknown(4);
|
||||
|
||||
private final int type;
|
||||
|
||||
private static ChunkHeaderType fromInt(int b) {
|
||||
for( ChunkHeaderType c : values() ) {
|
||||
if( c.type == b ) return c;
|
||||
}
|
||||
return Unknown;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package com.alterdekim.game.component.rtmp;
|
||||
|
||||
public enum ConnectedState {
|
||||
WAIT_FOR_MESSAGE,
|
||||
LISTENS_FOR_MESSAGE
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.alterdekim.game.component.rtmp;
|
||||
|
||||
import com.alterdekim.game.message.SerializerUtils;
|
||||
import com.alterdekim.game.utils.StringUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public abstract class ConnectionProcessor {
|
||||
private InputStream inputStream;
|
||||
private OutputStream outputStream;
|
||||
private Socket sock;
|
||||
|
||||
public abstract ConnectionState getState();
|
||||
public abstract ConnectionState process() throws IOException;
|
||||
|
||||
public void write(List<Byte> bytes) throws IOException {
|
||||
log.info("Packet sent: {}", StringUtils.bytesToHex(SerializerUtils.bytesToPrimitive(bytes)));
|
||||
this.outputStream.write(SerializerUtils.bytesToPrimitive(bytes));
|
||||
this.outputStream.flush();
|
||||
}
|
||||
|
||||
public void close() {
|
||||
log.info("ConnectionProcessor.close()");
|
||||
try {
|
||||
this.sock.close();
|
||||
} catch (IOException e) {
|
||||
log.error("ConnectionProcessor.close()", e);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package com.alterdekim.game.component.rtmp;
|
||||
|
||||
public enum ConnectionState {
|
||||
HANDSHAKE,
|
||||
CONNECTED
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.alterdekim.game.component.rtmp;
|
||||
|
||||
|
||||
import com.alterdekim.game.message.ByteMessage;
|
||||
import com.alterdekim.game.message.SerializerUtils;
|
||||
import com.alterdekim.game.message.serializer.BinaryMessageSerializer;
|
||||
import com.alterdekim.game.utils.ByteUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
@Slf4j
|
||||
public class HandshakeProcessor extends ConnectionProcessor {
|
||||
|
||||
private HandshakeState handshakeState;
|
||||
|
||||
public HandshakeProcessor(InputStream inputStream, OutputStream outputStream, Socket sock) {
|
||||
super(inputStream, outputStream, sock);
|
||||
this.handshakeState = HandshakeState.C0S0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConnectionState getState() {
|
||||
return ConnectionState.HANDSHAKE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConnectionState process() throws IOException {
|
||||
switch (handshakeState) {
|
||||
case C0S0:
|
||||
processFirstMessage();
|
||||
break;
|
||||
case C1S1:
|
||||
processSecondMessage();
|
||||
break;
|
||||
case C2S2:
|
||||
return processThirdMessage();
|
||||
}
|
||||
return getState();
|
||||
}
|
||||
|
||||
private void processFirstMessage() throws IOException {
|
||||
byte[] b = new byte[1];
|
||||
if( this.getInputStream().read(b) == -1 || b[0] != 0x03 ) {close(); return;}
|
||||
this.getOutputStream().write(b);
|
||||
this.handshakeState = HandshakeState.C1S1;
|
||||
}
|
||||
|
||||
private void processSecondMessage() throws IOException {
|
||||
byte[] b = new byte[1536];
|
||||
if( this.getInputStream().read(b) == -1 ) { close(); return; }
|
||||
this.getOutputStream().write(b);
|
||||
this.handshakeState = HandshakeState.C2S2;
|
||||
}
|
||||
|
||||
private ConnectionState processThirdMessage() throws IOException {
|
||||
byte[] b = new byte[1536];
|
||||
if( this.getInputStream().read(b) == -1 ) { close(); return ConnectionState.HANDSHAKE; }
|
||||
List<Byte> response = new ArrayList<>();
|
||||
IntStream.range(0, 1536).forEach(i -> response.add( (byte) ((Math.random() * 253) + 1) ) );
|
||||
write(response);
|
||||
return ConnectionState.CONNECTED;
|
||||
}
|
||||
|
||||
private enum HandshakeState {
|
||||
C0S0,
|
||||
C1S1,
|
||||
C2S2
|
||||
}
|
||||
}
|
15
src/main/java/com/alterdekim/game/config/ServerConfig.java
Normal file
15
src/main/java/com/alterdekim/game/config/ServerConfig.java
Normal file
@ -0,0 +1,15 @@
|
||||
package com.alterdekim.game.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Data
|
||||
@Configuration
|
||||
public class ServerConfig {
|
||||
@Value("${srv.rtmpPort}") private Integer gameServerPort;
|
||||
@Value("${srv.resPathSWF}") private String defaultResourcesPath;
|
||||
@Value("${srv.basePathSWF}") private String defaultBasePath;
|
||||
@Value("${srv.catPathSWF}") private String defaultCatalogsPath;
|
||||
@Value("${srv.mqPathSWF}") private String defaultMiniquestsPath;
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
package com.alterdekim.game.controller;
|
||||
|
||||
import com.alterdekim.game.controller.result.async.*;
|
||||
import com.alterdekim.game.entity.User;
|
||||
import com.alterdekim.game.security.AuthenticationUtil;
|
||||
import com.alterdekim.game.service.*;
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class AsyncController {
|
||||
|
||||
@Autowired
|
||||
private MiniquestService miniquestService;
|
||||
|
||||
@Autowired
|
||||
private PhoneMessageService phoneMessageService;
|
||||
|
||||
@Autowired
|
||||
private PostcardService postcardService;
|
||||
|
||||
@Autowired
|
||||
private PreloaderService preloaderService;
|
||||
|
||||
@Autowired
|
||||
private PromotionBannerService promotionBannerService;
|
||||
|
||||
@Autowired
|
||||
private PromotionService promotionService;
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@PostMapping("/async/Ping")
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> ping() {
|
||||
return ResponseEntity.ok("<response isPong=\"true\" />");
|
||||
}
|
||||
|
||||
@PostMapping("/async/ServerAction")
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> serverAction() {
|
||||
try {
|
||||
//User user = AuthenticationUtil.authProfile(userService).orElse(userService.findByUsername("jerk"));
|
||||
|
||||
User user = AuthenticationUtil.authProfile(userService).get();
|
||||
|
||||
XmlMapper xmlMapper = new XmlMapper();
|
||||
xmlMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE);
|
||||
xmlMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
|
||||
ServerActionResult serverActionResult = new ServerActionResult();
|
||||
serverActionResult.setSn_status(new SnStatus(false));
|
||||
serverActionResult.setUser_name(new UserName(user.getUsername()));
|
||||
serverActionResult.setFlags(new Flags(true, 13));
|
||||
serverActionResult.setRequests(new Grants(0));
|
||||
serverActionResult.setGrants(new Grants(0));
|
||||
List<ConfigItem> items = new ArrayList<>();
|
||||
items.add(new ConfigItem(1, ServerActionConfigType.IsPreloaderEnabled, "1", "bool")); // play with it
|
||||
items.add(new ConfigItem(2, ServerActionConfigType.SynchronizeAvatarRotation, "1", "bool"));
|
||||
items.add(new ConfigItem(3, ServerActionConfigType.InitialVolumeValue, "30", "number"));
|
||||
items.add(new ConfigItem(4, ServerActionConfigType.IsStartupHomeLocation, "0", "bool"));
|
||||
items.add(new ConfigItem(5, ServerActionConfigType.AccessRoleFlags, "0", "number"));
|
||||
items.add(new ConfigItem(6, ServerActionConfigType.IsInternational, "0", "bool")); // play with it
|
||||
items.add(new ConfigItem(7, ServerActionConfigType.TypeWeapon, "1", "number"));
|
||||
items.add(new ConfigItem(8, ServerActionConfigType.StatisticsSendInterval, "300", "number"));
|
||||
items.add(new ConfigItem(9, ServerActionConfigType.SwfVersion, "", "string"));
|
||||
items.add(new ConfigItem(10, ServerActionConfigType.LanguageId, "1", "number")); // play with it
|
||||
items.add(new ConfigItem(11, ServerActionConfigType.SnId, "1", "number"));
|
||||
items.add(new ConfigItem(12, ServerActionConfigType.AutoServerSelectionAllowed, "0", "bool"));
|
||||
List<ServerItem> s_items = new ArrayList<>();
|
||||
s_items.add(new ServerItem(1, 202, 5, "rtmp://localhost:8888/shararam", 0, 1, 5, 5.1));
|
||||
|
||||
serverActionResult.setPhone(new PhoneMessages(phoneMessageService.getAllPhoneMessages()));
|
||||
serverActionResult.setMiniquest(miniquestService.getAllMiniquests());
|
||||
serverActionResult.setPostcard(new PostcardMessages(postcardService.getAllPostcards()));
|
||||
serverActionResult.setPreloader(preloaderService.getAllPreloaders());
|
||||
serverActionResult.setPromotion(promotionService.getAllPromotions());
|
||||
serverActionResult.setPromotion_banner(promotionBannerService.getAllPromotionBanners());
|
||||
|
||||
|
||||
List<Tutorial> tutorials = new ArrayList<>();
|
||||
tutorials.add(new Tutorial(-1, 1));
|
||||
tutorials.add(new Tutorial(1, 1));
|
||||
tutorials.add(new Tutorial(2, 1));
|
||||
tutorials.add(new Tutorial(3, 1));
|
||||
tutorials.add(new Tutorial(4, 1));
|
||||
tutorials.add(new Tutorial(5, 1));
|
||||
serverActionResult.setTutorial(tutorials);
|
||||
|
||||
List<ServerActionCData> cdatas = new ArrayList<>();
|
||||
cdatas.add(new ServerActionConfig(items));
|
||||
cdatas.add(new ServerActionSystem(1, "cache/resources.swf")); // swf/cache/rus/resources[19].swf
|
||||
cdatas.add(new ServerActionUser(user.getId(), AuthenticationUtil.getToken(user), AuthenticationUtil.getToken(user), 2));
|
||||
cdatas.add(new ServerActionServers(s_items));
|
||||
serverActionResult.setCdata(cdatas);
|
||||
return ResponseEntity.ok()
|
||||
.contentType(MediaType.APPLICATION_XML)
|
||||
.body(xmlMapper.writeValueAsString(serverActionResult));
|
||||
} catch (JsonProcessingException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.alterdekim.game.controller;
|
||||
|
||||
import com.alterdekim.flash.decompiler.compiler.FlashCompiler;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashMapper;
|
||||
import com.alterdekim.flash.decompiler.translator.Java2Flash;
|
||||
import com.alterdekim.game.service.MRService;
|
||||
import com.alterdekim.game.service.MRTService;
|
||||
import com.alterdekim.game.service.ROService;
|
||||
import com.alterdekim.game.service.TRService;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class CacheController {
|
||||
|
||||
@Autowired
|
||||
private MRService mrService;
|
||||
|
||||
@Autowired
|
||||
private MRTService mrtService;
|
||||
|
||||
@Autowired
|
||||
private ROService roService;
|
||||
|
||||
@Autowired
|
||||
private TRService trService;
|
||||
|
||||
@GetMapping("/cache/resources.swf")
|
||||
public ResponseEntity<byte[]> generateResources() {
|
||||
try {
|
||||
byte[] b = Files.readAllBytes(Path.of("cache/resources.swf"));
|
||||
return ResponseEntity.ok()
|
||||
.contentType(MediaType.parseMediaType("application/x-shockwave-flash"))
|
||||
.contentLength(b.length)
|
||||
.body(b);
|
||||
} catch (IOException e) {
|
||||
log.error("generateResources error: {}", e.getMessage());
|
||||
}
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.alterdekim.game.controller;
|
||||
|
||||
import com.alterdekim.game.storage.FileSystemStorageService;
|
||||
import com.alterdekim.game.storage.StorageFileNotFoundException;
|
||||
import com.alterdekim.game.storage.StorageProperties;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@EnableConfigurationProperties(StorageProperties.class)
|
||||
public class FileServerController {
|
||||
|
||||
@Autowired
|
||||
private FileSystemStorageService storageService;
|
||||
|
||||
@RequestMapping(value = "/static/{*resPath}", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public ResponseEntity<byte[]> serveFile(@PathVariable("resPath") String resPath, HttpServletRequest request) {
|
||||
try {
|
||||
String filename = request.getRequestURL().substring(request.getRequestURL().indexOf("/static/")+8);
|
||||
Path path = storageService.load(filename);
|
||||
return ResponseEntity.ok().contentType(switch(resPath.substring(1, 4)) {
|
||||
case "swf" -> MediaType.parseMediaType("application/x-shockwave-flash");
|
||||
case "css" -> MediaType.parseMediaType("text/css");
|
||||
case "_js" -> MediaType.parseMediaType("text/javascript");
|
||||
case "img" -> MediaType.parseMediaType("image/jpeg");
|
||||
default -> MediaType.TEXT_PLAIN;
|
||||
}).body(Files.readAllBytes(path));
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
|
||||
@ExceptionHandler(StorageFileNotFoundException.class)
|
||||
public ResponseEntity<?> handleStorageFileNotFound(StorageFileNotFoundException exc) {
|
||||
return ResponseEntity.notFound().build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,122 @@
|
||||
package com.alterdekim.game.controller;
|
||||
|
||||
import com.alterdekim.game.component.game.AvatarInventoryType;
|
||||
import com.alterdekim.game.controller.result.signup.*;
|
||||
import com.alterdekim.game.entity.AvatarInventory;
|
||||
import com.alterdekim.game.entity.User;
|
||||
import com.alterdekim.game.security.AuthenticationUtil;
|
||||
import com.alterdekim.game.service.AvatarInventoryService;
|
||||
import com.alterdekim.game.service.IncompatibleService;
|
||||
import com.alterdekim.game.service.UserService;
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
public class SignUpController {
|
||||
|
||||
@Autowired
|
||||
private AvatarInventoryService avatarInventoryService;
|
||||
|
||||
@Autowired
|
||||
private IncompatibleService incompatibleService;
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@PostMapping("/ConstructorACHandler.ashx")
|
||||
public ResponseEntity<String> avatarController() {
|
||||
|
||||
AvatarController controller = new AvatarController(
|
||||
"Smesharik",
|
||||
new AvatarObject(
|
||||
new Incompatibles(incompatibleService.getAll()),
|
||||
List.of(
|
||||
new AvatarObjectSection("Shape", "Образ", avatarInventoryService.getShapeGroups()),
|
||||
new AvatarObjectSection("BodyParts", "Части тела", avatarInventoryService.getBodyPartGroups()),
|
||||
new AvatarObjectSection("Inventory", "Вещи", avatarInventoryService.getAvatarInventoryGroups())
|
||||
)
|
||||
)
|
||||
);
|
||||
try {
|
||||
return ResponseEntity.ok().contentType(MediaType.APPLICATION_XML).body(
|
||||
new XmlMapper().writeValueAsString(controller)
|
||||
);
|
||||
} catch (JsonProcessingException e) {
|
||||
log.error("AvatarConstructor controller error: {}", e.getMessage());
|
||||
}
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
|
||||
@PostMapping("/signup")
|
||||
public ResponseEntity<String> signup(
|
||||
@RequestParam("username") String username,
|
||||
@RequestParam("password") String password,
|
||||
@RequestParam("avatar") String avatar) {
|
||||
avatar = new String(Base64.getDecoder().decode(avatar));
|
||||
|
||||
XmlMapper xmlMapper = new XmlMapper();
|
||||
xmlMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE);
|
||||
xmlMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
|
||||
SignUpAvatar av = null;
|
||||
try {
|
||||
av = xmlMapper.readValue(avatar, SignUpAvatar.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
log.error(e.getMessage());
|
||||
return ResponseEntity.badRequest().body("bad_avatar");
|
||||
}
|
||||
User existingUser = userService.findByUsername(username);
|
||||
|
||||
if(existingUser != null && existingUser.getUsername() != null && !existingUser.getUsername().isEmpty() ) {
|
||||
return ResponseEntity.badRequest().body("already_exists");
|
||||
}
|
||||
|
||||
if(!AuthenticationUtil.checkCredentials(username, password)) {
|
||||
return ResponseEntity.badRequest().body("bad_credentials_format");
|
||||
}
|
||||
|
||||
long userId = userService.saveUser(username, password);
|
||||
|
||||
try {
|
||||
av.getInventory()
|
||||
.stream()
|
||||
.filter(i -> i.getID() != 98)
|
||||
.map(i -> new AvatarInventory(userId, i.getID().longValue(), true, AvatarInventoryType.Clothes))
|
||||
.forEach(i -> avatarInventoryService.addGoodToInventory(i));
|
||||
|
||||
av.getBodyParts()
|
||||
.stream()
|
||||
.filter(i -> i.getID() != 98)
|
||||
.map(i -> new AvatarInventory(userId, i.getID().longValue(), true, AvatarInventoryType.BodyParts, i.getColor() == null ? 0 : i.getColor()))
|
||||
.forEach(i -> avatarInventoryService.addGoodToInventory(i));
|
||||
} catch (Exception e) {
|
||||
userService.removeUser(userId);
|
||||
return ResponseEntity.badRequest().body("bad_avatar");
|
||||
}
|
||||
|
||||
return ResponseEntity.ok("ok");
|
||||
}
|
||||
|
||||
@GetMapping("/login")
|
||||
public String loginPage(Model model) {
|
||||
Optional<User> u = AuthenticationUtil.authProfile(userService);
|
||||
model.addAttribute("status", u.isPresent() ? "login_success" : "login_failed");
|
||||
return "login";
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.alterdekim.game.controller;
|
||||
|
||||
import com.alterdekim.game.service.GoodsService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
public class StaticController {
|
||||
|
||||
@Autowired
|
||||
private GoodsService goodsService;
|
||||
|
||||
|
||||
@GetMapping("/main")
|
||||
public String mainPage() {
|
||||
return "main";
|
||||
}
|
||||
|
||||
@GetMapping("/")
|
||||
public String defPage() {
|
||||
return "index";
|
||||
}
|
||||
|
||||
@GetMapping("/push")
|
||||
public String pushPage() {
|
||||
return "db";
|
||||
}
|
||||
|
||||
@GetMapping("/crossdomain.xml")
|
||||
public ResponseEntity<String> crossdomain() {
|
||||
return ResponseEntity.ok().contentType(MediaType.APPLICATION_XML).body("<?xml version=\"1.0\" ?>\n" +
|
||||
"<cross-domain-policy>\n" +
|
||||
" <site-control permitted-cross-domain-policies=\"all\"/>\n" +
|
||||
" <allow-access-from domain=\"*\"/>\n" +
|
||||
" <allow-http-request-headers-from domain=\"*\" headers=\"*\"/>\n" +
|
||||
"</cross-domain-policy>\n");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
@AllArgsConstructor
|
||||
@JsonRootName(value = "item")
|
||||
public class ConfigItem {
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Integer Id;
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private ServerActionConfigType Parameter;
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private String Value;
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private String Type;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
import com.alterdekim.game.xml.NumericBooleanSerializer;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
public class Flags {
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean IsUserDetailsMissing;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Integer EntranceCount;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
@AllArgsConstructor
|
||||
public class Grants {
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Integer ReceivingCount;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
import com.alterdekim.game.entity.PhoneMessage;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonRootName(value = "phone")
|
||||
public class PhoneMessages {
|
||||
@JacksonXmlProperty(localName = "messages")
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "messages")
|
||||
private List<PhoneMessage> messages;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
import com.alterdekim.game.entity.PhoneMessage;
|
||||
import com.alterdekim.game.entity.Postcard;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonRootName(value = "postcard")
|
||||
public class PostcardMessages {
|
||||
@JacksonXmlProperty(localName = "messages")
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "messages")
|
||||
private List<Postcard> messages;
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
public abstract class ServerActionCData {}
|
@ -0,0 +1,22 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonRootName(value = "config")
|
||||
public class ServerActionConfig extends ServerActionCData {
|
||||
@JacksonXmlProperty(localName = "item")
|
||||
@JacksonXmlElementWrapper(useWrapping = false, localName = "item")
|
||||
private List<ConfigItem> items;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
public enum ServerActionConfigType {
|
||||
IsPreloaderEnabled,
|
||||
SynchronizeAvatarRotation,
|
||||
InitialVolumeValue,
|
||||
IsStartupHomeLocation,
|
||||
AccessRoleFlags,
|
||||
IsInternational,
|
||||
TypeWeapon,
|
||||
StatisticsSendInterval,
|
||||
SwfVersion,
|
||||
LanguageId,
|
||||
SnId,
|
||||
AutoServerSelectionAllowed
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
import com.alterdekim.game.entity.Miniquest;
|
||||
import com.alterdekim.game.entity.Preloader;
|
||||
import com.alterdekim.game.entity.Promotion;
|
||||
import com.alterdekim.game.entity.PromotionBanner;
|
||||
import com.alterdekim.game.xml.CryptoSerializer;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonRootName(value = "response")
|
||||
public class ServerActionResult {
|
||||
|
||||
@JsonProperty
|
||||
private SnStatus sn_status;
|
||||
|
||||
@JsonProperty
|
||||
private UserName user_name;
|
||||
|
||||
@JsonProperty
|
||||
private List<Preloader> preloader;
|
||||
|
||||
@JsonProperty
|
||||
private Flags flags;
|
||||
|
||||
@JacksonXmlProperty(localName = "tutorial")
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "tutorial")
|
||||
private List<Tutorial> tutorial;
|
||||
|
||||
@JsonProperty
|
||||
private Grants grants;
|
||||
|
||||
@JsonProperty
|
||||
private Grants requests;
|
||||
|
||||
@JsonProperty
|
||||
private List<Promotion> promotion;
|
||||
|
||||
@JsonProperty
|
||||
private List<PromotionBanner> promotion_banner;
|
||||
|
||||
@JsonProperty
|
||||
private PhoneMessages phone;
|
||||
|
||||
@JsonProperty
|
||||
private PostcardMessages postcard;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "miniquest")
|
||||
private List<Miniquest> miniquest;
|
||||
|
||||
@JacksonXmlProperty(localName = "cdata")
|
||||
@JsonSerialize(using = CryptoSerializer.class)
|
||||
@JacksonXmlElementWrapper(useWrapping = false, localName = "cdata")
|
||||
private List<ServerActionCData> cdata;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonRootName(value = "servers")
|
||||
public class ServerActionServers extends ServerActionCData {
|
||||
@JacksonXmlProperty(localName = "item")
|
||||
@JacksonXmlElementWrapper(useWrapping = false, localName = "item")
|
||||
private List<ServerItem> items;
|
||||
}
|
||||
|
@ -0,0 +1,31 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonRootName(value = "system")
|
||||
public class ServerActionSystem extends ServerActionCData {
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Integer RVersion;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private String RPath;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "ServerDate")
|
||||
public String ServerDate() {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = new Date();
|
||||
return format.format(date);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonRootName(value = "user")
|
||||
public class ServerActionUser extends ServerActionCData {
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Long UserId;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private String hwId;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private String ticketId;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Integer RoleFlags;
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
@AllArgsConstructor
|
||||
@JsonRootName(value = "item")
|
||||
public class ServerItem {
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Integer Id;
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Integer TRId;
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Integer RId;
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private String RTMPUrl;
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Integer Load;
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Integer FriendsCount;
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Integer ClubsCount;
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Double Weight;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
import com.alterdekim.game.xml.NumericBooleanSerializer;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
public class SnStatus {
|
||||
@JsonProperty
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Boolean IsBinded;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public class Tutorial {
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Integer Id;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private Integer State;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
public class UserName {
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
private String Value;
|
||||
}
|
@ -0,0 +1,155 @@
|
||||
package com.alterdekim.game.controller.result.async;
|
||||
|
||||
|
||||
import com.alterdekim.game.component.game.ClubAccessType;
|
||||
import com.alterdekim.game.component.game.RoleFlags;
|
||||
import com.alterdekim.game.xml.NumericBooleanSerializer;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@JsonRootName(value = "user")
|
||||
public class UserResult {
|
||||
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "UserId")
|
||||
private Long id;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Name")
|
||||
private String username;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "LocationServerName")
|
||||
private String locationServerName;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "RoleFlags")
|
||||
private RoleFlags roleFlags;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "InstructorLevel")
|
||||
private Integer instructorLevel;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "MagicLevel")
|
||||
private Integer magicLevel;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "RaceLevel")
|
||||
private Integer raceLevel;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "PhoneID")
|
||||
private Integer phoneID;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "BackgroundID")
|
||||
private Integer backgroundID;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "UsualTickets")
|
||||
private Integer usualTickets;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "MagicTickets")
|
||||
private Integer magicTickets;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Experience")
|
||||
private Integer experience;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Level")
|
||||
private Integer level;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "PositiveEnergy")
|
||||
private Integer positiveEnergy;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "VisaId")
|
||||
private Integer visaId;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "CurrentUseCount")
|
||||
private Integer currentUseCount;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "LastNewspaperId")
|
||||
private Integer lastNewspaperId;
|
||||
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsClubPresent")
|
||||
private Boolean isClubPresent;
|
||||
|
||||
@JsonSerialize(using = NumericBooleanSerializer.class)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsClubLocked")
|
||||
private Boolean isClubLocked;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "ClubAccessType")
|
||||
private ClubAccessType clubAccessType;
|
||||
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsMinorSecretAgent")
|
||||
private Boolean isMinorSecretAgent;
|
||||
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "HasSnFriends")
|
||||
private Boolean hasSnFriends;
|
||||
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsHomeLocked")
|
||||
private Boolean isHomeLocked;
|
||||
|
||||
@JsonSerialize(using = NumericBooleanSerializer.class)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsLimited")
|
||||
private Boolean isLimited;
|
||||
|
||||
@JsonSerialize(using = NumericBooleanSerializer.class)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsOnline")
|
||||
private Boolean isOnline;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "CampId")
|
||||
private Integer campId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "NiftTotalCount")
|
||||
private Integer niftTotalCount;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "DateRegistered")
|
||||
private Date dateRegistered;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "MinsLeft")
|
||||
private Integer minsLeft;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "TimesUsed")
|
||||
private Integer timesUsed;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsFriend")
|
||||
private Boolean isFriend;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.alterdekim.game.controller.result.signup;
|
||||
|
||||
import com.alterdekim.game.xml.NumericBooleanSerializer;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class AvatarBodyPart {
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "ID")
|
||||
private Integer id;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Color")
|
||||
private Integer color;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IsUsed")
|
||||
@JsonSerialize(using = NumericBooleanSerializer.class)
|
||||
private Boolean isUsed;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "URL")
|
||||
private String url;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.alterdekim.game.controller.result.signup;
|
||||
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class AvatarBodyPartGroup {
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "ID")
|
||||
private Integer id;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Name")
|
||||
private String name;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "URL")
|
||||
private String url;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "LayerID")
|
||||
private Integer layerId;
|
||||
|
||||
@JacksonXmlProperty(localName = "part")
|
||||
@JacksonXmlElementWrapper(useWrapping = false, localName = "part")
|
||||
private List<AvatarBodyPart> parts;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.alterdekim.game.controller.result.signup;
|
||||
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
||||
import lombok.*;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@JacksonXmlRootElement(localName = "root")
|
||||
public class AvatarController {
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "UserName")
|
||||
private String username;
|
||||
|
||||
@JacksonXmlProperty(isAttribute = false, localName = "Avatar")
|
||||
private AvatarObject avatar;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.alterdekim.game.controller.result.signup;
|
||||
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AvatarObject {
|
||||
@JacksonXmlProperty(isAttribute = false, localName = "Incompatibles")
|
||||
private Incompatibles incompatibles;
|
||||
|
||||
@JacksonXmlProperty(localName = "item")
|
||||
@JacksonXmlElementWrapper(useWrapping = false, localName = "item")
|
||||
private List<AvatarObjectSection> items;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.alterdekim.game.controller.result.signup;
|
||||
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AvatarObjectSection {
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "ID")
|
||||
private String id;
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Name")
|
||||
private String name;
|
||||
|
||||
@JacksonXmlProperty(localName = "group")
|
||||
@JacksonXmlElementWrapper(useWrapping = false, localName = "group")
|
||||
private List<AvatarBodyPartGroup> groups;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.alterdekim.game.controller.result.signup;
|
||||
|
||||
import com.alterdekim.game.entity.Incompatible;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class Incompatibles {
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "ID")
|
||||
private final String id = "Incompatibles";
|
||||
|
||||
@JacksonXmlProperty(localName = "incompatible")
|
||||
@JacksonXmlElementWrapper(useWrapping = false, localName = "incompatible")
|
||||
private List<Incompatible> items;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.alterdekim.game.controller.result.signup;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@JacksonXmlRootElement(localName = "UserAvatar")
|
||||
public class SignUpAvatar {
|
||||
@JsonProperty(value = "BodyParts")
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "BodyParts")
|
||||
private List<SignUpAvatarBodyPart> BodyParts;
|
||||
@JsonProperty(value = "Inventory")
|
||||
@JacksonXmlElementWrapper(useWrapping = true, localName = "Inventory")
|
||||
private List<SignUpAvatarInventory> Inventory;
|
||||
@JacksonXmlProperty(localName = "pixels")
|
||||
private String pixels;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.alterdekim.game.controller.result.signup;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class SignUpAvatarBodyPart {
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "Color")
|
||||
private Integer Color;
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "ID")
|
||||
private Integer ID;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.alterdekim.game.controller.result.signup;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class SignUpAvatarInventory {
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "ActionID")
|
||||
private Integer ActionID;
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "ID")
|
||||
private Integer ID;
|
||||
}
|
49
src/main/java/com/alterdekim/game/crypto/RC4.java
Normal file
49
src/main/java/com/alterdekim/game/crypto/RC4.java
Normal file
@ -0,0 +1,49 @@
|
||||
package com.alterdekim.game.crypto;
|
||||
|
||||
public class RC4 {
|
||||
private final byte[] S = new byte[256];
|
||||
private final byte[] T = new byte[256];
|
||||
private final int keylen;
|
||||
|
||||
public RC4(final byte[] key) {
|
||||
if (key.length < 1 || key.length > 256) {
|
||||
throw new IllegalArgumentException(
|
||||
"key must be between 1 and 256 bytes");
|
||||
} else {
|
||||
keylen = key.length;
|
||||
for (int i = 0; i < 256; i++) {
|
||||
S[i] = (byte) i;
|
||||
T[i] = key[i % keylen];
|
||||
}
|
||||
int j = 0;
|
||||
byte tmp;
|
||||
for (int i = 0; i < 256; i++) {
|
||||
j = (j + S[i] + T[i]) & 0xFF;
|
||||
tmp = S[j];
|
||||
S[j] = S[i];
|
||||
S[i] = tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] encrypt(final byte[] plaintext) {
|
||||
final byte[] ciphertext = new byte[plaintext.length];
|
||||
int i = 0, j = 0, k, t;
|
||||
byte tmp;
|
||||
for (int counter = 0; counter < plaintext.length; counter++) {
|
||||
i = (i + 1) & 0xFF;
|
||||
j = (j + S[i]) & 0xFF;
|
||||
tmp = S[j];
|
||||
S[j] = S[i];
|
||||
S[i] = tmp;
|
||||
t = (S[i] + S[j]) & 0xFF;
|
||||
k = S[t];
|
||||
ciphertext[counter] = (byte) (plaintext[counter] ^ k);
|
||||
}
|
||||
return ciphertext;
|
||||
}
|
||||
|
||||
public byte[] decrypt(final byte[] ciphertext) {
|
||||
return encrypt(ciphertext);
|
||||
}
|
||||
}
|
37
src/main/java/com/alterdekim/game/entity/Achievement.java
Normal file
37
src/main/java/com/alterdekim/game/entity/Achievement.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.*;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="achievements")
|
||||
@FlashClass(name = "ac")
|
||||
public class Achievement {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "TypeId")
|
||||
private Integer typeId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "TRId")
|
||||
private Integer trId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "MRId")
|
||||
private Integer mrId;
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
|
||||
import com.alterdekim.game.component.game.AvatarInventoryType;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="avatar_inventory")
|
||||
public class AvatarInventory {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long Id;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Long userId;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Long goodId;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Boolean isUsed;
|
||||
|
||||
@Enumerated(value = EnumType.STRING)
|
||||
private AvatarInventoryType type;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Integer color = 0;
|
||||
|
||||
public AvatarInventory(Long userId, Long goodId, Boolean isUsed, AvatarInventoryType type) {
|
||||
this.userId = userId;
|
||||
this.goodId = goodId;
|
||||
this.isUsed = isUsed;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public AvatarInventory(Long userId, Long goodId, Boolean isUsed, AvatarInventoryType type, Integer color) {
|
||||
this.userId = userId;
|
||||
this.goodId = goodId;
|
||||
this.isUsed = isUsed;
|
||||
this.type = type;
|
||||
this.color = color;
|
||||
}
|
||||
}
|
30
src/main/java/com/alterdekim/game/entity/Background.java
Normal file
30
src/main/java/com/alterdekim/game/entity/Background.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.*;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="backgrounds")
|
||||
@FlashClass(name = "bg")
|
||||
public class Background {
|
||||
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@FlashValue(type = FlashValueType.Value)
|
||||
@Column(nullable = false)
|
||||
private Integer mediaResourceId;
|
||||
}
|
29
src/main/java/com/alterdekim/game/entity/BodyPart.java
Normal file
29
src/main/java/com/alterdekim/game/entity/BodyPart.java
Normal file
@ -0,0 +1,29 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
|
||||
import com.alterdekim.game.component.game.BodyPartType;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="bodyparts")
|
||||
public class BodyPart {
|
||||
@Id
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Integer mediaResourceId;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Boolean isColorable;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private BodyPartType type;
|
||||
}
|
49
src/main/java/com/alterdekim/game/entity/Catalog.java
Normal file
49
src/main/java/com/alterdekim/game/entity/Catalog.java
Normal file
@ -0,0 +1,49 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import com.alterdekim.game.component.game.CatalogType;
|
||||
import com.alterdekim.game.mapper.String2CatalogTypeConverter;
|
||||
import com.alterdekim.game.mapper.String2DateConverter;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="catalogs")
|
||||
@FlashClass(name = "c")
|
||||
public class Catalog {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@FlashField(name = "Type", useCustomConverter = true, converter = String2CatalogTypeConverter.class)
|
||||
private CatalogType type;
|
||||
|
||||
@Column(nullable = true)
|
||||
@FlashField(name = "TRId")
|
||||
private Integer trId;
|
||||
|
||||
@Column(nullable = true)
|
||||
@FlashField(name = "MRId")
|
||||
private Integer mrId;
|
||||
|
||||
@Column(nullable = true)
|
||||
@FlashField(name = "Tag")
|
||||
private Integer tag;
|
||||
|
||||
@Column(nullable = true)
|
||||
@FlashField(name = "PublishDate", useCustomConverter = true, converter = String2DateConverter.class)
|
||||
private LocalDateTime publishDate;
|
||||
}
|
33
src/main/java/com/alterdekim/game/entity/CatalogObject.java
Normal file
33
src/main/java/com/alterdekim/game/entity/CatalogObject.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.*;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="catalogs_o")
|
||||
@FlashClass(name = "ct")
|
||||
public class CatalogObject {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "TypeId")
|
||||
private Integer typeId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "MRId")
|
||||
private Integer mrId;
|
||||
}
|
28
src/main/java/com/alterdekim/game/entity/GAAccount.java
Normal file
28
src/main/java/com/alterdekim/game/entity/GAAccount.java
Normal file
@ -0,0 +1,28 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.*;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="ga_account")
|
||||
@FlashClass(name = "ga")
|
||||
public class GAAccount {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@FlashValue(type = FlashValueType.Value)
|
||||
@Column(nullable = false)
|
||||
private String value;
|
||||
}
|
30
src/main/java/com/alterdekim/game/entity/GameIcon.java
Normal file
30
src/main/java/com/alterdekim/game/entity/GameIcon.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Entity
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "game_icons")
|
||||
@FlashClass(name = "gi")
|
||||
public class GameIcon {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashValue(type = FlashValueType.Value)
|
||||
private Integer iconMRId;
|
||||
}
|
102
src/main/java/com/alterdekim/game/entity/Good.java
Normal file
102
src/main/java/com/alterdekim/game/entity/Good.java
Normal file
@ -0,0 +1,102 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import com.alterdekim.game.component.game.RoleFlags;
|
||||
import com.alterdekim.game.mapper.Integer2BooleanConverter;
|
||||
import com.alterdekim.game.mapper.Integer2RoleFlagsConverter;
|
||||
import com.alterdekim.game.mapper.String2DateConverter;
|
||||
import com.alterdekim.game.xml.RoleFlagsDeserializer;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="goods")
|
||||
@ToString
|
||||
@FlashClass(name = "g")
|
||||
public class Good {
|
||||
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@FlashField(name = "MRId")
|
||||
@Column(nullable = false)
|
||||
private Integer mRId = -1;
|
||||
|
||||
@FlashField(name = "TRId")
|
||||
@Column(nullable = false)
|
||||
private Integer tRId = -1;
|
||||
|
||||
@FlashField(name = "IconMRId")
|
||||
@Column(nullable = false)
|
||||
private Integer iconMRId = -1;
|
||||
|
||||
@FlashField(name = "DescTRId")
|
||||
@Column(nullable = false)
|
||||
private Integer descTRId = -1;
|
||||
|
||||
@FlashField(name = "GoodTypeId")
|
||||
@Column(nullable = false)
|
||||
private Integer goodTypeId;
|
||||
|
||||
@FlashField(name = "RoleFlags", useCustomConverter = true, converter = Integer2RoleFlagsConverter.class)
|
||||
@Enumerated(EnumType.STRING)
|
||||
private RoleFlags roleFlags = RoleFlags.NONE;
|
||||
|
||||
@FlashField(name = "UsualTickets")
|
||||
@Column(nullable = false)
|
||||
private Integer usualTickets = 0;
|
||||
|
||||
@FlashField(name = "MagicTickets")
|
||||
@Column(nullable = false)
|
||||
private Integer magicTickets = 0;
|
||||
|
||||
@FlashField(name = "DefCurrency")
|
||||
@Column(nullable = false)
|
||||
private Integer defCurrency;
|
||||
|
||||
@FlashField(name = "LevelThreshold")
|
||||
@Column(nullable = false)
|
||||
private Integer levelThreshold;
|
||||
|
||||
@FlashField(name = "UnlockCost")
|
||||
@Column(nullable = false)
|
||||
private Integer unlockCost;
|
||||
|
||||
@FlashField(name = "SortOrder")
|
||||
@Column(nullable = false)
|
||||
private Integer sortOrder;
|
||||
|
||||
@FlashField(name = "PublishDate", useCustomConverter = true, converter = String2DateConverter.class)
|
||||
@Column(nullable = false)
|
||||
private LocalDateTime publishDate;
|
||||
|
||||
@FlashField(name = "Tags")
|
||||
@Column(nullable = false)
|
||||
private String tags;
|
||||
|
||||
@FlashField(name = "LayerId")
|
||||
@Column(nullable = false)
|
||||
private Integer layerId = 0;
|
||||
|
||||
@FlashField(name = "IsActive", useCustomConverter = true, converter = Integer2BooleanConverter.class)
|
||||
@Column(nullable = false)
|
||||
private Boolean isActive;
|
||||
|
||||
@FlashField(name = "ItemCount")
|
||||
@Column(nullable = false)
|
||||
private Integer itemCount = -1;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.*;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="gcds")
|
||||
@FlashClass(name = "gcd")
|
||||
public class GoodClubDancefloor {
|
||||
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "Days")
|
||||
private Integer days;
|
||||
}
|
33
src/main/java/com/alterdekim/game/entity/GoodMagic.java
Normal file
33
src/main/java/com/alterdekim/game/entity/GoodMagic.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.*;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="gms")
|
||||
@FlashClass(name = "gm")
|
||||
public class GoodMagic {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "MAId")
|
||||
private Integer magicAbilityId;
|
||||
|
||||
@Column(nullable = true)
|
||||
@FlashField(name = "Days")
|
||||
private Integer days;
|
||||
}
|
37
src/main/java/com/alterdekim/game/entity/GoodSmile.java
Normal file
37
src/main/java/com/alterdekim/game/entity/GoodSmile.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.*;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="good_smiles")
|
||||
@ToString
|
||||
@FlashClass(name = "gs")
|
||||
public class GoodSmile {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "SId")
|
||||
private Integer smileId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "Smiles")
|
||||
private String smiles;
|
||||
|
||||
@Column(nullable = true)
|
||||
@FlashField(name = "Days")
|
||||
private Integer days;
|
||||
}
|
28
src/main/java/com/alterdekim/game/entity/GoodTag.java
Normal file
28
src/main/java/com/alterdekim/game/entity/GoodTag.java
Normal file
@ -0,0 +1,28 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.*;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="good_tag")
|
||||
@FlashClass(name = "t")
|
||||
public class GoodTag {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashValue(type = FlashValueType.Value)
|
||||
private String tag;
|
||||
}
|
50
src/main/java/com/alterdekim/game/entity/Incompatible.java
Normal file
50
src/main/java/com/alterdekim/game/entity/Incompatible.java
Normal file
@ -0,0 +1,50 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@FlashClass(name = "ic")
|
||||
@Entity
|
||||
@Table(name = "incompatibles")
|
||||
public class Incompatible {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "ID")
|
||||
private Long id;
|
||||
|
||||
@FlashField(name = "IncGID0")
|
||||
@Column(nullable = true)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IncGID0")
|
||||
private Integer incGID0;
|
||||
|
||||
@FlashField(name = "IncGID1")
|
||||
@Column(nullable = true)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IncGID1")
|
||||
private Integer incGID1;
|
||||
|
||||
@FlashField(name = "IncBPID0")
|
||||
@Column(nullable = true)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IncBPID0")
|
||||
private Integer incBPID0;
|
||||
|
||||
@FlashField(name = "IncBPID1")
|
||||
@Column(nullable = true)
|
||||
@JacksonXmlProperty(isAttribute = true, localName = "IncBPID1")
|
||||
private Integer incBPID1;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@FlashClass(name = "le")
|
||||
@Entity
|
||||
@Table(name = "level_experience")
|
||||
public class LevelExperience {
|
||||
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long level;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashValue(type = FlashValueType.Value)
|
||||
private Integer experience;
|
||||
}
|
37
src/main/java/com/alterdekim/game/entity/Library.java
Normal file
37
src/main/java/com/alterdekim/game/entity/Library.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.*;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="library")
|
||||
@FlashClass(name = "lb")
|
||||
public class Library {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "TRId")
|
||||
private Integer textResourceId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "MRId")
|
||||
private Integer mediaResourceId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "Status")
|
||||
private Integer status;
|
||||
}
|
49
src/main/java/com/alterdekim/game/entity/Location.java
Normal file
49
src/main/java/com/alterdekim/game/entity/Location.java
Normal file
@ -0,0 +1,49 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@Entity
|
||||
@Table(name = "locations")
|
||||
public class Location {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Long locationId;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Long mediaResourceId;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Double x;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Double y;
|
||||
|
||||
@Column(nullable = false, length = 65555)
|
||||
private String name;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Boolean isDefault;
|
||||
|
||||
@Column(nullable = false)
|
||||
private Boolean isEnabled;
|
||||
|
||||
public Location(Long locationId, Long mediaResourceId, Double x, Double y, String name, Boolean isDefault, Boolean isEnabled) {
|
||||
this.locationId = locationId;
|
||||
this.mediaResourceId = mediaResourceId;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.name = name;
|
||||
this.isDefault = isDefault;
|
||||
this.isEnabled = isEnabled;
|
||||
}
|
||||
}
|
57
src/main/java/com/alterdekim/game/entity/MagicAbility.java
Normal file
57
src/main/java/com/alterdekim/game/entity/MagicAbility.java
Normal file
@ -0,0 +1,57 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.*;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="magic_ability")
|
||||
@FlashClass(name = "ma")
|
||||
public class MagicAbility {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "TypeId")
|
||||
private Integer typeId;
|
||||
|
||||
@Column(nullable = true)
|
||||
@FlashField(name = "duration")
|
||||
private Integer duration;
|
||||
|
||||
@Column(nullable = true)
|
||||
@FlashField(name = "TweenerId")
|
||||
private Integer tweenerId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "MRId")
|
||||
private Integer mediaResourceId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "TRId")
|
||||
private Integer textResourceId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "IconMRId")
|
||||
private Integer iconMRId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "IsVisibleInInfoPanel")
|
||||
private Boolean isVisibleInInfoPanel;
|
||||
|
||||
@Column(nullable = true)
|
||||
@FlashField(name = "IsMovable")
|
||||
private Boolean isMovable;
|
||||
}
|
37
src/main/java/com/alterdekim/game/entity/MediaResource.java
Normal file
37
src/main/java/com/alterdekim/game/entity/MediaResource.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.*;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="mrids")
|
||||
@FlashClass(name = "mr")
|
||||
public class MediaResource {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@FlashField(name = "TId")
|
||||
@Column(nullable = false)
|
||||
private Integer tId;
|
||||
|
||||
@FlashField(name = "Url")
|
||||
@Column(nullable = false)
|
||||
private String url;
|
||||
|
||||
@FlashField(name = "V")
|
||||
@Column(nullable = true)
|
||||
private String v;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.*;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="mrts")
|
||||
@FlashClass(name = "mrt")
|
||||
public class MediaResourcePath {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashValue(type = FlashValueType.Value)
|
||||
private String val;
|
||||
}
|
62
src/main/java/com/alterdekim/game/entity/Miniquest.java
Normal file
62
src/main/java/com/alterdekim/game/entity/Miniquest.java
Normal file
@ -0,0 +1,62 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
|
||||
import com.alterdekim.game.xml.NumericBooleanSerializer;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="miniquests")
|
||||
@JsonRootName(value = "i")
|
||||
public class Miniquest {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonProperty
|
||||
private Long Id;
|
||||
|
||||
@JsonIgnore
|
||||
@Column(nullable = false)
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean isTask;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
private Long MiniquestId;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean IsPostponed;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean IsFinished;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
private String StartDate;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
private Integer Counter;
|
||||
}
|
41
src/main/java/com/alterdekim/game/entity/Mission.java
Normal file
41
src/main/java/com/alterdekim/game/entity/Mission.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashField;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.*;
|
||||
|
||||
@ToString
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="missions")
|
||||
@FlashClass(name = "mi")
|
||||
public class Mission {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "MRId")
|
||||
private Integer mediaResourceId;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "Type")
|
||||
private Integer type;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "IsActive")
|
||||
private Boolean isActive;
|
||||
|
||||
@Column(nullable = false)
|
||||
@FlashField(name = "CheckRole")
|
||||
private Boolean checkRole;
|
||||
}
|
30
src/main/java/com/alterdekim/game/entity/PhoneIcon.java
Normal file
30
src/main/java/com/alterdekim/game/entity/PhoneIcon.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashClass;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValue;
|
||||
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "phone_icons")
|
||||
@FlashClass(name = "ph")
|
||||
public class PhoneIcon {
|
||||
@Id
|
||||
@FlashValue(type = FlashValueType.Id)
|
||||
private Long id;
|
||||
|
||||
@FlashValue(type = FlashValueType.Value)
|
||||
@Column(nullable = false)
|
||||
private Integer iconMRId;
|
||||
}
|
53
src/main/java/com/alterdekim/game/entity/PhoneMessage.java
Normal file
53
src/main/java/com/alterdekim/game/entity/PhoneMessage.java
Normal file
@ -0,0 +1,53 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.game.xml.NumericBooleanSerializer;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="phone_messages")
|
||||
@JsonRootName(value = "item")
|
||||
public class PhoneMessage {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonProperty
|
||||
private Long Id;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
private String DateSent;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
private Long SenderId;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
private String SenderName;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
private String Text;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean IsNew;
|
||||
}
|
52
src/main/java/com/alterdekim/game/entity/Postcard.java
Normal file
52
src/main/java/com/alterdekim/game/entity/Postcard.java
Normal file
@ -0,0 +1,52 @@
|
||||
package com.alterdekim.game.entity;
|
||||
|
||||
import com.alterdekim.game.xml.NumericBooleanSerializer;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name="postcards")
|
||||
@JsonRootName(value = "item")
|
||||
public class Postcard {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@JsonProperty
|
||||
private Long Id;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
private String DateSent;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
private Long SenderId;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
private String SenderName;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
private Integer CardId;
|
||||
|
||||
@JsonProperty
|
||||
@JacksonXmlProperty(isAttribute = true)
|
||||
@Column(nullable = false)
|
||||
@JsonSerialize(using= NumericBooleanSerializer.class)
|
||||
private Boolean IsNew;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user