Comments (6)
You can use this plug-in as a project plug-in, or an Engine plug-in:
If you use it as a project plug-in, clone this repository into your project's Plugins directory and compile your game in Visual Studio. A C++ code project is required for this to work.
If you use it as an Engine plug-in, clone this repository into the Engine/Plugins directory and compile your game. Full Unreal Engine source code from GitHub is required for this.
This plug-in is enabled by default, so no need to enable it in the plug-in browser.
Link the SignalR module to to yours with PublicDependencyModuleNames or PrivateDependencyModuleNames in .build.cs:
PrivateDependencyModuleNames.AddRange(new string[]
{
"SignalR",
}
);
Create a hub connection with the SignalR engine subsystem:
#include "SignalRModule.h"
#include "IHubConnection.h"
TSharedPtr Hub = GEngine->GetEngineSubsystem()->CreateHubConnection("https://example.com/chathub");
Bind an event which is fired when the server call it to the client.
Hub->On(TEXT("EventName")).BindLambda([](const TArray& Arguments) {
...
});
Invoke fires an event when the server has finished invoking the method (or an error occurred). In addition, the event can receive a result from the server method, if the server returns a result.
Hub->Invoke(TEXT("Add"), 1, 1).BindLambda([](const FSignalRValue& Result) {
UE_LOG(LogTemp, Warning, TEXT("The result value is: %d"), Result.AsInt());
});
Unlike the Invoke method, the Send method doesn't wait for a response from the server.
Hub->Send(TEXT("Add"), 1, 1);
from unreal-signalr.
That’s what i have been doing for 5 days,
But nothing happened
Not even logs tells anything
Even OnConnectionError
And this library is the only for SignalR in UE :(
from unreal-signalr.
@mostafabder1 Have you called IHubConnection::Start()
after binding the events ?
from unreal-signalr.
Yup, i did multiple debugging in Connection.Cpp , i found that FConnection::Negotiate has been called but the HttpRequest->OnProcessRequestComplete() listner doesn't been called so that never reached FConnection::OnNegotiateResponse
from unreal-signalr.
The plugin is definitely working, but strange enough, logs are not. I can confirm that. However, in the debug build, I was able to set break points to see, all is working as expected.
@mostafabder1 Try debug config and break-points
from unreal-signalr.
@mostafabder1 You just need to persist a reference to the connection object somewhere in your code to ensure that the object is not destroyed when the pointer is destroyed. As the functions are asynchronous, the shared pointer deletes the connection object before the negotiation with the server ended if there are no more references to the connection object.
from unreal-signalr.
Related Issues (16)
- Hi, please add documentation on how to use this plugin HOT 11
- HTTPS/SSL issues HOT 5
- OnNegociateResponse never called HOT 2
- double not supported by blueprints HOT 1
- How to support MessagePack?
- how to subscribe to an event in blueprint HOT 1
- Unreal crashes if web socket host is not reachable
- Web Socket negotiation fails if hub is protected by authorization HOT 1
- Unreal project won't open after enabling the SignalR plugin. HOT 2
- Dear plugin owner, give us please example of usage this plugin via c++
- Updates and Blueprints HOT 3
- Please add auto connection after disconnection error 1006 HOT 1
- I can't receive messages HOT 2
- Packaging error for Android ASTC / Client HOT 2
- We have implemented this into our windows build but wanted to also attempt to have it implemented into our Android build. We're running into seemingly TMAP issues and get 13 errors on compile. Is this something that may be worked on in the future or do you have ideas currently on the full implementation? Almost everything leads back to Map.h HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unreal-signalr.