<h1 align="center">
<br>
<a href="https://github.com/FrozenStormInteractive/Unreal-SignalR">
<img src="Docs/static/img/logo.svg" alt="Logo" width="170">
</a>
<br>
SignalR for Unreal
<br>
</h1>
## Dependencies
This plug-in requires Visual Studio and either a C++ code project or a full Unreal Engine source code from GitHub.
**This plugin does not support the MessagePack protocol for the moment, only the JSON protocol.**
## Usage
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 `<YourModule>.build.cs`:
```cs
PrivateDependencyModuleNames.AddRange(new string[]
{
"SignalR",
}
);
```
Create a hub connection with the SignalR engine subsystem:
```cpp
#include "SignalRModule.h"
#include "IHubConnection.h"
TSharedPtr<IHubConnection> Hub = GEngine->GetEngineSubsystem<USignalRSubsystem>()->CreateHubConnection("https://example.com/chathub");
```
Bind an event which is fired when the server call it to the client.
```cpp
Hub->On(TEXT("EventName")).BindLambda([](const TArray<FSignalRValue>& 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.
```cpp
Hub->Invoke(TEXT("Add"), 1, 1).BindLambda([](const FSignalRInvokeResult& Result)
{
if (!Result.HasError())
{
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.
```cpp
Hub->Send(TEXT("Add"), 1, 1);
```
## Troubleshooting
### Nothing happens when connecting to SignalR URL
Keep a reference to your connection with a shared pointer. If you don't do this, the connection object will be destroyed and therefore won't work.
Remember that the function `IHubConnection::Start` is asynchronous. When you send data after calling the function, the connection may not be complete (the data to be sent are kept on hold)
### Negotiate failed with status code 307
```
LogSignalR: Error: Negotiate failed with status code 307
```
Redirections are not yet supported. Use IP address or a domain name without redirection.
You can also disable `UseHttpsRedirection()` in ASP.NET Core.
### Peer certificate cannot be authenticated with given CA certificates
The HTTP module does not support self-signed certificates. The dotnet development certificate is not recognized by Unreal.
You can:
- use the HTTP protocol (Disable `UseHttpsRedirection()` in ASP.NET Core)
- or disable peer verification in **Project Settings** > **Engine** > **Network** > **Verify Peer**
![Disable peer verification in Unreal Project Settings](/Docs/static/img/Unreal-DisablePeerVerification.png)
## Contributing
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for instructions on how to contribute.
## License
This project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details.
```
Copyright (c) 2020-2022 Frozen Storm Interactive, Yoann Potinet
```
没有合适的资源?快使用搜索试试~ 我知道了~
虚幻引擎的SignalR客户端_C++_C_下载.zip
共79个文件
h:17个
cpp:15个
md:12个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 78 浏览量
2023-04-26
11:31:24
上传
评论
收藏 427KB ZIP 举报
温馨提示
虚幻引擎的SignalR客户端_C++_C_下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
虚幻引擎的SignalR客户端_C++_C_下载.zip (79个子文件)
Unreal-SignalR-master
.editorconfig 176B
Source
SignalRBlueprint
Private
SignalRHubConnectionWrapper.cpp 3KB
SignalRBlueprintFunctionLibrary.cpp 4KB
SignalRBlueprintSubsystem.cpp 2KB
SignalRBlueprintModule.cpp 1KB
SignalRValueWrapper.cpp 3KB
SignalRBlueprint.Build.cs 2KB
Public
SignalRHubConnectionWrapper.h 3KB
SignalRValueWrapper.h 2KB
SignalRBlueprintSubsystem.h 2KB
SignalRBlueprintFunctionLibrary.h 4KB
SignalR
Private
HandshakeProtocol.h 1KB
Connection.h 2KB
IHubProtocol.h 4KB
StringUtils.cpp 1KB
StringUtils.h 1KB
HubConnection.h 4KB
HandshakeProtocol.cpp 3KB
IHubProtocol.cpp 1KB
Connection.cpp 9KB
IHubConnection.cpp 1KB
CallbackManager.cpp 3KB
MessageType.h 1KB
CallbackManager.h 2KB
SignalRModule.cpp 2KB
JsonHubProtocol.h 2KB
SignalRSubsystem.cpp 1KB
JsonHubProtocol.cpp 13KB
HubConnection.cpp 11KB
NegotiationResponse.h 2KB
Public
SignalRModule.h 2KB
SignalRSubsystem.h 2KB
SignalRValue.h 10KB
IHubConnection.h 5KB
SignalR.Build.cs 2KB
.github
workflows
docs.yml 1KB
.ueplugin.json 165B
CONTRIBUTING.md 1KB
Docs
docusaurus.config.js 3KB
babel.config.js 89B
sidebars.js 781B
src
pages
index.module.css 365B
index.tsx 1KB
markdown-page.md 118B
components
HomepageFeatures
index.tsx 2KB
styles.module.css 138B
css
custom.css 1KB
docs
tutorial-extras
manage-docs-versions.md 1KB
_category_.json 99B
img
docsVersionDropdown.png 25KB
localeDropdown.png 27KB
translate-your-site.md 2KB
intro.md 1KB
tutorial-basics
create-a-blog-post.md 883B
markdown-features.mdx 3KB
create-a-document.md 1KB
_category_.json 180B
deploy-your-site.md 702B
create-a-page.md 1015B
congratulations.md 1KB
package.json 1KB
package-lock.json 862KB
.gitignore 233B
tsconfig.json 190B
static
.nojekyll 0B
img
undraw_docusaurus_mountain.svg 31KB
undraw_docusaurus_tree.svg 12KB
docusaurus.png 5KB
logo.svg 603B
undraw_docusaurus_react.svg 35KB
Unreal-DisablePeerVerification.png 56KB
favicon.ico 4KB
README.md 770B
Resources
Icon128.png 3KB
Config
FilterPlugin.ini 86B
SignalR.uplugin 779B
.gitignore 33B
README.md 4KB
License.txt 1KB
共 79 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- python-leetcode面试题解之第162题寻找峰值-题解.zip
- python-leetcode面试题解之第161题相隔为1的编辑距离-题解.zip
- python-leetcode面试题解之第160题相交链表-题解.zip
- python-leetcode面试题解之第159题至少包含两个不同字符的最长子串-题解.zip
- python-leetcode面试题解之第158题用Read4读取N个字符II-多次调用-题解.zip
- Python 程序语言设计模式思路-行为型模式:策略模式:将算法封装成独立的类,并使它们可以互相替换及支付模式数据压缩
- main.py
- Last Loaded Test.DBK
- Screenshot_20240520_163011.jpg
- ubuntu-python3-whisper-tornado docker镜像 Dockerfile
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功