Skip to content

Releases: Alt-Org/Altzone-Server

Release on 09.02.2025

10 Feb 10:28
Compare
Choose a tag to compare

Change list

New features:

  • /customCharacter DELETE endpoint removed
  • /item PUT endpoint
  • /dailyTasks/reserve/:_id PUT endpoint
  • /dailyTasks/:_id DELETE endpoint
  • Player battle characters and avatar id

Changes to existing features:

  • CustomCharacter schema and endpoints
  • /playerTasks endpoint renamed to /dailyTasks
  • Daily tasks creation logic

Other internal API changes

  • Test coverage improvements
  • CustomCharacter module is moved to Player module
  • CustomCharacterService use new BasicService
  • Deprecated clan_module removed

Links

Additional documentation

Milestones

Changes detailed descriptions

/customCharacter DELETE endpoint removed

/customCharacter DELETE endpoint is no longer available.

/item PUT endpoint

/item PUT endpoint is added. Now it is possible to update item location.

/dailyTasks/reserve/:_id PUT endpoint

/dailyTasks/reserve/:_id PUT endpoint is added. Now it is possible for a player, to reserve some task by its _id, which means that other clan members can not reserve this task.
Notice that for each task where is a time before each the task has to be completed. If the task is not completed before the deadline, it will be automatically freed and other clan members will be able to reserve the task.

/dailyTasks/:_id DELETE endpoint

/dailyTasks/:_id DELETE endpoint is added. If some task is removed a new one will be generated, so that the clan always has 20 tasks.

Player battle characters and avatar id

Player now can choose up to 3 characters, witch he/she wants to use in the battle. Notice that player can choose only own characters.
These battle characters then are available from /customCharacter/battleCharacters GET endpoint.

Player schema has now the avatarId field for choosing player's avatar.

CustomCharacter schema and endpoints

CustomCharacter is now created only by specifying character id and level. The character id is defining the properties of created character.
The newly created character will belong to the logged-in player.

Some of the fields are renamed to the ones used on the game side.
CustomCharacter properties may be updated.

/customCharacter GET endpoints are returning only the characters owned by the logged-in player.

/playerTasks endpoint renamed to /dailyTasks

/playerTasks endpoint is now renamed to the /dailyTasks to align with game terminology.

Daily tasks creation logic

The mechanism and logic of the daily tasks are now changed to align with game requirements.
Now the daily tasks are not predefined, but instead random tasks are generated automatically by the API. They are generated in a way that the type of the task is predefined (i.e. player battles, win battles), but the amount of tasks is randomly generated (i.e. play 10 games or play 2 games).

Test coverage improvements

New tests are added for the following modules:

  • auth
  • itemMover
  • CustomCharacter

CustomCharacter module is moved to Player module

The CustomCharacter module is moved to Player module to enhance the architecture of the API

CustomCharacterService use new BasicService

CustomCharacterService use new BasicService instead of deprecated one.

Deprecated clan_module removed

Deprecated clan_module is removed with its tests

Contributors

Release on 26.01.2025

26 Jan 14:44
Compare
Choose a tag to compare

List of changes

New features:

  • Endpoint for getting items of player's clan
  • Endpoint for getting clan position on the leaderboard

Changes to existing features:

  • clanLogo field added to the clan data

Other internal API changes

  • Testing improvements

Links

Swagger file

Release address: https://devapi.altzone.fi/latest-release/

Contributors

Detailed descriptions of changes

Endpoint for getting items of player's clan

/clan/items GET

Endpoint for retrieving items of the clan where the logged-in player is a member. Returned items are separated into two arrays for stock and soul home items.

Endpoint for getting clan position on the leaderboard

/leaderboard/clan/position GET

Endpoint for retrieving logged-in player clan position on the leaderboard

clanLogo field added to the clan data

New field clanLogo is added to the clan data. The clanLogo field is meant to be used to store data of the customized by players clan logos.

