Giter Club home page Giter Club logo

peacock's Introduction

The Peacock Project

Discord

The Peacock Project is a HITMAN World of Assassination Trilogy server replacement. The primary purpose is preservation of the game, but it also adds new features and content to the game, and allows for other enhancements to be made while in online mode.

Installation

Install Node.js. Use the Latest version, or the version specifically mentioned here: Version 20

Clone the repository where-ever you wish.

Open Windows terminal AS ADMINISTRATOR.

Install Yarn, by typing:

corepack enable

Then move to the folder where you cloned the repo to by using:

cd Folder/Path/Here

then install the dependencies by using:

yarn install

Usage

The project is bundled with a server running configuration. Run that when editing the project with the IDE of choice, and it should open.

We highly suggest you use WebStorm for development, but it is a paid product, so you may want to choose something like Visual Studio Code. WebStorm will provide a better experience for development, but VSCode will work just fine.

Contributing

To contribute, you can use Pull Requests from your own fork. You can fix bugs reported in issues or add new features you think would be useful, new features not listed in issues would have to be discussed before merging.

Localisation

Automated

The Peacock repository has an automated workflow to rebuild locale packages. All you need to do to update localisation files is:

  1. Edit locale.json.
    • If you're adding new strings, make sure to add the English versions to all languages.
    • If you're translating existing strings, you only need to translate the ones that are in the language(s) you are translating.
  2. Then push locale.json.
  3. Then, make a Pull Request. When it is reviewed and merged, locale packages will automatically be rebuilt.

Manual

If you need to manually rebuild locale packages for whatever reason (testing or otherwise), follow steps 1 and 2 above, then do the following:

  1. Make sure rpkg_cli.exe, HMLanguageTools.exe, and ResourceLib_*.dll are in the resources folder.
  2. Then, from the root project folder, run yarn rebuild-locale.
  3. These generated RPKGs should not be pushed or merged into Peacock as the automated workflow will take care of this for you.

Thank you to people who have contributed!

License

Peacock is under the AGPL-3.0 license, see the license file for more info.

Credits

Peacock started off as a fork of LocalGhost by grappigegovert, and has since been rewritten in TypeScript, and a whole host of new features have been added. The codebase has been relicensed to AGPL-3.0 with explicit permission from grappigegovert.

The game is owned by IO Interactive, and is not affiliated with this project in any way.

peacock's People

Contributors

0x-faded avatar alex73630 avatar amdr3b4st0s avatar anthonyfuller avatar atampy25 avatar cookie303728 avatar dependabot[bot] avatar grappigegovert avatar j0k3r-1 avatar jorys-paulin avatar lennardf1989 avatar million1156 avatar moonysolari avatar nachito33 avatar nekoxiii avatar peacockbot avatar prolium avatar rdil avatar riisikumi avatar scrungofan avatar solderq35 avatar suanjiansalt avatar vitphire avatar volkerschlegel avatar watchman3001 avatar winnnty avatar winnodd avatar wuzmart avatar yanrishatum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

peacock's Issues

New DLCs are not displayed without deleting `userdata`

When the user acquires new DLCs, Peacock will not know about it unless the user deletes userdata.

One solution is to get and overwrite the user's entitlements every time the user authenticates, and do not rely on past entitlement data.

Duplicate Ancestral Fountain Pens in the inventory

Originally reported by @NekoXIII.

PROP_DEVICE_REMOTE_EXPLOSIVE_ANCESTRAL has the same RepositoryId as PROP_DEVICE_EXPLODING_FOUNTAIN_PEN_ANCESTRAL and is believed to be causing this problem. Further investigation is needed to determine whether the former is a broken item or just an item with an incorrect RepositoryId in the files. I personally do not recall there being an "Ancestral Remote Explosive Device".

H2016 and Challenges

