mirror of
https://github.com/arcan1s/ffxivbis.git
synced 2025-04-24 09:17:18 +00:00
readme & license
This commit is contained in:
parent
9f19519b75
commit
df8fa43344
29
LICENSE
Normal file
29
LICENSE
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
Copyright (c) 2019, Evgeniy Alekseev
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of ffxivbis nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
99
README.md
Normal file
99
README.md
Normal file
@ -0,0 +1,99 @@
|
||||
# FFXIV BiS
|
||||
|
||||
Service which allows to manage savage loot distribution easy.
|
||||
|
||||
## REST API
|
||||
|
||||
### Party API
|
||||
|
||||
* `GET /api/v1/party`
|
||||
|
||||
Get party list. Parameters:
|
||||
|
||||
* `nick`: player full nickname to filter, string, optional.
|
||||
|
||||
* `POST /api/v1/party`
|
||||
|
||||
Add or remove party member. Parameters:
|
||||
|
||||
* `action`: action to do, string, required. One of `add`, `remove`.
|
||||
* `job`: player job name, string, required.
|
||||
* `nick`: player nickname, string, required.
|
||||
* `link`: link to ariyala set to parse BiS, string, optional.
|
||||
|
||||
### BiS API
|
||||
|
||||
* `GET /api/v1/party/bis`
|
||||
|
||||
Get party/player BiS. Parameters:
|
||||
|
||||
* `nick`: player full nickname to filter, string, optional.
|
||||
|
||||
* `POST /api/v1/party/bis`
|
||||
|
||||
Add or remove item to/from BiS. Parameters:
|
||||
|
||||
* `action`: action to do, string, required. One of `add`, `remove`.
|
||||
* `job`: player job name, string, required.
|
||||
* `nick`: player nickname, string, required.
|
||||
* `is_tome`: is item tome gear or not, bool, required.
|
||||
* `piece`: item name, string, required.
|
||||
|
||||
* `PUT /api/v1/party/bis`
|
||||
|
||||
Create BiS from ariyala link. Parameters:
|
||||
|
||||
* `job`: player job name, string, required.
|
||||
* `nick`: player nickname, string, required.
|
||||
* `link`: link to ariyala set to parse BiS, string, required.
|
||||
|
||||
### Loot API
|
||||
|
||||
* `GET /api/v1/party/loot`
|
||||
|
||||
Get party/player loot. Parameters:
|
||||
|
||||
* `nick`: player full nickname to filter, string, optional.
|
||||
|
||||
* `POST /api/v1/party/loot`
|
||||
|
||||
Add or remove item to/from loot list. Parameters:
|
||||
|
||||
* `action`: action to do, string, required. One of `add`, `remove`.
|
||||
* `job`: player job name, string, required.
|
||||
* `nick`: player nickname, string, required.
|
||||
* `is_tome`: is item tome gear or not, bool, required.
|
||||
* `piece`: item name, string, required.
|
||||
|
||||
* `PUT /api/v1/party/loot`
|
||||
|
||||
Suggest players to get loot. Parameters:
|
||||
|
||||
* `is_tome`: is item tome gear or not, bool, required.
|
||||
* `piece`: item name, string, required.
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
* `settings` section
|
||||
|
||||
General project settings.
|
||||
|
||||
* `include`: path to include configuration directory, string, optional.
|
||||
* `logging`: path to logging configuration, see `logging.ini` for reference, string, optional.
|
||||
* `database`: database provide name, string, required. Allowed values: `sqlite`.
|
||||
* `priority`: methods of `Player` class which will be called to sort players for loot priority, space separated list of strings, required.
|
||||
|
||||
* `web` section
|
||||
|
||||
Web server related settings.
|
||||
|
||||
* `host`: address to bind, string, required.
|
||||
* `port`: port to bind, int, required.
|
||||
|
||||
* `sqlite` section
|
||||
|
||||
Database settings for `sqlite` provider.
|
||||
|
||||
* `database_path`: path to sqlite database, string, required.
|
||||
* `migrations_path`: path to database migrations, string, required.
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from enum import Enum
|
||||
from json import JSONEncoder
|
||||
from typing import Any
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from aiohttp.web import Application
|
||||
|
||||
from .views.bis import BiSView
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
import json
|
||||
|
||||
from aiohttp.web import Response
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from aiohttp.web import Response, View
|
||||
from typing import Iterable, Optional
|
||||
|
||||
@ -33,7 +41,7 @@ class BiSView(View):
|
||||
except Exception:
|
||||
data = dict(await self.request.post())
|
||||
|
||||
required = ['action', 'job', 'nick']
|
||||
required = ['action', 'is_tome', 'job', 'nick', 'piece']
|
||||
if any(param not in data for param in required):
|
||||
return wrap_invalid_param(required, data)
|
||||
player_id = PlayerId(Job[data['job']], data['nick'])
|
||||
@ -42,20 +50,11 @@ class BiSView(View):
|
||||
if action not in ('add', 'remove'):
|
||||
return wrap_invalid_param(['action'], data)
|
||||
|
||||
piece: Optional[Piece] = None
|
||||
try:
|
||||
piece = Piece.get(data) # type: ignore
|
||||
if action == 'add':
|
||||
if 'is_tome' not in data or 'piece' not in data:
|
||||
return wrap_invalid_param(['is_tome', 'piece'], data)
|
||||
|
||||
piece = Piece.get(data) # type: ignore
|
||||
self.request.app['party'].set_item_bis(player_id, piece)
|
||||
|
||||
elif action == 'remove':
|
||||
if 'is_tome' not in data or 'piece' not in data:
|
||||
return wrap_invalid_param(['is_tome', 'piece'], data)
|
||||
|
||||
piece = Piece.get(data) # type: ignore
|
||||
self.request.app['party'].remove_item_bis(player_id, piece)
|
||||
|
||||
except Exception as e:
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from aiohttp.web import Response, View
|
||||
from typing import Iterable
|
||||
|
||||
@ -45,7 +53,6 @@ class LootView(View):
|
||||
piece = Piece.get(data)
|
||||
if action == 'add':
|
||||
self.request.app['party'].set_item(player_id, piece)
|
||||
|
||||
elif action == 'remove':
|
||||
self.request.app['party'].remove_item(player_id, piece)
|
||||
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from aiohttp.web import Response, View
|
||||
from typing import Iterable
|
||||
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
import logging
|
||||
|
||||
from aiohttp import web
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from service.core.config import Configuration
|
||||
|
||||
from .core import Application
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
import logging
|
||||
|
||||
from service.api.web import run_server, setup_service
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
import os
|
||||
import requests
|
||||
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
import configparser
|
||||
import os
|
||||
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from typing import Any, Mapping
|
||||
|
||||
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from typing import Iterable, List, Tuple, Union
|
||||
|
||||
from service.models.player import Player, PlayerIdWithCounters
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from __future__ import annotations
|
||||
|
||||
from threading import Lock
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from typing import List, Optional, Union
|
||||
|
||||
from service.models.bis import BiS
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
# because sqlite3 does not support context management
|
||||
import sqlite3
|
||||
|
||||
|
@ -1 +1,9 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
__version__ = '0.1.0'
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
import itertools
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum, auto
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from dataclasses import dataclass
|
||||
from typing import Union
|
||||
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from dataclasses import dataclass
|
||||
from typing import List, Optional, Union
|
||||
|
||||
|
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Copyright (c) 2019 Evgeniy Alekseev.
|
||||
#
|
||||
# This file is part of ffxivbis
|
||||
# (see https://github.com/arcan1s/ffxivbis).
|
||||
#
|
||||
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
|
||||
#
|
||||
from enum import Enum, auto
|
||||
from typing import List
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user