Mod init
This commit is contained in:
@@ -0,0 +1,437 @@
|
||||
Attribution-NonCommercial-ShareAlike 4.0 International
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
||||
does not provide legal services or legal advice. Distribution of
|
||||
Creative Commons public licenses does not create a lawyer-client or
|
||||
other relationship. Creative Commons makes its licenses and related
|
||||
information available on an "as-is" basis. Creative Commons gives no
|
||||
warranties regarding its licenses, any material licensed under their
|
||||
terms and conditions, or any related information. Creative Commons
|
||||
disclaims all liability for damages resulting from their use to the
|
||||
fullest extent possible.
|
||||
|
||||
Using Creative Commons Public Licenses
|
||||
|
||||
Creative Commons public licenses provide a standard set of terms and
|
||||
conditions that creators and other rights holders may use to share
|
||||
original works of authorship and other material subject to copyright
|
||||
and certain other rights specified in the public license below. The
|
||||
following considerations are for informational purposes only, are not
|
||||
exhaustive, and do not form part of our licenses.
|
||||
|
||||
Considerations for licensors: Our public licenses are
|
||||
intended for use by those authorized to give the public
|
||||
permission to use material in ways otherwise restricted by
|
||||
copyright and certain other rights. Our licenses are
|
||||
irrevocable. Licensors should read and understand the terms
|
||||
and conditions of the license they choose before applying it.
|
||||
Licensors should also secure all rights necessary before
|
||||
applying our licenses so that the public can reuse the
|
||||
material as expected. Licensors should clearly mark any
|
||||
material not subject to the license. This includes other CC-
|
||||
licensed material, or material used under an exception or
|
||||
limitation to copyright. More considerations for licensors:
|
||||
wiki.creativecommons.org/Considerations_for_licensors
|
||||
|
||||
Considerations for the public: By using one of our public
|
||||
licenses, a licensor grants the public permission to use the
|
||||
licensed material under specified terms and conditions. If
|
||||
the licensor's permission is not necessary for any reason--for
|
||||
example, because of any applicable exception or limitation to
|
||||
copyright--then that use is not regulated by the license. Our
|
||||
licenses grant only permissions under copyright and certain
|
||||
other rights that a licensor has authority to grant. Use of
|
||||
the licensed material may still be restricted for other
|
||||
reasons, including because others have copyright or other
|
||||
rights in the material. A licensor may make special requests,
|
||||
such as asking that all changes be marked or described.
|
||||
Although not required by our licenses, you are encouraged to
|
||||
respect those requests where reasonable. More considerations
|
||||
for the public:
|
||||
wiki.creativecommons.org/Considerations_for_licensees
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
|
||||
Public License
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree
|
||||
to be bound by the terms and conditions of this Creative Commons
|
||||
Attribution-NonCommercial-ShareAlike 4.0 International Public License
|
||||
("Public License"). To the extent this Public License may be
|
||||
interpreted as a contract, You are granted the Licensed Rights in
|
||||
consideration of Your acceptance of these terms and conditions, and the
|
||||
Licensor grants You such rights in consideration of benefits the
|
||||
Licensor receives from making the Licensed Material available under
|
||||
these terms and conditions.
|
||||
|
||||
|
||||
Section 1 -- Definitions.
|
||||
|
||||
a. Adapted Material means material subject to Copyright and Similar
|
||||
Rights that is derived from or based upon the Licensed Material
|
||||
and in which the Licensed Material is translated, altered,
|
||||
arranged, transformed, or otherwise modified in a manner requiring
|
||||
permission under the Copyright and Similar Rights held by the
|
||||
Licensor. For purposes of this Public License, where the Licensed
|
||||
Material is a musical work, performance, or sound recording,
|
||||
Adapted Material is always produced where the Licensed Material is
|
||||
synched in timed relation with a moving image.
|
||||
|
||||
b. Adapter's License means the license You apply to Your Copyright
|
||||
and Similar Rights in Your contributions to Adapted Material in
|
||||
accordance with the terms and conditions of this Public License.
|
||||
|
||||
c. BY-NC-SA Compatible License means a license listed at
|
||||
creativecommons.org/compatiblelicenses, approved by Creative
|
||||
Commons as essentially the equivalent of this Public License.
|
||||
|
||||
d. Copyright and Similar Rights means copyright and/or similar rights
|
||||
closely related to copyright including, without limitation,
|
||||
performance, broadcast, sound recording, and Sui Generis Database
|
||||
Rights, without regard to how the rights are labeled or
|
||||
categorized. For purposes of this Public License, the rights
|
||||
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
||||
Rights.
|
||||
|
||||
e. Effective Technological Measures means those measures that, in the
|
||||
absence of proper authority, may not be circumvented under laws
|
||||
fulfilling obligations under Article 11 of the WIPO Copyright
|
||||
Treaty adopted on December 20, 1996, and/or similar international
|
||||
agreements.
|
||||
|
||||
f. Exceptions and Limitations means fair use, fair dealing, and/or
|
||||
any other exception or limitation to Copyright and Similar Rights
|
||||
that applies to Your use of the Licensed Material.
|
||||
|
||||
g. License Elements means the license attributes listed in the name
|
||||
of a Creative Commons Public License. The License Elements of this
|
||||
Public License are Attribution, NonCommercial, and ShareAlike.
|
||||
|
||||
h. Licensed Material means the artistic or literary work, database,
|
||||
or other material to which the Licensor applied this Public
|
||||
License.
|
||||
|
||||
i. Licensed Rights means the rights granted to You subject to the
|
||||
terms and conditions of this Public License, which are limited to
|
||||
all Copyright and Similar Rights that apply to Your use of the
|
||||
Licensed Material and that the Licensor has authority to license.
|
||||
|
||||
j. Licensor means the individual(s) or entity(ies) granting rights
|
||||
under this Public License.
|
||||
|
||||
k. NonCommercial means not primarily intended for or directed towards
|
||||
commercial advantage or monetary compensation. For purposes of
|
||||
this Public License, the exchange of the Licensed Material for
|
||||
other material subject to Copyright and Similar Rights by digital
|
||||
file-sharing or similar means is NonCommercial provided there is
|
||||
no payment of monetary compensation in connection with the
|
||||
exchange.
|
||||
|
||||
l. Share means to provide material to the public by any means or
|
||||
process that requires permission under the Licensed Rights, such
|
||||
as reproduction, public display, public performance, distribution,
|
||||
dissemination, communication, or importation, and to make material
|
||||
available to the public including in ways that members of the
|
||||
public may access the material from a place and at a time
|
||||
individually chosen by them.
|
||||
|
||||
m. Sui Generis Database Rights means rights other than copyright
|
||||
resulting from Directive 96/9/EC of the European Parliament and of
|
||||
the Council of 11 March 1996 on the legal protection of databases,
|
||||
as amended and/or succeeded, as well as other essentially
|
||||
equivalent rights anywhere in the world.
|
||||
|
||||
n. You means the individual or entity exercising the Licensed Rights
|
||||
under this Public License. Your has a corresponding meaning.
|
||||
|
||||
|
||||
Section 2 -- Scope.
|
||||
|
||||
a. License grant.
|
||||
|
||||
1. Subject to the terms and conditions of this Public License,
|
||||
the Licensor hereby grants You a worldwide, royalty-free,
|
||||
non-sublicensable, non-exclusive, irrevocable license to
|
||||
exercise the Licensed Rights in the Licensed Material to:
|
||||
|
||||
a. reproduce and Share the Licensed Material, in whole or
|
||||
in part, for NonCommercial purposes only; and
|
||||
|
||||
b. produce, reproduce, and Share Adapted Material for
|
||||
NonCommercial purposes only.
|
||||
|
||||
2. Exceptions and Limitations. For the avoidance of doubt, where
|
||||
Exceptions and Limitations apply to Your use, this Public
|
||||
License does not apply, and You do not need to comply with
|
||||
its terms and conditions.
|
||||
|
||||
3. Term. The term of this Public License is specified in Section
|
||||
6(a).
|
||||
|
||||
4. Media and formats; technical modifications allowed. The
|
||||
Licensor authorizes You to exercise the Licensed Rights in
|
||||
all media and formats whether now known or hereafter created,
|
||||
and to make technical modifications necessary to do so. The
|
||||
Licensor waives and/or agrees not to assert any right or
|
||||
authority to forbid You from making technical modifications
|
||||
necessary to exercise the Licensed Rights, including
|
||||
technical modifications necessary to circumvent Effective
|
||||
Technological Measures. For purposes of this Public License,
|
||||
simply making modifications authorized by this Section 2(a)
|
||||
(4) never produces Adapted Material.
|
||||
|
||||
5. Downstream recipients.
|
||||
|
||||
a. Offer from the Licensor -- Licensed Material. Every
|
||||
recipient of the Licensed Material automatically
|
||||
receives an offer from the Licensor to exercise the
|
||||
Licensed Rights under the terms and conditions of this
|
||||
Public License.
|
||||
|
||||
b. Additional offer from the Licensor -- Adapted Material.
|
||||
Every recipient of Adapted Material from You
|
||||
automatically receives an offer from the Licensor to
|
||||
exercise the Licensed Rights in the Adapted Material
|
||||
under the conditions of the Adapter's License You apply.
|
||||
|
||||
c. No downstream restrictions. You may not offer or impose
|
||||
any additional or different terms or conditions on, or
|
||||
apply any Effective Technological Measures to, the
|
||||
Licensed Material if doing so restricts exercise of the
|
||||
Licensed Rights by any recipient of the Licensed
|
||||
Material.
|
||||
|
||||
6. No endorsement. Nothing in this Public License constitutes or
|
||||
may be construed as permission to assert or imply that You
|
||||
are, or that Your use of the Licensed Material is, connected
|
||||
with, or sponsored, endorsed, or granted official status by,
|
||||
the Licensor or others designated to receive attribution as
|
||||
provided in Section 3(a)(1)(A)(i).
|
||||
|
||||
b. Other rights.
|
||||
|
||||
1. Moral rights, such as the right of integrity, are not
|
||||
licensed under this Public License, nor are publicity,
|
||||
privacy, and/or other similar personality rights; however, to
|
||||
the extent possible, the Licensor waives and/or agrees not to
|
||||
assert any such rights held by the Licensor to the limited
|
||||
extent necessary to allow You to exercise the Licensed
|
||||
Rights, but not otherwise.
|
||||
|
||||
2. Patent and trademark rights are not licensed under this
|
||||
Public License.
|
||||
|
||||
3. To the extent possible, the Licensor waives any right to
|
||||
collect royalties from You for the exercise of the Licensed
|
||||
Rights, whether directly or through a collecting society
|
||||
under any voluntary or waivable statutory or compulsory
|
||||
licensing scheme. In all other cases the Licensor expressly
|
||||
reserves any right to collect such royalties, including when
|
||||
the Licensed Material is used other than for NonCommercial
|
||||
purposes.
|
||||
|
||||
|
||||
Section 3 -- License Conditions.
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the
|
||||
following conditions.
|
||||
|
||||
a. Attribution.
|
||||
|
||||
1. If You Share the Licensed Material (including in modified
|
||||
form), You must:
|
||||
|
||||
a. retain the following if it is supplied by the Licensor
|
||||
with the Licensed Material:
|
||||
|
||||
i. identification of the creator(s) of the Licensed
|
||||
Material and any others designated to receive
|
||||
attribution, in any reasonable manner requested by
|
||||
the Licensor (including by pseudonym if
|
||||
designated);
|
||||
|
||||
ii. a copyright notice;
|
||||
|
||||
iii. a notice that refers to this Public License;
|
||||
|
||||
iv. a notice that refers to the disclaimer of
|
||||
warranties;
|
||||
|
||||
v. a URI or hyperlink to the Licensed Material to the
|
||||
extent reasonably practicable;
|
||||
|
||||
b. indicate if You modified the Licensed Material and
|
||||
retain an indication of any previous modifications; and
|
||||
|
||||
c. indicate the Licensed Material is licensed under this
|
||||
Public License, and include the text of, or the URI or
|
||||
hyperlink to, this Public License.
|
||||
|
||||
2. You may satisfy the conditions in Section 3(a)(1) in any
|
||||
reasonable manner based on the medium, means, and context in
|
||||
which You Share the Licensed Material. For example, it may be
|
||||
reasonable to satisfy the conditions by providing a URI or
|
||||
hyperlink to a resource that includes the required
|
||||
information.
|
||||
3. If requested by the Licensor, You must remove any of the
|
||||
information required by Section 3(a)(1)(A) to the extent
|
||||
reasonably practicable.
|
||||
|
||||
b. ShareAlike.
|
||||
|
||||
In addition to the conditions in Section 3(a), if You Share
|
||||
Adapted Material You produce, the following conditions also apply.
|
||||
|
||||
1. The Adapter's License You apply must be a Creative Commons
|
||||
license with the same License Elements, this version or
|
||||
later, or a BY-NC-SA Compatible License.
|
||||
|
||||
2. You must include the text of, or the URI or hyperlink to, the
|
||||
Adapter's License You apply. You may satisfy this condition
|
||||
in any reasonable manner based on the medium, means, and
|
||||
context in which You Share Adapted Material.
|
||||
|
||||
3. You may not offer or impose any additional or different terms
|
||||
or conditions on, or apply any Effective Technological
|
||||
Measures to, Adapted Material that restrict exercise of the
|
||||
rights granted under the Adapter's License You apply.
|
||||
|
||||
|
||||
Section 4 -- Sui Generis Database Rights.
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that
|
||||
apply to Your use of the Licensed Material:
|
||||
|
||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
||||
to extract, reuse, reproduce, and Share all or a substantial
|
||||
portion of the contents of the database for NonCommercial purposes
|
||||
only;
|
||||
|
||||
b. if You include all or a substantial portion of the database
|
||||
contents in a database in which You have Sui Generis Database
|
||||
Rights, then the database in which You have Sui Generis Database
|
||||
Rights (but not its individual contents) is Adapted Material,
|
||||
including for purposes of Section 3(b); and
|
||||
|
||||
c. You must comply with the conditions in Section 3(a) if You Share
|
||||
all or a substantial portion of the contents of the database.
|
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not
|
||||
replace Your obligations under this Public License where the Licensed
|
||||
Rights include other Copyright and Similar Rights.
|
||||
|
||||
|
||||
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
||||
|
||||
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
||||
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
||||
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
||||
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
||||
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
||||
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
||||
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
||||
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
||||
|
||||
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
||||
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
||||
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
||||
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
||||
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
||||
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
||||
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
||||
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
||||
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
c. The disclaimer of warranties and limitation of liability provided
|
||||
above shall be interpreted in a manner that, to the extent
|
||||
possible, most closely approximates an absolute disclaimer and
|
||||
waiver of all liability.
|
||||
|
||||
|
||||
Section 6 -- Term and Termination.
|
||||
|
||||
a. This Public License applies for the term of the Copyright and
|
||||
Similar Rights licensed here. However, if You fail to comply with
|
||||
this Public License, then Your rights under this Public License
|
||||
terminate automatically.
|
||||
|
||||
b. Where Your right to use the Licensed Material has terminated under
|
||||
Section 6(a), it reinstates:
|
||||
|
||||
1. automatically as of the date the violation is cured, provided
|
||||
it is cured within 30 days of Your discovery of the
|
||||
violation; or
|
||||
|
||||
2. upon express reinstatement by the Licensor.
|
||||
|
||||
For the avoidance of doubt, this Section 6(b) does not affect any
|
||||
right the Licensor may have to seek remedies for Your violations
|
||||
of this Public License.
|
||||
|
||||
c. For the avoidance of doubt, the Licensor may also offer the
|
||||
Licensed Material under separate terms or conditions or stop
|
||||
distributing the Licensed Material at any time; however, doing so
|
||||
will not terminate this Public License.
|
||||
|
||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
||||
License.
|
||||
|
||||
|
||||
Section 7 -- Other Terms and Conditions.
|
||||
|
||||
a. The Licensor shall not be bound by any additional or different
|
||||
terms or conditions communicated by You unless expressly agreed.
|
||||
|
||||
b. Any arrangements, understandings, or agreements regarding the
|
||||
Licensed Material not stated herein are separate from and
|
||||
independent of the terms and conditions of this Public License.
|
||||
|
||||
|
||||
Section 8 -- Interpretation.
|
||||
|
||||
a. For the avoidance of doubt, this Public License does not, and
|
||||
shall not be interpreted to, reduce, limit, restrict, or impose
|
||||
conditions on any use of the Licensed Material that could lawfully
|
||||
be made without permission under this Public License.
|
||||
|
||||
b. To the extent possible, if any provision of this Public License is
|
||||
deemed unenforceable, it shall be automatically reformed to the
|
||||
minimum extent necessary to make it enforceable. If the provision
|
||||
cannot be reformed, it shall be severed from this Public License
|
||||
without affecting the enforceability of the remaining terms and
|
||||
conditions.
|
||||
|
||||
c. No term or condition of this Public License will be waived and no
|
||||
failure to comply consented to unless expressly agreed to by the
|
||||
Licensor.
|
||||
|
||||
d. Nothing in this Public License constitutes or may be interpreted
|
||||
as a limitation upon, or waiver of, any privileges and immunities
|
||||
that apply to the Licensor or You, including from the legal
|
||||
processes of any jurisdiction or authority.
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons is not a party to its public
|
||||
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
||||
its public licenses to material it publishes and in those instances
|
||||
will be considered the “Licensor.” The text of the Creative Commons
|
||||
public licenses is dedicated to the public domain under the CC0 Public
|
||||
Domain Dedication. Except for the limited purpose of indicating that
|
||||
material is shared under a Creative Commons public license or as
|
||||
otherwise permitted by the Creative Commons policies published at
|
||||
creativecommons.org/policies, Creative Commons does not authorize the
|
||||
use of the trademark "Creative Commons" or any other trademark or logo
|
||||
of Creative Commons without its prior written consent including,
|
||||
without limitation, in connection with any unauthorized modifications
|
||||
to any of its public licenses or any other arrangements,
|
||||
understandings, or agreements concerning use of licensed material. For
|
||||
the avoidance of doubt, this paragraph does not form part of the
|
||||
public licenses.
|
||||
|
||||
Creative Commons may be contacted at creativecommons.org.
|
||||
@@ -0,0 +1,35 @@
|
||||
# Fika - Aki.Server Mod
|
||||
|
||||
[](https://discord.gg/project-fika)
|
||||
[](https://github.com/project-fika/Fika-Server/releases/latest)
|
||||

|
||||

|
||||
[](LICENSE)
|
||||
|
||||
Server-side changes to make multiplayer work.
|
||||
|
||||
## Requirements
|
||||
|
||||
- [Node 20.x](https://nodejs.org/en/download)
|
||||
|
||||
## Build
|
||||
|
||||
| **Tool** | **Action** |
|
||||
| ---------- | ------------------------------ |
|
||||
| Powershell | `npm run build` |
|
||||
| VSCode | `Terminal > Run Build Task...` |
|
||||
|
||||
## Licenses
|
||||
|
||||
[<img src="https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-sa.svg" alt="cc by-nc-sa" width="180" height="63" align="right">](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.en)
|
||||
|
||||
This project is licensed under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.en).
|
||||
|
||||
<br />
|
||||
|
||||
### Dependencies
|
||||
|
||||
| **Project** | **License** |
|
||||
| ----------- | ----------------------------------------------------------------------------- |
|
||||
| Aki.Server | [NCSA](https://dev.sp-tarkov.com/SPT-AKI/Server/src/branch/master/LICENSE.md) |
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"client": {
|
||||
"useBtr": true,
|
||||
"friendlyFire": true,
|
||||
"dynamicVExfils": false,
|
||||
"allowFreeCam": false,
|
||||
"allowItemSending": true,
|
||||
"forceSaveOnDeath": false
|
||||
},
|
||||
"server": {
|
||||
"giftedItemsLoseFIR": false,
|
||||
"launcherListAllProfiles": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"Attention! This is a Beta version of Escape from Tarkov for testing purposes.": "Welcome to Fika, the OFFLINE Coop Mod for SPT-AKI.",
|
||||
"NDA free warning": "主持/加入战局之前你必须先选择地图,之后使用服务器浏览器"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"Attention! This is a Beta version of Escape from Tarkov for testing purposes.": "Vitejte v Fika, Offline coop mod pro SPT-AKI",
|
||||
"NDA free warning": "K Hostovani / Pripojeni ke hre si musite vybrat mapu a na posledni obrazovce pouzit Server Browser"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"Attention! This is a Beta version of Escape from Tarkov for testing purposes.": "Welcome to Fika, the OFFLINE Coop Mod for SPT-AKI.",
|
||||
"NDA free warning": "To host/join a game you must select a map and go to the last screen to use the Server Browser."
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"Attention! This is a Beta version of Escape from Tarkov for testing purposes.": "Bienvenido a Fika, la modificacion cooperativa SIN CONEXION para SPT-AKI",
|
||||
"NDA free warning": "Bienvenido a Fika, la modificacion cooperativa SIN CONEXION para SPT-AKI"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"Attention! This is a Beta version of Escape from Tarkov for testing purposes.": "Bienvenue sur Fika, le mod de coopération pour SPT-AKI.",
|
||||
"NDA free warning": "Pour héberger/rejoindre une partie, vous devez sélectionner une carte et aller sur le dernier écran pour utiliser le navigateur de serveurs."
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"Attention! This is a Beta version of Escape from Tarkov for testing purposes.": "Willkommen zu Fika, dem OFFLINE Koop-Mod für SPT-AKI.",
|
||||
"NDA free warning": "Willkommen zu Fika, dem OFFLINE Koop-Mod für SPT-AKI."
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"Attention! This is a Beta version of Escape from Tarkov for testing purposes.": "SPT-AKI의 오프라인 협동 모드인 Fika에 오신 것을 환영합니다.",
|
||||
"NDA free warning": "서버를 열거나 접속하기 위해서는 지역을 선택 후 마지막 화면에서 서버 브라우저를 사용하실 수 있습니다."
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"Attention! This is a Beta version of Escape from Tarkov for testing purposes.": "Bem-vindo ao Fika, o Mod Cooperativo Offline para SPT-AKI.",
|
||||
"NDA free warning": "Para hospedares/juntares-te a um jogo tens de selecionar um mapa e ir para o último ecrã para utilizar o Navegador de Servidores."
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"Attention! This is a Beta version of Escape from Tarkov for testing purposes.": "Добро пожаловать в SPT-COOP, Кооперативный ОФФЛАЙН мод для SPT-Aki.",
|
||||
"NDA free warning": "Для того что бы играть вместе, выберите карту и используйте браузер серверов на последнем экране."
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1 @@
|
||||
{"6639e65a0000d4771c8b53fa":{"Friends":[],"Ignore":[]},"662f2baa000147643fa09232":{"Friends":[],"Ignore":[]},"6623c37000013b54ad1f47a0":{"Friends":[],"Ignore":[]},"6638f2440005685c701a1a28":{"Friends":[],"Ignore":[]},"663659d50001203285603be5":{"Friends":[],"Ignore":[]},"663b922a000575af4225f10c":{"Friends":[],"Ignore":[]},"6638e7760003fe808465d782":{"Friends":[],"Ignore":[]},"6659ec5b0004d30ea525d14f":{"Friends":[],"Ignore":[]}}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "server",
|
||||
"version": "2.1.0",
|
||||
"akiVersion": "3.8.3",
|
||||
"main": "src/mod.js",
|
||||
"scripts": {
|
||||
"setup": "npm i",
|
||||
"build": "node ./build.mjs",
|
||||
"buildinfo": "node ./build.mjs --verbose"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.7.1",
|
||||
"@types/node": "~20.11",
|
||||
"archiver": "^6.0",
|
||||
"fs-extra": "~11.2",
|
||||
"ignore": "^5.2",
|
||||
"tsyringe": "4.8.0",
|
||||
"typescript": "5.4",
|
||||
"winston": "3.12"
|
||||
},
|
||||
"author": "Fika",
|
||||
"license": "CC-BY-NC-SA-4.0"
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
var _a, _b;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Fika = void 0;
|
||||
const tsyringe_1 = require("/snapshot/project/node_modules/tsyringe");
|
||||
const DatabaseServer_1 = require("/snapshot/project/obj/servers/DatabaseServer");
|
||||
const Overrider_1 = require("./overrides/Overrider");
|
||||
let Fika = class Fika {
|
||||
databaseServer;
|
||||
overrider;
|
||||
constructor(databaseServer, overrider) {
|
||||
this.databaseServer = databaseServer;
|
||||
this.overrider = overrider;
|
||||
// empty
|
||||
}
|
||||
async preAkiLoad(container) {
|
||||
await this.overrider.override(container);
|
||||
}
|
||||
};
|
||||
exports.Fika = Fika;
|
||||
exports.Fika = Fika = __decorate([
|
||||
(0, tsyringe_1.injectable)(),
|
||||
__param(0, (0, tsyringe_1.inject)("DatabaseServer")),
|
||||
__param(1, (0, tsyringe_1.inject)("Overrider")),
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof DatabaseServer_1.DatabaseServer !== "undefined" && DatabaseServer_1.DatabaseServer) === "function" ? _a : Object, typeof (_b = typeof Overrider_1.Overrider !== "undefined" && Overrider_1.Overrider) === "function" ? _b : Object])
|
||||
], Fika);
|
||||
//# sourceMappingURL=Fika.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Fika.js","sourceRoot":"","sources":["Fika.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAAkG;AAElG,iFAA8E;AAE9E,qDAAkD;AAG3C,IAAM,IAAI,GAAV,MAAM,IAAI;IAE2B;IACL;IAFnC,YACwC,cAA8B,EACnC,SAAoB;QADf,mBAAc,GAAd,cAAc,CAAgB;QACnC,cAAS,GAAT,SAAS,CAAW;QAEnD,QAAQ;IACZ,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,SAA8B;QAClD,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;CACJ,CAAA;AAXY,oBAAI;eAAJ,IAAI;IADhB,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,gBAAgB,CAAC,CAAA;IACxB,WAAA,IAAA,iBAAM,EAAC,WAAW,CAAC,CAAA;yDADgC,+BAAc,oBAAd,+BAAc,oDACxB,qBAAS,oBAAT,qBAAS;GAH9C,IAAI,CAWhB"}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { DependencyContainer, inject, injectable } from "tsyringe";
|
||||
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
|
||||
import { Overrider } from "./overrides/Overrider";
|
||||
|
||||
@injectable()
|
||||
export class Fika {
|
||||
constructor(
|
||||
@inject("DatabaseServer") protected databaseServer: DatabaseServer,
|
||||
@inject("Overrider") protected overrider: Overrider,
|
||||
) {
|
||||
// empty
|
||||
}
|
||||
|
||||
public async preAkiLoad(container: DependencyContainer): Promise<void> {
|
||||
await this.overrider.override(container);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
var _a, _b;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FikaClientCallbacks = void 0;
|
||||
const tsyringe_1 = require("/snapshot/project/node_modules/tsyringe");
|
||||
const HttpResponseUtil_1 = require("/snapshot/project/obj/utils/HttpResponseUtil");
|
||||
const FikaClientController_1 = require("../controllers/FikaClientController");
|
||||
let FikaClientCallbacks = class FikaClientCallbacks {
|
||||
httpResponseUtil;
|
||||
fikaClientController;
|
||||
constructor(httpResponseUtil, fikaClientController) {
|
||||
this.httpResponseUtil = httpResponseUtil;
|
||||
this.fikaClientController = fikaClientController;
|
||||
// empty
|
||||
}
|
||||
/** Handle /fika/client/config */
|
||||
handleClientConfig(_url, _info, _sessionID) {
|
||||
return this.httpResponseUtil.noBody(this.fikaClientController.handleClientConfig());
|
||||
}
|
||||
};
|
||||
exports.FikaClientCallbacks = FikaClientCallbacks;
|
||||
exports.FikaClientCallbacks = FikaClientCallbacks = __decorate([
|
||||
(0, tsyringe_1.injectable)(),
|
||||
__param(0, (0, tsyringe_1.inject)("HttpResponseUtil")),
|
||||
__param(1, (0, tsyringe_1.inject)("FikaClientController")),
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof HttpResponseUtil_1.HttpResponseUtil !== "undefined" && HttpResponseUtil_1.HttpResponseUtil) === "function" ? _a : Object, typeof (_b = typeof FikaClientController_1.FikaClientController !== "undefined" && FikaClientController_1.FikaClientController) === "function" ? _b : Object])
|
||||
], FikaClientCallbacks);
|
||||
//# sourceMappingURL=FikaClientCallbacks.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FikaClientCallbacks.js","sourceRoot":"","sources":["FikaClientCallbacks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAA6E;AAE7E,mFAAgF;AAEhF,8EAA2E;AAIpE,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAEc;IACI;IAF9C,YAC0C,gBAAkC,EAC9B,oBAA0C;QAD9C,qBAAgB,GAAhB,gBAAgB,CAAkB;QAC9B,yBAAoB,GAApB,oBAAoB,CAAsB;QAEpF,QAAQ;IACZ,CAAC;IAED,iCAAiC;IAC1B,kBAAkB,CAAC,IAAY,EAAE,KAAmC,EAAE,UAAkB;QAC3F,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACxF,CAAC;CACJ,CAAA;AAZY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,kBAAkB,CAAC,CAAA;IAC1B,WAAA,IAAA,iBAAM,EAAC,sBAAsB,CAAC,CAAA;yDADyB,mCAAgB,oBAAhB,mCAAgB,oDACR,2CAAoB,oBAApB,2CAAoB;GAH/E,mBAAmB,CAY/B"}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { inject, injectable } from "tsyringe";
|
||||
|
||||
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||
|
||||
import { FikaClientController } from "../controllers/FikaClientController";
|
||||
import { IFikaRaidServerIdRequestData } from "../models/fika/routes/raid/IFikaRaidServerIdRequestData";
|
||||
|
||||
@injectable()
|
||||
export class FikaClientCallbacks {
|
||||
constructor(
|
||||
@inject("HttpResponseUtil") protected httpResponseUtil: HttpResponseUtil,
|
||||
@inject("FikaClientController") protected fikaClientController: FikaClientController,
|
||||
) {
|
||||
// empty
|
||||
}
|
||||
|
||||
/** Handle /fika/client/config */
|
||||
public handleClientConfig(_url: string, _info: IFikaRaidServerIdRequestData, _sessionID: string): string {
|
||||
return this.httpResponseUtil.noBody(this.fikaClientController.handleClientConfig());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
var _a, _b;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FikaLocationCallbacks = void 0;
|
||||
const tsyringe_1 = require("/snapshot/project/node_modules/tsyringe");
|
||||
const HttpResponseUtil_1 = require("/snapshot/project/obj/utils/HttpResponseUtil");
|
||||
const FikaLocationController_1 = require("../controllers/FikaLocationController");
|
||||
let FikaLocationCallbacks = class FikaLocationCallbacks {
|
||||
httpResponseUtil;
|
||||
fikaLocationController;
|
||||
constructor(httpResponseUtil, fikaLocationController) {
|
||||
this.httpResponseUtil = httpResponseUtil;
|
||||
this.fikaLocationController = fikaLocationController;
|
||||
// empty
|
||||
}
|
||||
/** Handle /fika/location/raids */
|
||||
handleGetRaids(_url, info, _sessionID) {
|
||||
return this.httpResponseUtil.noBody(this.fikaLocationController.handleGetRaids(info));
|
||||
}
|
||||
};
|
||||
exports.FikaLocationCallbacks = FikaLocationCallbacks;
|
||||
exports.FikaLocationCallbacks = FikaLocationCallbacks = __decorate([
|
||||
(0, tsyringe_1.injectable)(),
|
||||
__param(0, (0, tsyringe_1.inject)("HttpResponseUtil")),
|
||||
__param(1, (0, tsyringe_1.inject)("FikaLocationController")),
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof HttpResponseUtil_1.HttpResponseUtil !== "undefined" && HttpResponseUtil_1.HttpResponseUtil) === "function" ? _a : Object, typeof (_b = typeof FikaLocationController_1.FikaLocationController !== "undefined" && FikaLocationController_1.FikaLocationController) === "function" ? _b : Object])
|
||||
], FikaLocationCallbacks);
|
||||
//# sourceMappingURL=FikaLocationCallbacks.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FikaLocationCallbacks.js","sourceRoot":"","sources":["FikaLocationCallbacks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAA6E;AAG7E,mFAAgF;AAEhF,kFAA+E;AAGxE,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAEY;IACM;IAFhD,YAC0C,gBAAkC,EAC5B,sBAA8C;QADpD,qBAAgB,GAAhB,gBAAgB,CAAkB;QAC5B,2BAAsB,GAAtB,sBAAsB,CAAwB;QAE1F,QAAQ;IACZ,CAAC;IAED,kCAAkC;IAC3B,cAAc,CAAC,IAAY,EAAE,IAAsC,EAAE,UAAkB;QAC1F,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1F,CAAC;CACJ,CAAA;AAZY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,kBAAkB,CAAC,CAAA;IAC1B,WAAA,IAAA,iBAAM,EAAC,wBAAwB,CAAC,CAAA;yDADuB,mCAAgB,oBAAhB,mCAAgB,oDACJ,+CAAsB,oBAAtB,+CAAsB;GAHrF,qBAAqB,CAYjC"}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { inject, injectable } from "tsyringe";
|
||||
|
||||
import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData";
|
||||
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||
|
||||
import { FikaLocationController } from "../controllers/FikaLocationController";
|
||||
|
||||
@injectable()
|
||||
export class FikaLocationCallbacks {
|
||||
constructor(
|
||||
@inject("HttpResponseUtil") protected httpResponseUtil: HttpResponseUtil,
|
||||
@inject("FikaLocationController") protected fikaLocationController: FikaLocationController,
|
||||
) {
|
||||
// empty
|
||||
}
|
||||
|
||||
/** Handle /fika/location/raids */
|
||||
public handleGetRaids(_url: string, info: IGetRaidConfigurationRequestData, _sessionID: string): string {
|
||||
return this.httpResponseUtil.noBody(this.fikaLocationController.handleGetRaids(info));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
var _a, _b;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FikaRaidCallbacks = void 0;
|
||||
const tsyringe_1 = require("/snapshot/project/node_modules/tsyringe");
|
||||
const HttpResponseUtil_1 = require("/snapshot/project/obj/utils/HttpResponseUtil");
|
||||
const FikaRaidController_1 = require("../controllers/FikaRaidController");
|
||||
let FikaRaidCallbacks = class FikaRaidCallbacks {
|
||||
httpResponseUtil;
|
||||
fikaRaidController;
|
||||
constructor(httpResponseUtil, fikaRaidController) {
|
||||
this.httpResponseUtil = httpResponseUtil;
|
||||
this.fikaRaidController = fikaRaidController;
|
||||
// empty
|
||||
}
|
||||
/** Handle /fika/raid/create */
|
||||
handleRaidCreate(_url, info, _sessionID) {
|
||||
return this.httpResponseUtil.noBody(this.fikaRaidController.handleRaidCreate(info));
|
||||
}
|
||||
/** Handle /fika/raid/join */
|
||||
handleRaidJoin(_url, info, _sessionID) {
|
||||
return this.httpResponseUtil.noBody(this.fikaRaidController.handleRaidJoin(info));
|
||||
}
|
||||
/** Handle /fika/raid/leave */
|
||||
handleRaidLeave(_url, info, _sessionID) {
|
||||
this.fikaRaidController.handleRaidLeave(info);
|
||||
return this.httpResponseUtil.nullResponse();
|
||||
}
|
||||
/** Handle /fika/raid/gethost */
|
||||
handleRaidGethost(_url, info, _sessionID) {
|
||||
return this.httpResponseUtil.noBody(this.fikaRaidController.handleRaidGethost(info));
|
||||
}
|
||||
/** Handle /fika/raid/spawnpoint */
|
||||
handleRaidSpawnpoint(_url, info, _sessionID) {
|
||||
return this.httpResponseUtil.noBody(this.fikaRaidController.handleRaidSpawnpoint(info));
|
||||
}
|
||||
/** Handle /fika/raid/getsettings */
|
||||
handleRaidGetSettings(_url, info, _sessionID) {
|
||||
return this.httpResponseUtil.noBody(this.fikaRaidController.handleRaidGetSettings(info));
|
||||
}
|
||||
};
|
||||
exports.FikaRaidCallbacks = FikaRaidCallbacks;
|
||||
exports.FikaRaidCallbacks = FikaRaidCallbacks = __decorate([
|
||||
(0, tsyringe_1.injectable)(),
|
||||
__param(0, (0, tsyringe_1.inject)("HttpResponseUtil")),
|
||||
__param(1, (0, tsyringe_1.inject)("FikaRaidController")),
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof HttpResponseUtil_1.HttpResponseUtil !== "undefined" && HttpResponseUtil_1.HttpResponseUtil) === "function" ? _a : Object, typeof (_b = typeof FikaRaidController_1.FikaRaidController !== "undefined" && FikaRaidController_1.FikaRaidController) === "function" ? _b : Object])
|
||||
], FikaRaidCallbacks);
|
||||
//# sourceMappingURL=FikaRaidCallbacks.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FikaRaidCallbacks.js","sourceRoot":"","sources":["FikaRaidCallbacks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAA6E;AAG7E,mFAAgF;AAEhF,0EAAuE;AAOhE,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEgB;IACE;IAF5C,YAC0C,gBAAkC,EAChC,kBAAsC;QADxC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAChC,uBAAkB,GAAlB,kBAAkB,CAAoB;QAE9E,QAAQ;IACZ,CAAC;IAED,+BAA+B;IACxB,gBAAgB,CAAC,IAAY,EAAE,IAAgC,EAAE,UAAkB;QACtF,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;IACxF,CAAC;IAED,6BAA6B;IACtB,cAAc,CAAC,IAAY,EAAE,IAA8B,EAAE,UAAkB;QAClF,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;IACtF,CAAC;IAED,8BAA8B;IACvB,eAAe,CAAC,IAAY,EAAE,IAA+B,EAAE,UAAkB;QACpF,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAE9C,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;IAChD,CAAC;IAED,gCAAgC;IACzB,iBAAiB,CAAC,IAAY,EAAE,IAAkC,EAAE,UAAkB;QACzF,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;IACzF,CAAC;IAED,mCAAmC;IAC5B,oBAAoB,CAAC,IAAY,EAAE,IAAkC,EAAE,UAAkB;QAC5F,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5F,CAAC;IAED,oCAAoC;IAC7B,qBAAqB,CAAC,IAAY,EAAE,IAAkC,EAAE,UAAkB;QAC7F,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7F,CAAC;CACJ,CAAA;AAvCY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,kBAAkB,CAAC,CAAA;IAC1B,WAAA,IAAA,iBAAM,EAAC,oBAAoB,CAAC,CAAA;yDAD2B,mCAAgB,oBAAhB,mCAAgB,oDACZ,uCAAkB,oBAAlB,uCAAkB;GAHzE,iBAAiB,CAuC7B"}
|
||||
@@ -0,0 +1,52 @@
|
||||
import { inject, injectable } from "tsyringe";
|
||||
|
||||
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
|
||||
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||
|
||||
import { FikaRaidController } from "../controllers/FikaRaidController";
|
||||
import { IFikaRaidServerIdRequestData } from "../models/fika/routes/raid/IFikaRaidServerIdRequestData";
|
||||
import { IFikaRaidCreateRequestData } from "../models/fika/routes/raid/create/IFikaRaidCreateRequestData";
|
||||
import { IFikaRaidJoinRequestData } from "../models/fika/routes/raid/join/IFikaRaidJoinRequestData";
|
||||
import { IFikaRaidLeaveRequestData } from "../models/fika/routes/raid/leave/IFikaRaidLeaveRequestData";
|
||||
|
||||
@injectable()
|
||||
export class FikaRaidCallbacks {
|
||||
constructor(
|
||||
@inject("HttpResponseUtil") protected httpResponseUtil: HttpResponseUtil,
|
||||
@inject("FikaRaidController") protected fikaRaidController: FikaRaidController,
|
||||
) {
|
||||
// empty
|
||||
}
|
||||
|
||||
/** Handle /fika/raid/create */
|
||||
public handleRaidCreate(_url: string, info: IFikaRaidCreateRequestData, _sessionID: string): string {
|
||||
return this.httpResponseUtil.noBody(this.fikaRaidController.handleRaidCreate(info));
|
||||
}
|
||||
|
||||
/** Handle /fika/raid/join */
|
||||
public handleRaidJoin(_url: string, info: IFikaRaidJoinRequestData, _sessionID: string): string {
|
||||
return this.httpResponseUtil.noBody(this.fikaRaidController.handleRaidJoin(info));
|
||||
}
|
||||
|
||||
/** Handle /fika/raid/leave */
|
||||
public handleRaidLeave(_url: string, info: IFikaRaidLeaveRequestData, _sessionID: string): INullResponseData {
|
||||
this.fikaRaidController.handleRaidLeave(info);
|
||||
|
||||
return this.httpResponseUtil.nullResponse();
|
||||
}
|
||||
|
||||
/** Handle /fika/raid/gethost */
|
||||
public handleRaidGethost(_url: string, info: IFikaRaidServerIdRequestData, _sessionID: string): string {
|
||||
return this.httpResponseUtil.noBody(this.fikaRaidController.handleRaidGethost(info));
|
||||
}
|
||||
|
||||
/** Handle /fika/raid/spawnpoint */
|
||||
public handleRaidSpawnpoint(_url: string, info: IFikaRaidServerIdRequestData, _sessionID: string): string {
|
||||
return this.httpResponseUtil.noBody(this.fikaRaidController.handleRaidSpawnpoint(info));
|
||||
}
|
||||
|
||||
/** Handle /fika/raid/getsettings */
|
||||
public handleRaidGetSettings(_url: string, info: IFikaRaidServerIdRequestData, _sessionID: string): string {
|
||||
return this.httpResponseUtil.noBody(this.fikaRaidController.handleRaidGetSettings(info));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
var _a, _b;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FikaSendItemCallbacks = void 0;
|
||||
const tsyringe_1 = require("/snapshot/project/node_modules/tsyringe");
|
||||
const HttpResponseUtil_1 = require("/snapshot/project/obj/utils/HttpResponseUtil");
|
||||
const FikaSendItemController_1 = require("../controllers/FikaSendItemController");
|
||||
let FikaSendItemCallbacks = class FikaSendItemCallbacks {
|
||||
httpResponseUtil;
|
||||
fikaSendItemController;
|
||||
constructor(httpResponseUtil, fikaSendItemController) {
|
||||
this.httpResponseUtil = httpResponseUtil;
|
||||
this.fikaSendItemController = fikaSendItemController;
|
||||
// empty
|
||||
}
|
||||
handleSendItem(pmcData, body, sessionID) {
|
||||
return this.fikaSendItemController.sendItem(pmcData, body, sessionID);
|
||||
}
|
||||
/** Handle /fika/senditem/availablereceivers */
|
||||
handleAvailableReceivers(_url, _info, sessionID) {
|
||||
return this.httpResponseUtil.noBody(this.fikaSendItemController.handleAvailableReceivers(sessionID));
|
||||
}
|
||||
};
|
||||
exports.FikaSendItemCallbacks = FikaSendItemCallbacks;
|
||||
exports.FikaSendItemCallbacks = FikaSendItemCallbacks = __decorate([
|
||||
(0, tsyringe_1.injectable)(),
|
||||
__param(0, (0, tsyringe_1.inject)("HttpResponseUtil")),
|
||||
__param(1, (0, tsyringe_1.inject)("FikaSendItemController")),
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof HttpResponseUtil_1.HttpResponseUtil !== "undefined" && HttpResponseUtil_1.HttpResponseUtil) === "function" ? _a : Object, typeof (_b = typeof FikaSendItemController_1.FikaSendItemController !== "undefined" && FikaSendItemController_1.FikaSendItemController) === "function" ? _b : Object])
|
||||
], FikaSendItemCallbacks);
|
||||
//# sourceMappingURL=FikaSendItemCallbacks.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FikaSendItemCallbacks.js","sourceRoot":"","sources":["FikaSendItemCallbacks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAA6E;AAI7E,mFAAgF;AAEhF,kFAA+E;AAKxE,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAEY;IACM;IAFhD,YAC0C,gBAAkC,EAC5B,sBAA8C;QADpD,qBAAgB,GAAhB,gBAAgB,CAAkB;QAC5B,2BAAsB,GAAtB,sBAAsB,CAAwB;QAE1F,QAAQ;IACZ,CAAC;IAEM,cAAc,CAAC,OAAiB,EAAE,IAA8B,EAAE,SAAiB;QACtF,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;IAC1E,CAAC;IAED,+CAA+C;IACxC,wBAAwB,CAAC,IAAY,EAAE,KAAiD,EAAE,SAAiB;QAC9G,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC,CAAC;IACzG,CAAC;CACJ,CAAA;AAhBY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,kBAAkB,CAAC,CAAA;IAC1B,WAAA,IAAA,iBAAM,EAAC,wBAAwB,CAAC,CAAA;yDADuB,mCAAgB,oBAAhB,mCAAgB,oDACJ,+CAAsB,oBAAtB,+CAAsB;GAHrF,qBAAqB,CAgBjC"}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { inject, injectable } from "tsyringe";
|
||||
|
||||
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||
|
||||
import { FikaSendItemController } from "../controllers/FikaSendItemController";
|
||||
import { IFikaSendItemRequestData } from "../models/fika/routes/senditem/IFikaSendItemRequestData";
|
||||
import { IFikaSenditemAvailablereceiversRequestData } from "../models/fika/routes/senditem/availablereceivers/IFikaSenditemAvailablereceiversRequestData";
|
||||
|
||||
@injectable()
|
||||
export class FikaSendItemCallbacks {
|
||||
constructor(
|
||||
@inject("HttpResponseUtil") protected httpResponseUtil: HttpResponseUtil,
|
||||
@inject("FikaSendItemController") protected fikaSendItemController: FikaSendItemController,
|
||||
) {
|
||||
// empty
|
||||
}
|
||||
|
||||
public handleSendItem(pmcData: IPmcData, body: IFikaSendItemRequestData, sessionID: string): IItemEventRouterResponse {
|
||||
return this.fikaSendItemController.sendItem(pmcData, body, sessionID);
|
||||
}
|
||||
|
||||
/** Handle /fika/senditem/availablereceivers */
|
||||
public handleAvailableReceivers(_url: string, _info: IFikaSenditemAvailablereceiversRequestData, sessionID: string): string {
|
||||
return this.httpResponseUtil.noBody(this.fikaSendItemController.handleAvailableReceivers(sessionID));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
var _a, _b;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FikaUpdateCallbacks = void 0;
|
||||
const tsyringe_1 = require("/snapshot/project/node_modules/tsyringe");
|
||||
const HttpResponseUtil_1 = require("/snapshot/project/obj/utils/HttpResponseUtil");
|
||||
const FikaUpdateController_1 = require("../controllers/FikaUpdateController");
|
||||
let FikaUpdateCallbacks = class FikaUpdateCallbacks {
|
||||
httpResponseUtil;
|
||||
fikaUpdateController;
|
||||
constructor(httpResponseUtil, fikaUpdateController) {
|
||||
this.httpResponseUtil = httpResponseUtil;
|
||||
this.fikaUpdateController = fikaUpdateController;
|
||||
// empty
|
||||
}
|
||||
/** Handle /fika/update/ping */
|
||||
handlePing(_url, info, _sessionID) {
|
||||
this.fikaUpdateController.handlePing(info);
|
||||
return this.httpResponseUtil.nullResponse();
|
||||
}
|
||||
/** Handle /fika/update/spawnpoint */
|
||||
handleSpawnpoint(_url, info, _sessionID) {
|
||||
this.fikaUpdateController.handleSpawnpoint(info);
|
||||
return this.httpResponseUtil.nullResponse();
|
||||
}
|
||||
/** Handle /fika/update/playerspawn */
|
||||
handlePlayerspawn(_url, info, _sessionID) {
|
||||
this.fikaUpdateController.handlePlayerspawn(info);
|
||||
return this.httpResponseUtil.nullResponse();
|
||||
}
|
||||
/** Handle /fika/update/sethost */
|
||||
handleSethost(_url, info, _sessionID) {
|
||||
this.fikaUpdateController.handleSethost(info);
|
||||
return this.httpResponseUtil.nullResponse();
|
||||
}
|
||||
/** Handle /fika/update/setstatus */
|
||||
handleSetStatus(_url, info, _sessionID) {
|
||||
this.fikaUpdateController.handleSetStatus(info);
|
||||
return this.httpResponseUtil.nullResponse();
|
||||
}
|
||||
};
|
||||
exports.FikaUpdateCallbacks = FikaUpdateCallbacks;
|
||||
exports.FikaUpdateCallbacks = FikaUpdateCallbacks = __decorate([
|
||||
(0, tsyringe_1.injectable)(),
|
||||
__param(0, (0, tsyringe_1.inject)("HttpResponseUtil")),
|
||||
__param(1, (0, tsyringe_1.inject)("FikaUpdateController")),
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof HttpResponseUtil_1.HttpResponseUtil !== "undefined" && HttpResponseUtil_1.HttpResponseUtil) === "function" ? _a : Object, typeof (_b = typeof FikaUpdateController_1.FikaUpdateController !== "undefined" && FikaUpdateController_1.FikaUpdateController) === "function" ? _b : Object])
|
||||
], FikaUpdateCallbacks);
|
||||
//# sourceMappingURL=FikaUpdateCallbacks.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FikaUpdateCallbacks.js","sourceRoot":"","sources":["FikaUpdateCallbacks.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAA6E;AAG7E,mFAAgF;AAEhF,8EAA2E;AAQpE,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAEc;IACI;IAF9C,YAC0C,gBAAkC,EAC9B,oBAA0C;QAD9C,qBAAgB,GAAhB,gBAAgB,CAAkB;QAC9B,yBAAoB,GAApB,oBAAoB,CAAsB;QAEpF,QAAQ;IACZ,CAAC;IAED,+BAA+B;IACxB,UAAU,CAAC,IAAY,EAAE,IAAgC,EAAE,UAAkB;QAChF,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAE3C,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;IAChD,CAAC;IAED,qCAAqC;IAC9B,gBAAgB,CAAC,IAAY,EAAE,IAAsC,EAAE,UAAkB;QAC5F,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAEjD,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;IAChD,CAAC;IAED,sCAAsC;IAC/B,iBAAiB,CAAC,IAAY,EAAE,IAAuC,EAAE,UAAkB;QAC9F,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAElD,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;IAChD,CAAC;IAED,kCAAkC;IAC3B,aAAa,CAAC,IAAY,EAAE,IAAmC,EAAE,UAAkB;QACtF,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAE9C,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;IAChD,CAAC;IAED,oCAAoC;IAC7B,eAAe,CAAC,IAAY,EAAE,IAAqC,EAAE,UAAkB;QAC1F,IAAI,CAAC,oBAAoB,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAEhD,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;IAChD,CAAC;CACJ,CAAA;AA1CY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,kBAAkB,CAAC,CAAA;IAC1B,WAAA,IAAA,iBAAM,EAAC,sBAAsB,CAAC,CAAA;yDADyB,mCAAgB,oBAAhB,mCAAgB,oDACR,2CAAoB,oBAApB,2CAAoB;GAH/E,mBAAmB,CA0C/B"}
|
||||
@@ -0,0 +1,56 @@
|
||||
import { inject, injectable } from "tsyringe";
|
||||
|
||||
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
|
||||
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||
|
||||
import { FikaUpdateController } from "../controllers/FikaUpdateController";
|
||||
import { IFikaUpdatePingRequestData } from "../models/fika/routes/update/IFikaUpdatePingRequestData";
|
||||
import { IFikaUpdatePlayerspawnRequestData } from "../models/fika/routes/update/IFikaUpdatePlayerspawnRequestData";
|
||||
import { IFikaUpdateSetStatusRequestData } from "../models/fika/routes/update/IFikaUpdateSetStatusRequestData";
|
||||
import { IFikaUpdateSethostRequestData } from "../models/fika/routes/update/IFikaUpdateSethostRequestData";
|
||||
import { IFikaUpdateSpawnpointRequestData } from "../models/fika/routes/update/IFikaUpdateSpawnpointRequestData";
|
||||
|
||||
@injectable()
|
||||
export class FikaUpdateCallbacks {
|
||||
constructor(
|
||||
@inject("HttpResponseUtil") protected httpResponseUtil: HttpResponseUtil,
|
||||
@inject("FikaUpdateController") protected fikaUpdateController: FikaUpdateController,
|
||||
) {
|
||||
// empty
|
||||
}
|
||||
|
||||
/** Handle /fika/update/ping */
|
||||
public handlePing(_url: string, info: IFikaUpdatePingRequestData, _sessionID: string): INullResponseData {
|
||||
this.fikaUpdateController.handlePing(info);
|
||||
|
||||
return this.httpResponseUtil.nullResponse();
|
||||
}
|
||||
|
||||
/** Handle /fika/update/spawnpoint */
|
||||
public handleSpawnpoint(_url: string, info: IFikaUpdateSpawnpointRequestData, _sessionID: string): INullResponseData {
|
||||
this.fikaUpdateController.handleSpawnpoint(info);
|
||||
|
||||
return this.httpResponseUtil.nullResponse();
|
||||
}
|
||||
|
||||
/** Handle /fika/update/playerspawn */
|
||||
public handlePlayerspawn(_url: string, info: IFikaUpdatePlayerspawnRequestData, _sessionID: string): INullResponseData {
|
||||
this.fikaUpdateController.handlePlayerspawn(info);
|
||||
|
||||
return this.httpResponseUtil.nullResponse();
|
||||
}
|
||||
|
||||
/** Handle /fika/update/sethost */
|
||||
public handleSethost(_url: string, info: IFikaUpdateSethostRequestData, _sessionID: string): INullResponseData {
|
||||
this.fikaUpdateController.handleSethost(info);
|
||||
|
||||
return this.httpResponseUtil.nullResponse();
|
||||
}
|
||||
|
||||
/** Handle /fika/update/setstatus */
|
||||
public handleSetStatus(_url: string, info: IFikaUpdateSetStatusRequestData, _sessionID: string): INullResponseData {
|
||||
this.fikaUpdateController.handleSetStatus(info);
|
||||
|
||||
return this.httpResponseUtil.nullResponse();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FikaClientController = void 0;
|
||||
const tsyringe_1 = require("/snapshot/project/node_modules/tsyringe");
|
||||
const FikaConfig_1 = require("../utils/FikaConfig");
|
||||
let FikaClientController = class FikaClientController {
|
||||
fikaConfig;
|
||||
constructor(fikaConfig) {
|
||||
this.fikaConfig = fikaConfig;
|
||||
// empty
|
||||
}
|
||||
/**
|
||||
* Handle /fika/client/config
|
||||
*/
|
||||
handleClientConfig() {
|
||||
return this.fikaConfig.getConfig().client;
|
||||
}
|
||||
};
|
||||
exports.FikaClientController = FikaClientController;
|
||||
exports.FikaClientController = FikaClientController = __decorate([
|
||||
(0, tsyringe_1.injectable)(),
|
||||
__param(0, (0, tsyringe_1.inject)("FikaConfig")),
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof FikaConfig_1.FikaConfig !== "undefined" && FikaConfig_1.FikaConfig) === "function" ? _a : Object])
|
||||
], FikaClientController);
|
||||
//# sourceMappingURL=FikaClientController.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FikaClientController.js","sourceRoot":"","sources":["FikaClientController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAA6E;AAI7E,oDAAiD;AAG1C,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IACe;IAA5C,YAA4C,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAC9D,QAAQ;IACZ,CAAC;IAED;;OAEG;IACI,kBAAkB;QACrB,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC;IAC9C,CAAC;CACJ,CAAA;AAXY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,qBAAU,GAAE;IAEI,WAAA,IAAA,iBAAM,EAAC,YAAY,CAAC,CAAA;yDAAuB,uBAAU,oBAAV,uBAAU;GADzD,oBAAoB,CAWhC"}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { inject, injectable } from "tsyringe";
|
||||
|
||||
import { IFikaConfigClient } from "../models/fika/config/IFikaConfigClient";
|
||||
|
||||
import { FikaConfig } from "../utils/FikaConfig";
|
||||
|
||||
@injectable()
|
||||
export class FikaClientController {
|
||||
constructor(@inject("FikaConfig") protected fikaConfig: FikaConfig) {
|
||||
// empty
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle /fika/client/config
|
||||
*/
|
||||
public handleClientConfig(): IFikaConfigClient {
|
||||
return this.fikaConfig.getConfig().client;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
var _a, _b, _c;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FikaDialogueController = void 0;
|
||||
const tsyringe_1 = require("/snapshot/project/node_modules/tsyringe");
|
||||
const ProfileHelper_1 = require("/snapshot/project/obj/helpers/ProfileHelper");
|
||||
const BackendErrorCodes_1 = require("/snapshot/project/obj/models/enums/BackendErrorCodes");
|
||||
const FikaFriendRequestsHelper_1 = require("../helpers/FikaFriendRequestsHelper");
|
||||
const FikaPlayerRelationsHelper_1 = require("../helpers/FikaPlayerRelationsHelper");
|
||||
let FikaDialogueController = class FikaDialogueController {
|
||||
dialogueChatBots;
|
||||
profileHelper;
|
||||
fikaFriendRequestsHelper;
|
||||
fikaPlayerRelationsHelper;
|
||||
constructor(dialogueChatBots, profileHelper, fikaFriendRequestsHelper, fikaPlayerRelationsHelper) {
|
||||
this.dialogueChatBots = dialogueChatBots;
|
||||
this.profileHelper = profileHelper;
|
||||
this.fikaFriendRequestsHelper = fikaFriendRequestsHelper;
|
||||
this.fikaPlayerRelationsHelper = fikaPlayerRelationsHelper;
|
||||
// empty
|
||||
}
|
||||
getFriendList(sessionID) {
|
||||
const botsAndFriends = this.dialogueChatBots.map((v) => v.getChatBot());
|
||||
const friendsIds = this.fikaPlayerRelationsHelper.getFriendsList(sessionID);
|
||||
for (const friendId of friendsIds) {
|
||||
const profile = this.profileHelper.getPmcProfile(friendId);
|
||||
botsAndFriends.push({
|
||||
_id: profile._id,
|
||||
aid: profile.aid,
|
||||
Info: {
|
||||
Nickname: profile.Info.Nickname,
|
||||
Level: profile.Info.Level,
|
||||
Side: profile.Info.Side,
|
||||
MemberCategory: profile.Info.MemberCategory,
|
||||
},
|
||||
});
|
||||
}
|
||||
return {
|
||||
Friends: botsAndFriends,
|
||||
Ignore: this.fikaPlayerRelationsHelper.getIgnoreList(sessionID),
|
||||
InIgnoreList: this.fikaPlayerRelationsHelper.getInIgnoreList(sessionID),
|
||||
};
|
||||
}
|
||||
listOutbox(sessionID) {
|
||||
const sentFriendRequests = this.fikaFriendRequestsHelper.getSentFriendRequests(sessionID);
|
||||
for (const sentFriendRequest of sentFriendRequests) {
|
||||
const profile = this.profileHelper.getPmcProfile(sentFriendRequest.to);
|
||||
sentFriendRequest.profile = {
|
||||
_id: profile._id,
|
||||
aid: profile.aid,
|
||||
Info: {
|
||||
Nickname: profile.Info.Nickname,
|
||||
Side: profile.Info.Side,
|
||||
Level: profile.Info.Level,
|
||||
MemberCategory: profile.Info.MemberCategory,
|
||||
},
|
||||
};
|
||||
}
|
||||
return sentFriendRequests;
|
||||
}
|
||||
listInbox(sessionID) {
|
||||
const receivedFriendRequests = this.fikaFriendRequestsHelper.getReceivedFriendRequests(sessionID);
|
||||
for (const receivedFriendRequest of receivedFriendRequests) {
|
||||
const profile = this.profileHelper.getPmcProfile(receivedFriendRequest.from);
|
||||
receivedFriendRequest.profile = {
|
||||
_id: profile._id,
|
||||
aid: profile.aid,
|
||||
Info: {
|
||||
Nickname: profile.Info.Nickname,
|
||||
Side: profile.Info.Side,
|
||||
Level: profile.Info.Level,
|
||||
MemberCategory: profile.Info.MemberCategory,
|
||||
},
|
||||
};
|
||||
}
|
||||
return receivedFriendRequests;
|
||||
}
|
||||
sendFriendRequest(from, to) {
|
||||
this.fikaFriendRequestsHelper.addFriendRequest(from, to);
|
||||
return {
|
||||
status: BackendErrorCodes_1.BackendErrorCodes.NONE,
|
||||
requestId: from,
|
||||
retryAfter: 0,
|
||||
};
|
||||
}
|
||||
acceptAllFriendRequests(sessionID) {
|
||||
const receivedFriendRequests = this.fikaFriendRequestsHelper.getReceivedFriendRequests(sessionID);
|
||||
for (const friendRequest of receivedFriendRequests) {
|
||||
this.acceptFriendRequest(friendRequest.from, friendRequest.to);
|
||||
}
|
||||
}
|
||||
acceptFriendRequest(from, to) {
|
||||
this.fikaFriendRequestsHelper.removeFriendRequest(from, to);
|
||||
this.fikaPlayerRelationsHelper.addFriend(from, to);
|
||||
}
|
||||
cancelFriendRequest(from, to) {
|
||||
this.fikaFriendRequestsHelper.removeFriendRequest(from, to);
|
||||
}
|
||||
declineFriendRequest(from, to) {
|
||||
this.cancelFriendRequest(from, to);
|
||||
}
|
||||
deleteFriend(fromId, friendId) {
|
||||
this.fikaPlayerRelationsHelper.removeFriend(fromId, friendId);
|
||||
}
|
||||
ignoreFriend(fromId, friendId) {
|
||||
this.fikaPlayerRelationsHelper.addToIgnoreList(fromId, friendId);
|
||||
}
|
||||
unIgnoreFriend(fromId, friendId) {
|
||||
this.fikaPlayerRelationsHelper.removeFromIgnoreList(fromId, friendId);
|
||||
}
|
||||
};
|
||||
exports.FikaDialogueController = FikaDialogueController;
|
||||
exports.FikaDialogueController = FikaDialogueController = __decorate([
|
||||
(0, tsyringe_1.injectable)(),
|
||||
__param(0, (0, tsyringe_1.injectAll)("DialogueChatBot")),
|
||||
__param(1, (0, tsyringe_1.inject)("ProfileHelper")),
|
||||
__param(2, (0, tsyringe_1.inject)("FikaFriendRequestsHelper")),
|
||||
__param(3, (0, tsyringe_1.inject)("FikaPlayerRelationsHelper")),
|
||||
__metadata("design:paramtypes", [Array, typeof (_a = typeof ProfileHelper_1.ProfileHelper !== "undefined" && ProfileHelper_1.ProfileHelper) === "function" ? _a : Object, typeof (_b = typeof FikaFriendRequestsHelper_1.FikaFriendRequestsHelper !== "undefined" && FikaFriendRequestsHelper_1.FikaFriendRequestsHelper) === "function" ? _b : Object, typeof (_c = typeof FikaPlayerRelationsHelper_1.FikaPlayerRelationsHelper !== "undefined" && FikaPlayerRelationsHelper_1.FikaPlayerRelationsHelper) === "function" ? _c : Object])
|
||||
], FikaDialogueController);
|
||||
//# sourceMappingURL=FikaDialogueController.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FikaDialogueController.js","sourceRoot":"","sources":["FikaDialogueController.ts"],"names":[],"mappings":"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"}
|
||||
@@ -0,0 +1,136 @@
|
||||
import { inject, injectAll, injectable } from "tsyringe";
|
||||
|
||||
import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot";
|
||||
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||
import { IFriendRequestSendResponse } from "@spt-aki/models/eft/dialog/IFriendRequestSendResponse";
|
||||
import { IGetFriendListDataResponse } from "@spt-aki/models/eft/dialog/IGetFriendListDataResponse";
|
||||
import { BackendErrorCodes } from "@spt-aki/models/enums/BackendErrorCodes";
|
||||
|
||||
import { FikaFriendRequestsHelper } from "../helpers/FikaFriendRequestsHelper";
|
||||
import { FikaPlayerRelationsHelper } from "../helpers/FikaPlayerRelationsHelper";
|
||||
import { IFriendRequestListResponse } from "../models/eft/dialog/IFriendRequestListResponse";
|
||||
|
||||
@injectable()
|
||||
export class FikaDialogueController {
|
||||
constructor(
|
||||
@injectAll("DialogueChatBot") protected dialogueChatBots: IDialogueChatBot[],
|
||||
@inject("ProfileHelper") protected profileHelper: ProfileHelper,
|
||||
@inject("FikaFriendRequestsHelper") protected fikaFriendRequestsHelper: FikaFriendRequestsHelper,
|
||||
@inject("FikaPlayerRelationsHelper") protected fikaPlayerRelationsHelper: FikaPlayerRelationsHelper,
|
||||
) {
|
||||
// empty
|
||||
}
|
||||
|
||||
public getFriendList(sessionID: string): IGetFriendListDataResponse {
|
||||
const botsAndFriends = this.dialogueChatBots.map((v) => v.getChatBot());
|
||||
|
||||
const friendsIds = this.fikaPlayerRelationsHelper.getFriendsList(sessionID);
|
||||
|
||||
for (const friendId of friendsIds) {
|
||||
const profile = this.profileHelper.getPmcProfile(friendId);
|
||||
|
||||
botsAndFriends.push({
|
||||
_id: profile._id,
|
||||
aid: profile.aid,
|
||||
Info: {
|
||||
Nickname: profile.Info.Nickname,
|
||||
Level: profile.Info.Level,
|
||||
Side: profile.Info.Side,
|
||||
MemberCategory: profile.Info.MemberCategory,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
Friends: botsAndFriends,
|
||||
Ignore: this.fikaPlayerRelationsHelper.getIgnoreList(sessionID),
|
||||
InIgnoreList: this.fikaPlayerRelationsHelper.getInIgnoreList(sessionID),
|
||||
};
|
||||
}
|
||||
|
||||
public listOutbox(sessionID: string): IFriendRequestListResponse[] {
|
||||
const sentFriendRequests = this.fikaFriendRequestsHelper.getSentFriendRequests(sessionID) as IFriendRequestListResponse[];
|
||||
|
||||
for (const sentFriendRequest of sentFriendRequests) {
|
||||
const profile = this.profileHelper.getPmcProfile(sentFriendRequest.to);
|
||||
|
||||
sentFriendRequest.profile = {
|
||||
_id: profile._id,
|
||||
aid: profile.aid,
|
||||
Info: {
|
||||
Nickname: profile.Info.Nickname,
|
||||
Side: profile.Info.Side,
|
||||
Level: profile.Info.Level,
|
||||
MemberCategory: profile.Info.MemberCategory,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return sentFriendRequests;
|
||||
}
|
||||
|
||||
public listInbox(sessionID: string): IFriendRequestListResponse[] {
|
||||
const receivedFriendRequests = this.fikaFriendRequestsHelper.getReceivedFriendRequests(sessionID) as IFriendRequestListResponse[];
|
||||
|
||||
for (const receivedFriendRequest of receivedFriendRequests) {
|
||||
const profile = this.profileHelper.getPmcProfile(receivedFriendRequest.from);
|
||||
|
||||
receivedFriendRequest.profile = {
|
||||
_id: profile._id,
|
||||
aid: profile.aid,
|
||||
Info: {
|
||||
Nickname: profile.Info.Nickname,
|
||||
Side: profile.Info.Side,
|
||||
Level: profile.Info.Level,
|
||||
MemberCategory: profile.Info.MemberCategory,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return receivedFriendRequests;
|
||||
}
|
||||
|
||||
public sendFriendRequest(from: string, to: string): IFriendRequestSendResponse {
|
||||
this.fikaFriendRequestsHelper.addFriendRequest(from, to);
|
||||
|
||||
return {
|
||||
status: BackendErrorCodes.NONE,
|
||||
requestId: from,
|
||||
retryAfter: 0,
|
||||
};
|
||||
}
|
||||
|
||||
public acceptAllFriendRequests(sessionID: string): void {
|
||||
const receivedFriendRequests = this.fikaFriendRequestsHelper.getReceivedFriendRequests(sessionID);
|
||||
|
||||
for (const friendRequest of receivedFriendRequests) {
|
||||
this.acceptFriendRequest(friendRequest.from, friendRequest.to);
|
||||
}
|
||||
}
|
||||
|
||||
public acceptFriendRequest(from: string, to: string): void {
|
||||
this.fikaFriendRequestsHelper.removeFriendRequest(from, to);
|
||||
|
||||
this.fikaPlayerRelationsHelper.addFriend(from, to);
|
||||
}
|
||||
|
||||
public cancelFriendRequest(from: string, to: string): void {
|
||||
this.fikaFriendRequestsHelper.removeFriendRequest(from, to);
|
||||
}
|
||||
|
||||
public declineFriendRequest(from: string, to: string): void {
|
||||
this.cancelFriendRequest(from, to);
|
||||
}
|
||||
|
||||
public deleteFriend(fromId: string, friendId: string): void {
|
||||
this.fikaPlayerRelationsHelper.removeFriend(fromId, friendId);
|
||||
}
|
||||
|
||||
public ignoreFriend(fromId: string, friendId: string): void {
|
||||
this.fikaPlayerRelationsHelper.addToIgnoreList(fromId, friendId);
|
||||
}
|
||||
|
||||
public unIgnoreFriend(fromId: string, friendId: string): void {
|
||||
this.fikaPlayerRelationsHelper.removeFromIgnoreList(fromId, friendId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FikaLocationController = void 0;
|
||||
const tsyringe_1 = require("/snapshot/project/node_modules/tsyringe");
|
||||
const FikaMatchService_1 = require("../services/FikaMatchService");
|
||||
let FikaLocationController = class FikaLocationController {
|
||||
fikaMatchService;
|
||||
constructor(fikaMatchService) {
|
||||
this.fikaMatchService = fikaMatchService;
|
||||
// empty
|
||||
}
|
||||
/**
|
||||
* Handle /fika/location/raids
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
handleGetRaids(_request) {
|
||||
const matches = [];
|
||||
for (const [matchId, match] of this.fikaMatchService.getAllMatches()) {
|
||||
matches.push({
|
||||
serverId: matchId,
|
||||
hostUsername: match.hostUsername,
|
||||
playerCount: match.players.size,
|
||||
status: match.status,
|
||||
location: match.raidConfig.location,
|
||||
side: match.side,
|
||||
time: match.time,
|
||||
});
|
||||
}
|
||||
return matches;
|
||||
}
|
||||
};
|
||||
exports.FikaLocationController = FikaLocationController;
|
||||
exports.FikaLocationController = FikaLocationController = __decorate([
|
||||
(0, tsyringe_1.injectable)(),
|
||||
__param(0, (0, tsyringe_1.inject)("FikaMatchService")),
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof FikaMatchService_1.FikaMatchService !== "undefined" && FikaMatchService_1.FikaMatchService) === "function" ? _a : Object])
|
||||
], FikaLocationController);
|
||||
//# sourceMappingURL=FikaLocationController.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FikaLocationController.js","sourceRoot":"","sources":["FikaLocationController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAA6E;AAK7E,mEAAgE;AAGzD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACmB;IAAlD,YAAkD,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAChF,QAAQ;IACZ,CAAC;IAED;;;;OAIG;IACI,cAAc,CAAC,QAA0C;QAC5D,MAAM,OAAO,GAAuB,EAAE,CAAC;QAEvC,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,EAAE,CAAC;YACnE,OAAO,CAAC,IAAI,CAAC;gBACT,QAAQ,EAAE,OAAO;gBACjB,YAAY,EAAE,KAAK,CAAC,YAAY;gBAChC,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI;gBAC/B,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,QAAQ;gBACnC,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,IAAI,EAAE,KAAK,CAAC,IAAI;aACnB,CAAC,CAAC;QACP,CAAC;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ,CAAA;AA3BY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,qBAAU,GAAE;IAEI,WAAA,IAAA,iBAAM,EAAC,kBAAkB,CAAC,CAAA;yDAA6B,mCAAgB,oBAAhB,mCAAgB;GAD3E,sBAAsB,CA2BlC"}
|
||||
@@ -0,0 +1,36 @@
|
||||
import { inject, injectable } from "tsyringe";
|
||||
|
||||
import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData";
|
||||
|
||||
import { IFikaRaidsResponse } from "../models/fika/routes/location/IFikaRaidsResponse";
|
||||
import { FikaMatchService } from "../services/FikaMatchService";
|
||||
|
||||
@injectable()
|
||||
export class FikaLocationController {
|
||||
constructor(@inject("FikaMatchService") protected fikaMatchService: FikaMatchService) {
|
||||
// empty
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle /fika/location/raids
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
public handleGetRaids(_request: IGetRaidConfigurationRequestData): IFikaRaidsResponse {
|
||||
const matches: IFikaRaidsResponse = [];
|
||||
|
||||
for (const [matchId, match] of this.fikaMatchService.getAllMatches()) {
|
||||
matches.push({
|
||||
serverId: matchId,
|
||||
hostUsername: match.hostUsername,
|
||||
playerCount: match.players.size,
|
||||
status: match.status,
|
||||
location: match.raidConfig.location,
|
||||
side: match.side,
|
||||
time: match.time,
|
||||
});
|
||||
}
|
||||
|
||||
return matches;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FikaRaidController = void 0;
|
||||
const tsyringe_1 = require("/snapshot/project/node_modules/tsyringe");
|
||||
const FikaMatchEndSessionMessages_1 = require("../models/enums/FikaMatchEndSessionMessages");
|
||||
const FikaMatchService_1 = require("../services/FikaMatchService");
|
||||
let FikaRaidController = class FikaRaidController {
|
||||
fikaMatchService;
|
||||
constructor(fikaMatchService) {
|
||||
this.fikaMatchService = fikaMatchService;
|
||||
// empty
|
||||
}
|
||||
/**
|
||||
* Handle /fika/raid/create
|
||||
* @param request
|
||||
*/
|
||||
handleRaidCreate(request) {
|
||||
return {
|
||||
success: this.fikaMatchService.createMatch(request),
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Handle /fika/raid/join
|
||||
* @param request
|
||||
*/
|
||||
handleRaidJoin(request) {
|
||||
this.fikaMatchService.addPlayerToMatch(request.serverId, request.profileId, { groupId: null, isDead: false });
|
||||
const match = this.fikaMatchService.getMatch(request.serverId);
|
||||
return {
|
||||
serverId: request.serverId,
|
||||
timestamp: match.timestamp,
|
||||
expectedNumberOfPlayers: match.expectedNumberOfPlayers,
|
||||
gameVersion: match.gameVersion,
|
||||
fikaVersion: match.fikaVersion,
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Handle /fika/raid/leave
|
||||
* @param request
|
||||
*/
|
||||
handleRaidLeave(request) {
|
||||
if (request.serverId === request.profileId) {
|
||||
this.fikaMatchService.endMatch(request.serverId, FikaMatchEndSessionMessages_1.FikaMatchEndSessionMessage.HOST_SHUTDOWN_MESSAGE);
|
||||
return;
|
||||
}
|
||||
this.fikaMatchService.removePlayerFromMatch(request.serverId, request.profileId);
|
||||
}
|
||||
/**
|
||||
* Handle /fika/raid/gethost
|
||||
* @param request
|
||||
*/
|
||||
handleRaidGethost(request) {
|
||||
const match = this.fikaMatchService.getMatch(request.serverId);
|
||||
if (!match) {
|
||||
return;
|
||||
}
|
||||
return {
|
||||
ip: match.ip,
|
||||
port: match.port,
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Handle /fika/raid/spawnpoint
|
||||
* @param request
|
||||
*/
|
||||
handleRaidSpawnpoint(request) {
|
||||
const match = this.fikaMatchService.getMatch(request.serverId);
|
||||
if (!match) {
|
||||
return;
|
||||
}
|
||||
return {
|
||||
spawnpoint: match.spawnPoint,
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Handle /fika/raid/getsettings
|
||||
* @param request
|
||||
*/
|
||||
handleRaidGetSettings(request) {
|
||||
const match = this.fikaMatchService.getMatch(request.serverId);
|
||||
if (!match) {
|
||||
return;
|
||||
}
|
||||
return {
|
||||
metabolismDisabled: match.raidConfig.metabolismDisabled,
|
||||
playersSpawnPlace: match.raidConfig.playersSpawnPlace
|
||||
};
|
||||
}
|
||||
};
|
||||
exports.FikaRaidController = FikaRaidController;
|
||||
exports.FikaRaidController = FikaRaidController = __decorate([
|
||||
(0, tsyringe_1.injectable)(),
|
||||
__param(0, (0, tsyringe_1.inject)("FikaMatchService")),
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof FikaMatchService_1.FikaMatchService !== "undefined" && FikaMatchService_1.FikaMatchService) === "function" ? _a : Object])
|
||||
], FikaRaidController);
|
||||
//# sourceMappingURL=FikaRaidController.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FikaRaidController.js","sourceRoot":"","sources":["FikaRaidController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAA6E;AAE7E,6FAAyF;AAUzF,mEAAgE;AAGzD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACuB;IAAlD,YAAkD,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAChF,QAAQ;IACZ,CAAC;IAED;;;OAGG;IACI,gBAAgB,CAAC,OAAmC;QACvD,OAAO;YACH,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,OAAO,CAAC;SACtD,CAAC;IACN,CAAC;IAED;;;OAGG;IACI,cAAc,CAAC,OAAiC;QACnD,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAE9G,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAE/D,OAAO;YACH,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,uBAAuB,EAAE,KAAK,CAAC,uBAAuB;YACtD,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,WAAW,EAAE,KAAK,CAAC,WAAW;SACjC,CAAC;IACN,CAAC;IAED;;;OAGG;IACI,eAAe,CAAC,OAAkC;QACrD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,SAAS,EAAE,CAAC;YACzC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,wDAA0B,CAAC,qBAAqB,CAAC,CAAC;YACnG,OAAO;QACX,CAAC;QAED,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACrF,CAAC;IAED;;;OAGG;IACI,iBAAiB,CAAC,OAAqC;QAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC/D,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,OAAO;QACX,CAAC;QAED,OAAO;YACH,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,IAAI,EAAE,KAAK,CAAC,IAAI;SACnB,CAAC;IACN,CAAC;IAED;;;OAGG;IACI,oBAAoB,CAAC,OAAqC;QAC7D,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC/D,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,OAAO;QACX,CAAC;QAED,OAAO;YACH,UAAU,EAAE,KAAK,CAAC,UAAU;SAC/B,CAAC;IACN,CAAC;IAED;;;OAGG;IACI,qBAAqB,CAAC,OAAqC;QAC9D,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC/D,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,OAAO;QACX,CAAC;QAED,OAAO;YACH,kBAAkB,EAAE,KAAK,CAAC,UAAU,CAAC,kBAAkB;YACvD,iBAAiB,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB;SACxD,CAAC;IACN,CAAC;CACJ,CAAA;AA5FY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,qBAAU,GAAE;IAEI,WAAA,IAAA,iBAAM,EAAC,kBAAkB,CAAC,CAAA;yDAA6B,mCAAgB,oBAAhB,mCAAgB;GAD3E,kBAAkB,CA4F9B"}
|
||||
@@ -0,0 +1,108 @@
|
||||
import { inject, injectable } from "tsyringe";
|
||||
|
||||
import { FikaMatchEndSessionMessage } from "../models/enums/FikaMatchEndSessionMessages";
|
||||
import { IFikaRaidServerIdRequestData } from "../models/fika/routes/raid/IFikaRaidServerIdRequestData";
|
||||
import { IFikaRaidCreateRequestData } from "../models/fika/routes/raid/create/IFikaRaidCreateRequestData";
|
||||
import { IFikaRaidCreateResponse } from "../models/fika/routes/raid/create/IFikaRaidCreateResponse";
|
||||
import { IFikaRaidGethostResponse } from "../models/fika/routes/raid/gethost/IFikaRaidGethostResponse";
|
||||
import { IFikaRaidJoinRequestData } from "../models/fika/routes/raid/join/IFikaRaidJoinRequestData";
|
||||
import { IFikaRaidJoinResponse } from "../models/fika/routes/raid/join/IFikaRaidJoinResponse";
|
||||
import { IFikaRaidLeaveRequestData } from "../models/fika/routes/raid/leave/IFikaRaidLeaveRequestData";
|
||||
import { IFikaRaidSpawnpointResponse } from "../models/fika/routes/raid/spawnpoint/IFikaRaidSpawnpointResponse";
|
||||
import { IFikaRaidSettingsResponse } from "../models/fika/routes/raid/getsettings/IFikaRaidSettingsResponse";
|
||||
import { FikaMatchService } from "../services/FikaMatchService";
|
||||
|
||||
@injectable()
|
||||
export class FikaRaidController {
|
||||
constructor(@inject("FikaMatchService") protected fikaMatchService: FikaMatchService) {
|
||||
// empty
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle /fika/raid/create
|
||||
* @param request
|
||||
*/
|
||||
public handleRaidCreate(request: IFikaRaidCreateRequestData): IFikaRaidCreateResponse {
|
||||
return {
|
||||
success: this.fikaMatchService.createMatch(request),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle /fika/raid/join
|
||||
* @param request
|
||||
*/
|
||||
public handleRaidJoin(request: IFikaRaidJoinRequestData): IFikaRaidJoinResponse {
|
||||
this.fikaMatchService.addPlayerToMatch(request.serverId, request.profileId, { groupId: null, isDead: false });
|
||||
|
||||
const match = this.fikaMatchService.getMatch(request.serverId);
|
||||
|
||||
return {
|
||||
serverId: request.serverId,
|
||||
timestamp: match.timestamp,
|
||||
expectedNumberOfPlayers: match.expectedNumberOfPlayers,
|
||||
gameVersion: match.gameVersion,
|
||||
fikaVersion: match.fikaVersion,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle /fika/raid/leave
|
||||
* @param request
|
||||
*/
|
||||
public handleRaidLeave(request: IFikaRaidLeaveRequestData): void {
|
||||
if (request.serverId === request.profileId) {
|
||||
this.fikaMatchService.endMatch(request.serverId, FikaMatchEndSessionMessage.HOST_SHUTDOWN_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
this.fikaMatchService.removePlayerFromMatch(request.serverId, request.profileId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle /fika/raid/gethost
|
||||
* @param request
|
||||
*/
|
||||
public handleRaidGethost(request: IFikaRaidServerIdRequestData): IFikaRaidGethostResponse {
|
||||
const match = this.fikaMatchService.getMatch(request.serverId);
|
||||
if (!match) {
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
ip: match.ip,
|
||||
port: match.port,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle /fika/raid/spawnpoint
|
||||
* @param request
|
||||
*/
|
||||
public handleRaidSpawnpoint(request: IFikaRaidServerIdRequestData): IFikaRaidSpawnpointResponse {
|
||||
const match = this.fikaMatchService.getMatch(request.serverId);
|
||||
if (!match) {
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
spawnpoint: match.spawnPoint,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle /fika/raid/getsettings
|
||||
* @param request
|
||||
*/
|
||||
public handleRaidGetSettings(request: IFikaRaidServerIdRequestData): IFikaRaidSettingsResponse {
|
||||
const match = this.fikaMatchService.getMatch(request.serverId);
|
||||
if (!match) {
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
metabolismDisabled: match.raidConfig.metabolismDisabled,
|
||||
playersSpawnPlace: match.raidConfig.playersSpawnPlace
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FikaSendItemController = void 0;
|
||||
const tsyringe_1 = require("/snapshot/project/node_modules/tsyringe");
|
||||
const InventoryHelper_1 = require("/snapshot/project/obj/helpers/InventoryHelper");
|
||||
const ItemHelper_1 = require("/snapshot/project/obj/helpers/ItemHelper");
|
||||
const ILogger_1 = require("/snapshot/project/obj/models/spt/utils/ILogger");
|
||||
const EventOutputHolder_1 = require("/snapshot/project/obj/routers/EventOutputHolder");
|
||||
const SaveServer_1 = require("/snapshot/project/obj/servers/SaveServer");
|
||||
const MailSendService_1 = require("/snapshot/project/obj/services/MailSendService");
|
||||
const HttpResponseUtil_1 = require("/snapshot/project/obj/utils/HttpResponseUtil");
|
||||
const FikaConfig_1 = require("../utils/FikaConfig");
|
||||
let FikaSendItemController = class FikaSendItemController {
|
||||
logger;
|
||||
eventOutputHolder;
|
||||
mailSendService;
|
||||
inventoryHelper;
|
||||
saveServer;
|
||||
itemHelper;
|
||||
httpResponse;
|
||||
fikaConfig;
|
||||
constructor(logger, eventOutputHolder, mailSendService, inventoryHelper, saveServer, itemHelper, httpResponse, fikaConfig) {
|
||||
this.logger = logger;
|
||||
this.eventOutputHolder = eventOutputHolder;
|
||||
this.mailSendService = mailSendService;
|
||||
this.inventoryHelper = inventoryHelper;
|
||||
this.saveServer = saveServer;
|
||||
this.itemHelper = itemHelper;
|
||||
this.httpResponse = httpResponse;
|
||||
this.fikaConfig = fikaConfig;
|
||||
// empty
|
||||
}
|
||||
sendItem(_pmcData, body, sessionID) {
|
||||
const fikaConfig = this.fikaConfig.getConfig();
|
||||
const output = this.eventOutputHolder.getOutput(sessionID);
|
||||
if (!body || !body.id || !body.target) {
|
||||
return this.httpResponse.appendErrorToOutput(output, "Missing data in body");
|
||||
}
|
||||
const senderProfile = this.saveServer.getProfile(sessionID);
|
||||
if (!senderProfile) {
|
||||
return this.httpResponse.appendErrorToOutput(output, "Sender profile not found");
|
||||
}
|
||||
// Disabled until functionality is required due to being buggy
|
||||
// if (senderProfile.inraid.location != "none") {
|
||||
// return this.httpResponse.appendErrorToOutput(
|
||||
// output,
|
||||
// `You cannot send items while in raid, current state is: ${senderProfile.inraid.location}`
|
||||
// );
|
||||
// }
|
||||
const targetProfile = this.saveServer.getProfile(body.target);
|
||||
if (!targetProfile) {
|
||||
return this.httpResponse.appendErrorToOutput(output, "Target profile not found");
|
||||
}
|
||||
this.logger.info(`${body.id} is going to sessionID: ${body.target}`);
|
||||
const senderItems = senderProfile.characters.pmc.Inventory.items;
|
||||
const itemsToSend = this.itemHelper.findAndReturnChildrenAsItems(senderItems, body.id);
|
||||
if (!itemsToSend || itemsToSend.length === 0) {
|
||||
return this.httpResponse.appendErrorToOutput(output, "Item not found in inventory");
|
||||
}
|
||||
if (fikaConfig.server.giftedItemsLoseFIR) {
|
||||
for (const item of itemsToSend) {
|
||||
item.upd ??= {};
|
||||
item.upd.SpawnedInSession = false;
|
||||
}
|
||||
}
|
||||
this.mailSendService.sendUserMessageToPlayer(body.target, {
|
||||
_id: senderProfile.info.id,
|
||||
aid: senderProfile.info.aid,
|
||||
Info: {
|
||||
Nickname: senderProfile.info.username,
|
||||
Side: senderProfile.characters.pmc.Info.Side,
|
||||
Level: senderProfile.characters.pmc.Info.Level,
|
||||
MemberCategory: senderProfile.characters.pmc.Info.MemberCategory,
|
||||
},
|
||||
}, `You have received a gift from ${senderProfile.info.username}`, itemsToSend);
|
||||
this.inventoryHelper.removeItem(senderProfile.characters.pmc, body.id, sessionID, output);
|
||||
return output;
|
||||
}
|
||||
/**
|
||||
* Get available receivers for sending an item
|
||||
* @param sessionID
|
||||
* @returns
|
||||
*/
|
||||
handleAvailableReceivers(sessionID) {
|
||||
const sender = this.saveServer.getProfile(sessionID);
|
||||
if (!sender) {
|
||||
return;
|
||||
}
|
||||
const result = {};
|
||||
const profiles = this.saveServer.getProfiles();
|
||||
for (const profile of Object.values(profiles)) {
|
||||
const username = profile.info.username;
|
||||
if (!(username in result) && username !== sender.info.username) {
|
||||
result[username] = profile.info.id;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
exports.FikaSendItemController = FikaSendItemController;
|
||||
exports.FikaSendItemController = FikaSendItemController = __decorate([
|
||||
(0, tsyringe_1.injectable)(),
|
||||
__param(0, (0, tsyringe_1.inject)("WinstonLogger")),
|
||||
__param(1, (0, tsyringe_1.inject)("EventOutputHolder")),
|
||||
__param(2, (0, tsyringe_1.inject)("MailSendService")),
|
||||
__param(3, (0, tsyringe_1.inject)("InventoryHelper")),
|
||||
__param(4, (0, tsyringe_1.inject)("SaveServer")),
|
||||
__param(5, (0, tsyringe_1.inject)("ItemHelper")),
|
||||
__param(6, (0, tsyringe_1.inject)("HttpResponseUtil")),
|
||||
__param(7, (0, tsyringe_1.inject)("FikaConfig")),
|
||||
__metadata("design:paramtypes", [typeof (_a = typeof ILogger_1.ILogger !== "undefined" && ILogger_1.ILogger) === "function" ? _a : Object, typeof (_b = typeof EventOutputHolder_1.EventOutputHolder !== "undefined" && EventOutputHolder_1.EventOutputHolder) === "function" ? _b : Object, typeof (_c = typeof MailSendService_1.MailSendService !== "undefined" && MailSendService_1.MailSendService) === "function" ? _c : Object, typeof (_d = typeof InventoryHelper_1.InventoryHelper !== "undefined" && InventoryHelper_1.InventoryHelper) === "function" ? _d : Object, typeof (_e = typeof SaveServer_1.SaveServer !== "undefined" && SaveServer_1.SaveServer) === "function" ? _e : Object, typeof (_f = typeof ItemHelper_1.ItemHelper !== "undefined" && ItemHelper_1.ItemHelper) === "function" ? _f : Object, typeof (_g = typeof HttpResponseUtil_1.HttpResponseUtil !== "undefined" && HttpResponseUtil_1.HttpResponseUtil) === "function" ? _g : Object, typeof (_h = typeof FikaConfig_1.FikaConfig !== "undefined" && FikaConfig_1.FikaConfig) === "function" ? _h : Object])
|
||||
], FikaSendItemController);
|
||||
//# sourceMappingURL=FikaSendItemController.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"FikaSendItemController.js","sourceRoot":"","sources":["FikaSendItemController.ts"],"names":[],"mappings":"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"}
|
||||
@@ -0,0 +1,121 @@
|
||||
import { inject, injectable } from "tsyringe";
|
||||
|
||||
import { InventoryHelper } from "@spt-aki/helpers/InventoryHelper";
|
||||
import { ItemHelper } from "@spt-aki/helpers/ItemHelper";
|
||||
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||
import { Item } from "@spt-aki/models/eft/common/tables/IItem";
|
||||
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder";
|
||||
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||
import { MailSendService } from "@spt-aki/services/MailSendService";
|
||||
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||
|
||||
import { IFikaSendItemRequestData } from "../models/fika/routes/senditem/IFikaSendItemRequestData";
|
||||
import { IFikaSenditemAvailablereceiversResponse } from "../models/fika/routes/senditem/availablereceivers/IFikaSenditemAvailablereceiversResponse";
|
||||
import { FikaConfig } from "../utils/FikaConfig";
|
||||
|
||||
@injectable()
|
||||
export class FikaSendItemController {
|
||||
constructor(
|
||||
@inject("WinstonLogger") protected logger: ILogger,
|
||||
@inject("EventOutputHolder") protected eventOutputHolder: EventOutputHolder,
|
||||
@inject("MailSendService") protected mailSendService: MailSendService,
|
||||
@inject("InventoryHelper") protected inventoryHelper: InventoryHelper,
|
||||
@inject("SaveServer") protected saveServer: SaveServer,
|
||||
@inject("ItemHelper") protected itemHelper: ItemHelper,
|
||||
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
|
||||
@inject("FikaConfig") protected fikaConfig: FikaConfig,
|
||||
) {
|
||||
// empty
|
||||
}
|
||||
|
||||
public sendItem(_pmcData: IPmcData, body: IFikaSendItemRequestData, sessionID: string): IItemEventRouterResponse {
|
||||
const fikaConfig = this.fikaConfig.getConfig();
|
||||
const output = this.eventOutputHolder.getOutput(sessionID);
|
||||
|
||||
if (!body || !body.id || !body.target) {
|
||||
return this.httpResponse.appendErrorToOutput(output, "Missing data in body");
|
||||
}
|
||||
|
||||
const senderProfile: IAkiProfile = this.saveServer.getProfile(sessionID);
|
||||
if (!senderProfile) {
|
||||
return this.httpResponse.appendErrorToOutput(output, "Sender profile not found");
|
||||
}
|
||||
|
||||
// Disabled until functionality is required due to being buggy
|
||||
|
||||
// if (senderProfile.inraid.location != "none") {
|
||||
// return this.httpResponse.appendErrorToOutput(
|
||||
// output,
|
||||
// `You cannot send items while in raid, current state is: ${senderProfile.inraid.location}`
|
||||
// );
|
||||
// }
|
||||
|
||||
const targetProfile: IAkiProfile = this.saveServer.getProfile(body.target);
|
||||
if (!targetProfile) {
|
||||
return this.httpResponse.appendErrorToOutput(output, "Target profile not found");
|
||||
}
|
||||
|
||||
this.logger.info(`${body.id} is going to sessionID: ${body.target}`);
|
||||
|
||||
const senderItems: Item[] = senderProfile.characters.pmc.Inventory.items;
|
||||
const itemsToSend: Item[] = this.itemHelper.findAndReturnChildrenAsItems(senderItems, body.id);
|
||||
if (!itemsToSend || itemsToSend.length === 0) {
|
||||
return this.httpResponse.appendErrorToOutput(output, "Item not found in inventory");
|
||||
}
|
||||
|
||||
if (fikaConfig.server.giftedItemsLoseFIR) {
|
||||
for (const item of itemsToSend) {
|
||||
item.upd ??= {};
|
||||
|
||||
item.upd.SpawnedInSession = false;
|
||||
}
|
||||
}
|
||||
|
||||
this.mailSendService.sendUserMessageToPlayer(
|
||||
body.target,
|
||||
{
|
||||
_id: senderProfile.info.id,
|
||||
aid: senderProfile.info.aid,
|
||||
Info: {
|
||||
Nickname: senderProfile.info.username,
|
||||
Side: senderProfile.characters.pmc.Info.Side,
|
||||
Level: senderProfile.characters.pmc.Info.Level,
|
||||
MemberCategory: senderProfile.characters.pmc.Info.MemberCategory,
|
||||
},
|
||||
},
|
||||
`You have received a gift from ${senderProfile.info.username}`,
|
||||
itemsToSend,
|
||||
);
|
||||
|
||||
this.inventoryHelper.removeItem(senderProfile.characters.pmc, body.id, sessionID, output);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get available receivers for sending an item
|
||||
* @param sessionID
|
||||
* @returns
|
||||
*/
|
||||
public handleAvailableReceivers(sessionID: string): IFikaSenditemAvailablereceiversResponse {
|
||||
const sender: IAkiProfile = this.saveServer.getProfile(sessionID);
|
||||
if (!sender) {
|
||||
return;
|
||||
}
|
||||
|
||||
const result: Record<string, string> = {};
|
||||
const profiles = this.saveServer.getProfiles();
|
||||
|
||||
for (const profile of Object.values(profiles)) {
|
||||
const username = profile.info.username;
|
||||
if (!(username in result) && username !== sender.info.username) {
|
||||
result[username] = profile.info.id;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user