A love story for the ages... Our current challenge implementation does not work on Hitman 2016, upon trying to start a contract e.g. Showstopper. Peacock will error and the game will display an error message: "Error Starting Contract".

  • @AnthonyFuller

  • CAREER -> CHALLENGES page.

  • Add challenges for normal difficulty.

  • Add challenges for pro1 difficulty.

  • Fix challenge completion status.

  • Support location-wide challenges. What makes this difficult is that H1 lacks the Type field in its challenge definitions.

Wrong token and sessionID saved when game saves

Describe the bug

When /authentication/api/userchannel/ProfileService/UpdateUserSaveFileTable is accessed, the client sends not just one, but an entire list of metadata of multiple saves. This is currently handled by always taking the last item from the list and using its token and sessionID to save the current session. However, this is not always correct, as the list is not sorted with respect to the timestamp.

To reproduce

  • Add log(LogLevel.DEBUG, JSON.stringify(req.body.clientSaveFileList)) at the start of the function that handles the request (attached below).
  • Compile and run Peacock. Start the game with it.
  • Start any mission with saves enabled.
  • Try saving the game at different save slots and observe the output.

Additional context

Peacock version v5.6.2.

A possible solution is to sort the list with respect to the timestamp and use the token and sessionID of the latest save.

profileRouter.post(
"/ProfileService/UpdateUserSaveFileTable",
jsonMiddleware(),
async (req, res) => {
if (req.body.clientSaveFileList.length > 0) {
const save =
req.body.clientSaveFileList[
req.body.clientSaveFileList.length - 1
]
try {
await saveSession(
save.ContractSessionId,
save.Value.LastEventToken,
)
} catch (e) {
log(
LogLevel.WARN,
`Unable to save session ${save?.ContractSessionId}`,
)
if (PEACOCK_DEV) {
log(LogLevel.DEBUG, e.name)
}
}
}
res.status(204).end()
},
)

Sample output in chronological order (tested on The Finishing Line):
Saving in save slot 1 caused the client to send the following SaveFile list

[
   {
      "ContractSessionId":"598676657372700-0b3af383-2f2c-4a2a-a13e-7b687dd37a97",
      "TimeStamp":1673215743,
      "Value":{
         "Name":"QuickSave0",
         "LastEventToken":"598708361135300"
      }
   }
]

After that, saving in save slot 2 caused the client to send the following SaveFile list

[
   {
      "ContractSessionId":"598676657372700-0b3af383-2f2c-4a2a-a13e-7b687dd37a97",
      "TimeStamp":1673215743,
      "Value":{
         "Name":"QuickSave0",
         "LastEventToken":"598708361135300"
      }
   },
   {
      "ContractSessionId":"598676657372700-0b3af383-2f2c-4a2a-a13e-7b687dd37a97",
      "TimeStamp":1673215837,
      "Value":{
         "Name":"QuickSave1",
         "LastEventToken":"598800038190100"
      }
   }
]

After that, saving in save slot 3 caused the client to send the following SaveFile list

[
   {
      "ContractSessionId":"598676657372700-0b3af383-2f2c-4a2a-a13e-7b687dd37a97",
      "TimeStamp":1673215743,
      "Value":{
         "Name":"QuickSave0",
         "LastEventToken":"598708361135300"
      }
   },
   {
      "ContractSessionId":"598676657372700-0b3af383-2f2c-4a2a-a13e-7b687dd37a97",
      "TimeStamp":1673215837,
      "Value":{
         "Name":"QuickSave1",
         "LastEventToken":"598800038190100"
      }
   },
   {
      "ContractSessionId":"598676657372700-0b3af383-2f2c-4a2a-a13e-7b687dd37a97",
      "TimeStamp":1673215872,
      "Value":{
         "Name":"QuickSave2",
         "LastEventToken":"598800038190100"
      }
   }
]

After that, saving in save slot 1 caused the client to send the following SaveFile list (note that the latest save is in QuickSave0 according to the timestamp!)

