Comments (15)
it is caused from does not call RegisterStreamingMethod before call at once.
requires OnJoin before Broadcast...
However, null is not desirable, so I'd like to fix it.
thanks.
from magiconion.
So how do I fix this problem now?
from magiconion.
Who calls BroadcastAll?
In the chat scenario, although I think that someone will surely start after Join.
from magiconion.
public async Task<ServerStreamingResult<ChatRoomMember>> OnJoin()
{
return await GetStreamingContextRepository().RegisterStreamingMethod(this, OnJoin);
}
from magiconion.
Now this problem can not be resolved, there are other ways, I do not know where to modify.
from magiconion.
please show reproduce client code.
below code is works fine.
static async Task RunChat(ChannelContext ctx)
{
// create room
var client = ctx.CreateClient<IChatRoomService>();
var room = await await client.CreateNewRoom("test", "A"); // TODO:IChatRoomCommand sample is old so require await await...
var result = await await client.SendMessage(room.Id, "foo bar baz");
Console.WriteLine("Send success:" + result);
}
from magiconion.
public IEnumerator Join(string roomId, string nickName)
{
var r = client.Join(roomId, nickName).ResponseAsync.ToYieldInstruction();
yield return r;
}
from magiconion.
Do you need to do two "ToYieldInstruction" here?
from magiconion.
ah, sorry, require subscribe OnJoin before do anything.
from magiconion.
I've fixed sample code and upload v0.5.1.1
includes this fix.
4d1c8af
main fix is add new api, when creating StreamingContextRepository
new StreamingContextRepository<IChatRoomStreaming>(connection, this);
from magiconion.
Sorry, did not see the version update!
from magiconion.
public async UnaryResult<RoomResponse> CreateNewRoom(string roomName, string nickName)
Are you sure you can write this way?
Why the editor that need to add Task , or can not use async.
from magiconion.
this is for C# 7.0 only, if you have to use old c#, change signature to Task<UnaryResult<T>>
.
(but for Unity, generates IObservable<T>
code).
from magiconion.
public interface IChatRoomCommand
{
IObservable<UnaryResult<global::ShareType.RoomResponse>> CreateNewRoom(string roomName, string nickName);
}
Does Unity3d need this?
from magiconion.
moc.exe
automatically convert and generate interface.
like this https://github.com/neuecc/MagicOnion/blob/master/src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnionGenerated.cs#L369-L381
from magiconion.
Related Issues (20)
- Upgrade Grpc.Net.Client in MagicOnion.Client
- Incorrect deserialize on using Unity client and MemoryPack HOT 4
- MagicOnion.Generated.cs fails to compile in unity HOT 6
- StreamingHubClientBase exception handling error
- Unhandleable exceptions when connecting HOT 1
- Question: any thoughts on reliable UDP or QUIC? And QoS?
- Question: How can I connect the TLS protocol to the new version (v5.1.8)? HOT 1
- Question: Possible to use Task and ValueTask instead of UnaryResult and such? HOT 1
- Question: ObjectDisposedException on proxy side
- Question: Is a MagicOnion server possible from within Unity?
- can support Webgl http2 and net8?
- I can't have multiple implementations!
- .NET 8 Support
- Client filter is not triggered for ServerStreamingResult method in services. HOT 1
- Performance is very slow, taking 355ms for the Add function to return the result HOT 2
- How can I disconnect a client by server?
- InternalsVisibleTo lead to warnings on dependent project HOT 1
- Implement Protobuf Endpoint
- ServerReflection does not work
- Cannot work after changing to MemoryPack 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 magiconion.