Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UrealSDK] Creating requests should work in all versions of UE4 #1944

Merged
merged 3 commits into from
Feb 23, 2021
Merged

[UrealSDK] Creating requests should work in all versions of UE4 #1944

merged 3 commits into from
Feb 23, 2021

Conversation

domgreen
Copy link
Contributor

@domgreen domgreen commented Jan 6, 2021

What type of PR is this?
/kind hotfix

What this PR does / Why we need it:

We are replacing the usage if TSharedRef<IHttpRequest> with FHttpRequestRef to allow it to work across versions.

It seems that this basically a typedef under the hood to make this work nicely for the current versions.

Which issue(s) this PR fixes:
Closes #1940

Special notes for your reviewer:

  • Have tested with 4.25.1
  • Need to have someone test with 4.26 prior to merging.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 605939e3-5c9f-4e62-9b3b-270f0dd44006

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@domgreen
Copy link
Contributor Author

domgreen commented Jan 6, 2021

^ had a look at build log seems like the tests failed ... nothing jumped out at me apart from website failing to build:

includes/website.mk:72: recipe for target 'site-test' failed
make[1]: Leaving directory '/workspace/build'
includes/website.mk:65: recipe for target 'hugo-test' failed

Copy link
Collaborator

@aLekSer aLekSer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change seems reasonable to me.

@domgreen
Copy link
Contributor Author

domgreen commented Jan 6, 2021

Thanks @aLekSer will wait for confirmation of it working wtih 4.26 before asking for a merge

@comerford
Copy link
Contributor

good news and bad news - the good news is that the version of the plugin from Dom compiled just fine, the bad news is that so did the previous version. This is either due to the fact that we use a customised version of the engine or it is because we only have limited usage of the plugin so far (the end game state change is not yet wired up for example). Seems like I am a poor tester for this one for now.

@domgreen
Copy link
Contributor Author

domgreen commented Jan 7, 2021

Thanks for trying @comerford 👍

As @gamedevix is the original reporter might be best to see if they can see it being fixed with this fork.

@domgreen
Copy link
Contributor Author

domgreen commented Jan 7, 2021

As mentioned on #1940 by @Gamedevix , this is due to our return type still being:

TSharedRef<IHttpRequest> UAgonesComponent::BuildAgonesRequest

This explains why it compiles for me and not in 4.26 will muse over it ... ideas welcome 👍

@comerford
Copy link
Contributor

@domgreen Does specifying the ESPMode explicitly rather than using auto break older versions?

TSharedRef<IHttpRequest, ESPMode::ThreadSafe> Request = Http->CreateRequest();

@domgreen
Copy link
Contributor Author

domgreen commented Jan 7, 2021

So the issue is that in 4.25.1 its:

TSharedRef<IHttpRequest, ESPMode::Fast> Request = Http->CreateRequest();

Meaning that the signature of CreateRequest seems to have changed ... some more digging required 😄

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just kicking this to "request changes" so it doesn't get accidentally merged until we can work out a good fix 👍

@domgreen domgreen changed the title Using auto for createrequest [UrealSDK] Creating requests should work in all versions of UE4 Jan 23, 2021
@domgreen
Copy link
Contributor Author

@Gamedevix @comerford @mbc-audiovisuales would you mind checking this wiht 4.26

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 7be2a2b2-8f83-4054-9393-d9de6897fa07

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/1944/head:pr_1944 && git checkout pr_1944
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.12.0-ae0ff73

@markmandel markmandel added the feature-freeze-do-not-merge Only eligible to be merged once we are out of feature freeze (next full release) label Jan 26, 2021
Base automatically changed from master to main February 4, 2021 00:09
@highlyunavailable
Copy link
Contributor

This is a required change for me to use Agones with 4.26 - it compiles fine on 4.26.1 and I had to manually patch the Agones SDK with these changes to get it to compile. What is blocking a merge of this? I can help test it on 4.25 and 4.26 if needed.

@markmandel
Copy link
Member

@domgreen to confirm, but I'm pretty sure that testing on a variety of versions is the blocking issue.

If we can confirm the fix works across versions, I'm good to merge 👍

@highlyunavailable
Copy link
Contributor

If we just need a variety of versions I can provide that, given the matrix you need tested. I have 4.25.3 and 4.26.1 are immediately available, but I can try to get more if needed.

Apologies if you already know this as well, but the other method (rather than using auto for the variable type) is to use #IF by doing the following:

#include "Runtime/Launch/Resources/Version.h"

And then wrap the signature or variable assignments in the code:

#if ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION >= 26 && ENGINE_PATCH_VERSION >= 0
    FHttpRequestRef BuildAgonesRequest(FString Path = "", const FHttpVerb Verb = FHttpVerb::Post, const FString Content = "{}");
#else
    TSharedRef<IHttpRequest> BuildAgonesRequest(FString Path = "", const FHttpVerb Verb = FHttpVerb::Post, const FString Content = "{}");
#endif

It's a little messier looking but it removes the need for auto if that's also a blocker and this is the supported Unreal Way to do changes across versions like this and is used in multiple portions of the engine.

@domgreen
Copy link
Contributor Author

@markmandel yeah just waiting on confirmation that it works on 4.26.1 I have it working with 4.25.4 and UDN says this should work with all versions just haven't had confirmation till now👍

@highlyunavailable thank you so much for testing and recommendations

@domgreen
Copy link
Contributor Author

@markmandel i think with this confirmation we are good to merge 👯

@highlyunavailable
Copy link
Contributor

yeah just waiting on confirmation that it works on 4.26.1 I have it working with 4.25.4 and UDN says this should work with all versions just haven't had confirmation till now👍

Yep it absolutely does. If you ever need Unreal testing feel free to @ me, I'm an Unreal jockey at the moment and happy to wrangle the CPP.

@markmandel
Copy link
Member

Sweet. I'll hit that approve button!

@google-oss-robot
Copy link

New changes are detected. LGTM label has been removed.

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aLekSer, domgreen, markmandel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aLekSer, domgreen, markmandel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 70286345-d156-4efb-bac3-f017e2dd3f14

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/1944/head:pr_1944 && git checkout pr_1944
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.13.0-79a8de3

@markmandel markmandel added area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/bug These are bugs. and removed feature-freeze-do-not-merge Only eligible to be merged once we are out of feature freeze (next full release) labels Feb 23, 2021
@markmandel markmandel added this to the 1.13.0 milestone Feb 23, 2021
@markmandel markmandel merged commit da4d592 into googleforgames:main Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc cla: yes kind/bug These are bugs. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to COMPILE after added agones plugin in UE4.26
7 participants