[
   {
      "ContractSessionId":"598676657372700-0b3af383-2f2c-4a2a-a13e-7b687dd37a97",
      "TimeStamp":1673215905,
      "Value":{
         "Name":"QuickSave0",
         "LastEventToken":"598865889955100"
      }
   },
   {
      "ContractSessionId":"598676657372700-0b3af383-2f2c-4a2a-a13e-7b687dd37a97",
      "TimeStamp":1673215837,
      "Value":{
         "Name":"QuickSave1",
         "LastEventToken":"598800038190100"
      }
   },
   {
      "ContractSessionId":"598676657372700-0b3af383-2f2c-4a2a-a13e-7b687dd37a97",
      "TimeStamp":1673215872,
      "Value":{
         "Name":"QuickSave2",
         "LastEventToken":"598800038190100"
      }
   }
]

After that, an autosave caused the client to send the following SaveFile list (note that the latest save is in AutoSave 3 according to the timestamp!)

[
   {
      "ContractSessionId":"598676657372700-0b3af383-2f2c-4a2a-a13e-7b687dd37a97",
      "TimeStamp":1673216128,
      "Value":{
         "Name":"AutoSave3",
         "LastEventToken":"599092639570600"
      }
   },
   {
      "ContractSessionId":"598676657372700-0b3af383-2f2c-4a2a-a13e-7b687dd37a97",
      "TimeStamp":1673215905,
      "Value":{
         "Name":"QuickSave0",
         "LastEventToken":"598865889955100"
      }
   },
   {
      "ContractSessionId":"598676657372700-0b3af383-2f2c-4a2a-a13e-7b687dd37a97",
      "TimeStamp":1673215837,
      "Value":{
         "Name":"QuickSave1",
         "LastEventToken":"598800038190100"
      }
   },
   {
      "ContractSessionId":"598676657372700-0b3af383-2f2c-4a2a-a13e-7b687dd37a97",
      "TimeStamp":1673215872,
      "Value":{
         "Name":"QuickSave2",
         "LastEventToken":"598800038190100"
      }
   }
]

Error loading contracts if their files don't exist locally

All hell breaks loose when loading contracts if their files don't exist in the folder (e.g. deleted by the user).

A possible solution is to either detect this failure case and return an error to the client, or download the contract on-the-fly.

H1/H2 contract creation displays unwanted tiles

H1 contract creation has all Patient Zero missions, which are unwanted and unfunctional except for The Source.

H2 contract creation has Arrival, Freeform Training, all side missions, sniper missions, and Patient Zero missions besides the Source. All of these are unwanted and unfunctional, except for The Source.

Broken challenges

Investigate broken challenges. See comments on this issue for the full list:

Support sniper multiplayer

  • Support starting a co-op sniper assassin mission.
  • Support co-op sniper rifle masteries.
  • Support co-op sniper progression.
  • Support co-op sniper mission scoring, dependent on #7 .