The logo of a clan consists of various pieces that can be colored by players into any color, which can be represented by hexadecimal notation (i.e. #FFFFFF)

Here is the structure of the clanLogo field:

...
clanLogo: {
  logoType: "Heart", //Currently it can be only of type "Heart"
  pieceColors: [ // array of hexadecimal colors
    "#FFFFFF",
    "#000000",
    ...      
  ]
}
...

Testing improvements

Improved test coverage for the following modules:

  • clanInventory
  • chat

Fixed failing tests for modules:

  • clan

Release on 23.12.2024

25 Dec 13:01
Compare
Choose a tag to compare

List of changes

New features:

  • Flea market
  • Voting
  • Logged-in user info retrieval

Changes to existing features:

  • SoulHome and Stock default items
  • Bug with /playerTasks not returning player tasks
  • Bug with /leaderboard required authentication

Other internal API changes

  • Test coverage improvement
  • API code architecture documentation

Links

Swagger file

Release address: https://devapi.altzone.fi/latest-release/

Contributors

Detailed descriptions of changes

Flea market

/fleaMarket endpoint for game shop operations.

  • /fleaMarket and _/fleaMarket/:id GET: get all flea market items available or info about specific one
  • /fleaMarket/buy POST: buy an item from the flea market for the logged-in user clan = move an item from market to stock.
    Notice, that it will start the voting process between the clan members, since the money spent on the item are common for all clan members.
    There are no restrictions of who can buy an item, as long as this player is within some clan.
    The min acceptance percent for an item to be purchased is 51.
    Here is the process diagram of the buying process and here is the diagram of voting process.
  • /fleaMarket/sell POST: sell an item from the flea market for the logged-in user clan = move item from stock to flea market.
    Notice, that it will start the voting process between the clan members, since the item is common for all clan members.
    There are no restrictions of who can sell an item, as long as this player is within some clan.
    The min acceptance percent for an item to be sold is 51.
    Here is the process diagram of the selling process and here is the diagram of voting process.

Voting

/voting endpoint for in-game votings.

  • /voting and _/voting/:id GET: get info about logged-in player votings, where he/she can participate/participated.
  • /voting PUT: send a vote of the logged.in player

Notice that in order to get hot updates of the ongoing voting(s) a MQTT protocol must be used. Topics for voting updates are:

  • /clan/{clan_id}/voting/# for all clan votings
  • /clan/{clan_id}/voting/{voting_id} for a particular voting

More about voting logic here.

More about topics structure here.

Logged-in user info retrieval

As it was requested for a long time the endpoint, /profile/info GET, for retrieving data of the logged-in user is added.

It returns profile, player and clan data of the logged-in user.

SoulHome and Stock default items

The default items given to new clans are now changed.

For the stock they are:

[
    {
        unityKey: ItemName.SOFA_RAKKAUS,
        ...
    },
    {
        
        unityKey: ItemName.ARMCHAIR_RAKKAUS,
        ...
    },
    {
        unityKey: ItemName.FLOORLAMP_RAKKAUS,
        ...
    },
    {
        unityKey: ItemName.DININGTABLE_RAKKAUS,
        ...
    },
    {
        unityKey: ItemName.SOFATABLE_RAKKAUS,
        ...
    },
    {
        unityKey: ItemName.BED_RAKKAUS,
        ...
    }
]

For the SoulHome they are:

[
    {
        unityKey: ItemName.CARPET_RAKKAUS,
        ...
    },
    {
        unityKey: ItemName.MIRROR_RAKKAUS,
        ...
    },
    {
        unityKey: ItemName.CLOSET_RAKKAUS,
        ...
    }
]

Bug with /playerTasks not returning player tasks

The bug, appeared when a player requests tasks for the first time and 404 was returned, is now fixed.

Bug with /leaderboard required authentication

Removed mandatory authentication for all leaderboard GET endpoints.

Test coverage improvement

Improved test coverage for the following modules:

  • profile
  • common
  • player

API code architecture documentation

API code architecture now can be found here.

Release on 01.11.2024

01 Nov 14:50
Compare
Choose a tag to compare

List of changes

New features:

  • Leaderboards
  • Player tasks = Daily tasks
  • Player statistics
  • Notifications of player tasks
  • Player points tracking

Changes to existing features:

  • Item stealing logic
  • Log files saving
  • Clan creation default items
  • Models of Player, Clan, Item

Other internal API changes

  • Enhanced Jest setup
  • Improved test coverage of /common package
  • Improved API architecture and its documentation
  • env variables handling logic

Links

Swagger file

Release address: https://devapi.altzone.fi/latest-release/

Contributors

@PlayJeri
@MikhailDeriabin

Detailed descriptions of changes

Leaderboards

New endpoint /leaderboards/:board_type GET:

/leaderboards/player get top players based on points field
/leaderboards/clan get top clans based on points field

You can see the logic behind the leaderboards mechanism here

Player tasks

Player tasks or "Daily tasks" tracking logic is now done for the following events:

  • Send x amount of messages
  • Play x amount of battles
  • Win x amount of battles

Player's clan as well as Player himself/herself will get a defined amount of points and coins for each completed task.

You can find the json file with all tasks and rewards here.

There are an endpoint for retrieving player's tasks:

  • /playerTasks GET with period query (daily, weekly, monthly) for specified the required period of the tasks.

All the tracking logic is hidden and happen automatically for example, when a player wins a game the "win battles" tasks info is updated.
Here is a list of the endpoints used for track the tasks:

  • /gameData/battle POST
  • /chat/:_id/messages POST

You can check the player tasks logic in this diagram

Player statistics

Now the following player statistic is being tracked:

  • played battles
  • won battles
  • sent messages

The statistics tracking is hidden in the API logic and being updated by API automatically via these endpoints:

  • /gameData/battle POST
  • /chat/:_id/messages POST

The statistics can be retrieved from nested object gameStatistics in Player data:

  • /player GET
  • /player/:_id GET

Notice however that if player does not have any statistics yet, this object will not be provided.

Notifications of player tasks

There are now notifications of updated or completed player tasks.

Notice that the notification are sent via MQTT over WS protocol,
that means that the client need to subscribe to certain topics in order to get the notifications.

Read more about the notifications mechanism and structure here

Notice that the protocol that you need to use on the client (URL start) is probably should start from ws: not mqtt:,
but the logic remains same as it is for MQTT protocol, so you should use a library for the MQTT protocol.

Notice that it is possible only to subscribe to topics, but not publish.

The topics are secured with a password, please reach me out to get it and store it in a secure place.
At the moment the password will not change and any other security measures are taken to protect the topics,
so that it is possible to set up everything on the client with ease.

You can subscribe to all notification coming to a player with this topic: _/player/{player id}.
You can also subscribe to more specific topics if you or the player want to choose which notifications should be shown in UI.
The more fine tuned subscription is the recommended way to subscribe in order to save server resources.

The notifications of player tasks have the task data as a payload.

Here are a list of all supported atm topics:

  • /player/{player_id}/daily_task/update updates of task data, for example when player send a message or win a game
  • /player/{player_id}/daily_task/end the task is done, for example player won 3 games = completed daily task

Player points tracking

Player now will get additional points for different events happen. Currently the following events are tracked and therefore supported:

  • Player sends 3 messages in a day +20 points
  • Player wins a game +50 points
  • Player plays a game +10 points

Item stealing logic

Item stealing flow is now slightly changed and now by requesting data from /item/steal GET
only not empty rooms will be returned, but not all as it was before.

Log files saving

The log files logic is changed, so that now a separate folder created for each battle,
it is possible to set the folder name for the log file with Battle-Id header or it will be current timestamp as default.

Also the max file size is increased to 50 MB.

The changed endpoint is /gameAnalytics/logFile POST.

Clan creation default items

There are now other items created for the clan, which are corresponding to existing ones:

For stock:

{...itemProperties.Carpet_Rakkaus, stock_id, room_id: null, unityKey: ItemName.CARPET_RAKKAUS, location : [1,1] },
{...itemProperties.Mirror_Rakkaus, stock_id, room_id: null, unityKey: ItemName.MIRROR_RAKKAUS, location : [1,2] },
{...itemProperties.Closet_Rakkaus, stock_id, room_id: null, unityKey: ItemName.CLOSET_RAKKAUS, location : [1,3] }

For room:

{...itemProperties.Sofa_Rakkaus, stock_id: null, room_id, unityKey: ItemName.SOFA_RAKKAUS, location : [1,1] },
{...itemProperties.Carpet_Rakkaus, stock_id: null, room_id, unityKey: ItemName.CARPET_RAKKAUS, location : [1,2] },
{...itemProperties.Chair_Neuro, stock_id: null, room_id, unityKey: ItemName.CHAIR_NEURO, location : [1,3] },
{...itemProperties.SideTable_Taakka, stock_id: null, room_id, unityKey: ItemName.SIDETABLE_TAAKKA, location : [1,4] },
{...itemProperties.Floorlamp_Taakka, stock_id: null, room_id, unityKey: ItemName.FLOORLAMP_TAAKKA, location : [1,5] },
{...itemProperties.Sofa_Taakka, stock_id: null, room_id, unityKey: ItemName.SOFA_TAAKKA, location : [1,6] }

Models of Player, Clan, Item

Player model now have the points and gameStatistics fields.

Clan model now have the labels and points fields, as well as the tag field is deprecated now.
Also the gameCoins field is set by API not client.
Some fields are now an enums. Here is the DTO for clan creation, as well as enums:

export class CreateClanDto {
    name: string;
    tag: string;    // deprecated
    labels: ClanLabel[];    // max 5 values
    isOpen?: boolean
    ageRange?: AgeRange;
    goal?: Goal;
    phrase: string;
    language?: Language;
}

// Enums:

enum ClanLabel {
    ELÄINRAKKAAT = 'eläinrakkaat',
    MAAHANMUUTTOMYÖNTEISET = 'maahanmuuttomyönteiset',
    LGBTQ = 'lgbtq+',
    RAITTIIT = 'raittiit',
    KOHTELIAAT = 'kohteliaat',
    KIUSAAMISENVASTAISET = 'kiusaamisenvastaiset',
    URHEILEVAT = 'urheilevat',
    SYVÄLLISET = 'syvälliset',
    OIKEUDENMUKAISET = 'oikeudenmukaiset',
    KAIKKIEN_KAVERIT = 'kaikkien kaverit',
    ITSENÄISET = 'itsenäiset',
    RETKEILIJÄT = 'retkeilijät',
    SUOMENRUOTSALAISET = 'suomenruotsalaiset',
    HUUMORINTAJUISET = 'huumorintajuiset',
    RIKKAAT = 'rikkaat',
    IKITEINIT = 'ikiteinit',
    JUORUILEVAT = 'juoruilevat',
    RAKASTAVAT = 'rakastavat',
    OLEILIJAT = 'oleilijat',
    NÖRTIT = 'nörtit',
    MUSADIGGARIT = 'musadiggarit',
    TUNTEELLISET = 'tunteelliset',
    GAMERIT = 'gamerit',
    ANIMEFANIT = 'animefanit',
    SINKUT = 'sinkut',
    MONIKULTTUURISET = 'monikulttuuriset',
    KAUNIIT = 'kauniit',
    JÄRJESTELMÄLLISET = 'järjestelmälliset',
    EPÄJÄRJESTELMÄLLISET = 'epäjärjestelmälliset',
    TASA_ARVOISET = 'tasa-arvoiset',
    SOMEPERSOONAT = 'somepersoonat',
    KÄDENTAITAJAT = 'kädentaitajat',
    MUUSIKOT = 'muusikot',
    TAITEILIJAT = 'taiteilijat',
    SPÄMMÄÄJÄT = 'spämmääjät',
    KASVISSYÖJÄT = 'kasvissyöjät',
    TASAPAINOISET = 'tasapainoiset'
}

enum AgeRange {
    NONE = 'None',
    TEENAGERS = 'Teenagers',
    TODDLERS = 'Toddlers',
    ADULTS = 'Adults',
    ALL= 'All'
}

enum Goal {
    NONE = 'None',
    FIILISTELY = 'Fiilistely',
    GRINDAUS = 'Grindaus',
    INTOHIMOISUUS = 'Intohimoisuus',
    KERAILY = 'Keraily'
}

enum Language {
    NONE = 'None',
    ENGLISH = 'English',
    FINNISH = 'Finnish',
    SWEDISH = 'Swedish',
    MANDARIN_CHINESE = 'Mandarin Chinese',
    HINDI = 'Hindi',
    SPANISH = 'Spanish',
    FRENCH = 'French',
    ARABIC = 'Arabic',
    BENGALI = 'Bengali',
    RUSSIAN = 'Russian',
    PORTUGUESE = 'Portuguese',
    URDU = 'Urdu',
    INDONESIAN = 'Indonesian',
    GERMAN = 'German',
    JAPANESE = 'Japanese',
    SWAHILI = 'Swahili',
    MARATHI = 'Marathi'
}

Item model is changed and uses more enums:

export class ItemDto {
    _id: string;
    name: ItemName;
    weight: number;
    recycling: Recycling;
    qualityLevel: QualityLevel;
    unityKey: string;
    price: number;
    location: Array<number>;
    isFurniture: boolean;

    stock_id: string;
    Stock: StockDto;

    room_id: string;
    Room: RoomDto;
}

//Here are the enums used:
enum ItemName {
    SOFA_TAAKKA = 'Sofa_Taakka',
    MIRROR_TAAKKA = 'Mirror_Taakka',
    FLOORLAMP_TAAKKA = 'Floorlamp_Taakka',
    TOILET_SCHRODINGER = 'Toilet_Schrodinger',
    SINK_SCHRODINGER = 'Sink_Schrodinger',
    CLOSET_TAAKKA = 'Closet_Taakka',
    SOFATABLE_TAAKKA = 'SofaTable_Taakka',
    SIDETABLE_TAAKKA = 'SideT...
Read more

Release 03-10-2024

03 Oct 16:08
7567935
Compare
Choose a tag to compare

Changes list

New features:

  • Saving battle results
  • Moving items from Stock to SoulHome and overwise
  • Stealing items
  • Saving log files

Changes to existing features:

  • Clan has labels field, which replace the tag field
  • Player got parentalControl and above13 fields

Links

Swagger file

Release address: https://devapi.altzone.fi/release/03-10-2024

Changes detailed descriptions

Saving battle results

New endpoint /gameData/battle POST added.

It can be used for saving battles results.

That data is planned to be used for giving points to Players, as well as determining in-game tasks completion.

Moving items from Stock to SoulHome and overwise

New endpoint /item/move POST added.

It can be used whenever there are a need to move Items inside Clan: from Stock to SoulHome or from SoulHome to Stock.

It is a replacement for old item updating endpoint, since the only thing that can be changed in Item data is the stock_id and room_id fields. The endpoint abstracts updating logic for easier usability by client.

Stealing items

New /item/steal POST and GET endpoints added.

The GET endpoint can be used for checking from what place (SoulHome) Items can be stolen based on the steal_token retrieved during battle results informing.

The POST endpoint can be used for stealing itself, which means moving items from loosed Clan's SoulHome to won Clan's SoulHome.

Saving log files

New endpoint /gameAnalytics/logFile POST added.

It can be used to save log files produced during the game, which then can be retrieved and analyzed later.

Clan has labels field, which replace the tag field

The tag field which there previously a string is now deprecated and should be replaced with labels field, which is a string[] and can hold up to 5 Clan labels.

In the future release the tag field will be removed completely.

Player got parentalControl and above13 fields

Player data now holds two additional fields that was required to satisfy by Google Play's platform rules.

The value null is a default value for both fields, which means that player did not answer the age or parental approval questions.