Favorite contracts rework

  • Support pressing P to favorite a contract (Needs investigation. The functions are there but don't work for some reason).
  • Support pressing P to delete a contract from the favorite list.
  • Support deleting a contract from the favorite list after having looked it up with its public ID.
  • Support multiple deletion on the favorite page.
  • Support the favorite (heart) icon on favorited contracts

"Discover XX" challenges not working

Map discovery is tracked by the game using PersistentBools. The game manages them by itself, and sends them to the server. The server can decide what to do with them, and currently they are not used at all in Peacock.

One implementation is to ignore these values and track the completion purely on server-side. Another is to make use of them, but then the progression won't be resettable via deleting the userdata folder.

Different challenges for different games

  • Original thread: https://discord.com/channels/826809653181808651/1067796022199332890
  • Originally tracked in #90. It now has its own issue because it was not introduced by v6 since it already existed in v5, and getting it fixed before v6 releases might not be a priority.
  • This bug arises from challenges belonging in different categories in different game versions.
    • E.g. in H1, "The Classics" challenges like silent assassin are in the "assassination" category.
    • For each location, we might need a separate "challenges.json" file for each game version in the future.
  • Add challenges data in json files for all three games.
  • Support looking up challenges using game version.
  • Support difficulty-aware challenges in H1 & H2.

Support profile-scoped challenges

Add support for challenges regarding

  • Elusive targets.
  • Elusive target arcades. Dependent on #17.
  • Featured contracts.
  • The Classics, across several maps.
  • Number of escalations completed

Different Mastery progressions for different games

All games currently have the same mastery items as H3 on Peacock. However, H1, H2 and H3 do not have the same mastery progression on every location. E.g. Hawkes Bay Lvl. 5 should not have Tanto in H2.

Originally tracked in #90 .

Option for log filters

The possibility to only have certain things logged in the start server.cmd window.
(I.E. Startup messages, mission end times)

Item not included in peacock

i have bought the trilogy pack on steam, but some items with peacock are not included, as far as i know is only one, the ica19 classicballer

The entP array in the user profile is

 ["1659040","1829592","1829593","1829594","1829600","1829601","1829602","1829603","1829604","1829605"]

H2 bug when looking up an already downloaded contract

Previously got the following warning when trying to lookup an already downloaded contract on H2. Needs more investigation.

[Warn] Unable to save session [sessionID] because the session does not exist in the server's memory.

The Steam version of the game saves every 3 seconds on Peacock

Reported multiple times.

Possibly caused by /authentication/api/userchannel/ProfileService/GetPlatformEntitlements. If the game is not satisfied with the response to this request, it will send this request again and again. Each time it sends this request, it will also send one /authentication/api/userchannel/ProfileService/SynchronizeOfflineUnlockables and one /authentication/api/userchannel/ProfileService/UpdateUserSaveFileTable request. The latter causes the "Saving..." banner to pop in the bottom-right corner of the game.

Exactly what the game is looking for in the response of GetPlatformEntitlements is unknown. I succeeded in reproducing this bug if I set the response to an empty array. More investigation is needed.

Duplicate tiles of finished challenges at the end of the mission

Peacock version: 5.4.0
Game: Hitman III (Epic games)

Currently, finished challenges will have duplicate tiles at the end of the mission. This applies to any finished challenges, not only those that were finished during the current run, but also those finished in previous runs.

image

Disconnections pop up out of nowhere

From time to time, the game randomly pops up the "Disconnected" window. Pressing "retry" often fixes it and resumes the connection. When this happens is entirely unpredictable.

Logging the requests and responses of /api/metrics/add calls yielded the following results. Credits to @fu5ha for considering this approach first.

{
    "Name": "PlayerDisconnected",
    "Properties": {
        "ProfileId": "moony",
        "ServerConfig": "pc-prod",
        "ServerVersion": "8.10.0",
        "ErrorCode": 12030,
        "ErrorState": 4,
        "ErrorString": "There was a network error. Please check your internet connection.",
        "FailedRequestUrl": "UpdateCheckNetworkStatus:http://127.0.0.1/authentication/api/userchannel/GamePersistentDataService/GetData",
        "ReconnectFailed": false,
        "PreviousState": 38,
        "RetryCount": 0,
        "SecondsSinceLastSuspendChanged": 4094.467285,
        "SuccessfulRequestsSinceLastSuspend": 156,
        "Scene": "assembly:/_PRO/Scenes/Frontend/MainMenu.entity",
        "InLoadTransition": false,
        "GameTime": 490.956329
    },
    "UserId": "moony",
    "PlatformUserId": "moony",
    "SessionId": "moony",
    "Agg": "20210107",
    "Platform": "epic",
    "Version": "8.10.0",
    "GameVersion": "3, 130, 0, 0",
    "Config": "pc-prod",
    "IssuerId": "moony",
    "GameMode": "normal"
}

12030 is a WinHttp error code ERROR_WINHTTP_CONNECTION_ERROR. Across different disconnection instances, the error number has always been observed to be 12030, but the request url may vary.

It is possible that the problem is not how these requests are dealt with, it's that Peacock never got those requests in the first place. On this note, it is more likely a bug of the patcher.

Known issues in v6.0.0 alpha-1

  • H2 CAREER -> CHALLENGES page:
    • PATIENT ZERO: not working.
    • Elusive challenges: not implemented.
    • ICA SHIP: not showing.
  • Mastery:
    • All games have the same mastery items as H3, which is incorrect for some locations. E.g. Hawkes Bay Lvl. 5 should not have Tanto in H2.
  • Some sublocation-specific challenges are not working on the planning page in H1 and H2. They do not correctly show the link to the mission under the challenge tile.
  • #93

ET page now broken

The ET page no longer works as of the latest game bump.

We need to fix this, and backport to v5.

Release Checklist: v5.7.0

Scheduled date: 1-27-2023

  • Maintenance has started
    • Put out announcement that maintenance has started
  • Server version bumped
    • Bump server version in code
  • Update image pack
  • Update store data
  • Update unlockables
  • Add new gamechangers [SKIPPED FOR v6]
  • Add new entrances and agency pickups (If applicable)
  • Add new entitlements
  • Bump version
  • Release the build
    • Announce release on Discord

Team: as per usual, feel free to modify to add any missing tasks, or to claim a task (put your @ next to a task)

Support gamepass

! Still up for debate as to how/if this should be implemented.

  • Support Xbox gamepass on the server end
  • Support Xbox gamepass on the patcher end

Game spams `/SaveEvents2` during Freelancer gameplay

Reported a few times. The game spams /SaveEvents2 during Freelancer gameplay. This is observed more often after exiting the level and before the mission end scene. This bug has happened before on v4 during normal gameplay but I don't know how it was resolved or by whom. I have not been able to reproduce this bug.
image

Escalation challenges are not hooked to the corresponding escalations

Describe the bug

  • Finishing an escalation mission does not complete the corresponding escalation challenge.
  • No escalation challenge can be found under the "FEATS" category on the Challenges tab in the planning page of any escalation mission, in the F1 page in-game, or on the mission-end screen.
  • When viewed on the Challenges tab in the location page, no escalation challenge shows the shortcut to the corresponding escalation mission below its tile (see screenshots).

Additional context
Official:
image
Peacock:
image

Missing images

  • The roadmap image. Error stack:
[03:35:17:903] [Debug] [Image loading] Err AxiosError: Request failed with status code 404 AxiosError: Request failed with status code 404
    at settle (C:\games\Peacock\node_modules\axios\lib\core\settle.js:19:12)
    at RedirectableRequest.handleResponse (C:\games\Peacock\node_modules\axios\lib\adapters\http.js:460:9)
    at RedirectableRequest.emit (node:events:513:28)
    at RedirectableRequest._processResponse (C:\games\Peacock\node_modules\follow-redirects\index.js:356:10)
    at RedirectableRequest._onNativeResponse (C:\games\Peacock\node_modules\follow-redirects\index.js:62:10)
    at Object.onceWrapper (node:events:628:26)
    at ClientRequest.emit (node:events:513:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:693:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17)
    at TLSSocket.socketOnData (node:_http_client:534:22)
  • Some Featured Contracts' cover images

image

image

Saving is enabled where on official servers it isn't

As of version 5.4.2, on Peacock players are able to save in some of the missions not savable on official:

  • Some escalations:
    • The Rafael Misadventure in Isle of Sgàil
    • The Simmons Concussion in Miami
    • The Mills Reverie, level 3

Is this an intended feature or a bug? My guess is that it's a feature except for the escalations.

Image and text for empty categories are missing when filters are applied on challenge pages

Describe the bug
When a filter is applied on a challenge page (e.g. SHOW COMPLETED), no image or text is shown for categories that have no challenges to show.

To reproduce

  • Delete the userdata folder.
  • Launch the game with Peacock..
  • Go to the challenges page of any mission/destination with challenges implemented.
  • Change the filter to SHOW COMPLETED.

Additional context
image

Support contract menus that require communication with official servers

Three contract menu tiles that require communication with official servers are currently unimplemented:

  • Trending
  • Most played last week
  • Contract search

One solution is to send the request to the official servers to get a list of contracts to show to the user, but only download a contract itself when it is requested by a user.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.