Conversation
+ AbsPosition_ThreadFree + Start of Multiplayer client & server
…ernions (Compatible with OH2.5.3)
+ Use nuget version of OH in multiplayer
space928
left a comment
There was a problem hiding this comment.
This is very messy for an example, please tidy it up and follow the prescribed code style.
| //vehicle.AbsPosition_Inv = update.abs_position_inv; | ||
| i++; | ||
| } | ||
| else |
| readonly static int MINOR_VERSION = 0; | ||
| public static void ParseMessage(byte[] message, Telepathy.Client client, GameClient gameClient) | ||
| { | ||
| message.AsSpan<byte>(0, message.Length); |
There was a problem hiding this comment.
Why not use this lovely span you just made?
| { | ||
| internal class GameClient | ||
| { | ||
| public Tuple<int, long, long> LastPing; |
There was a problem hiding this comment.
Tuple<int, long, long> LastPing --> (int xxx, long yyy, long zzz) lastPing
| default: | ||
| { | ||
| Console.WriteLine($"Data received {message}"); | ||
| break; |
There was a problem hiding this comment.
Please be consistent with where you put your break statements.
| while (true) | ||
| { | ||
| Telepathy.Message msg; | ||
| while (client.GetNextMessage(out msg)) |
There was a problem hiding this comment.
Just realised that the version of Telepathy on NuGet is really out of date (from 2019)...
Latest build is here: https://github.com/MirrorNetworking/Telepathy/actions/runs/10029006044
Anyway, is this a blocking method? If so, why do you thread sleep at the end of this method?
| { | ||
| case OMSIMPMessages.Messages.REQUEST_VERSION: | ||
| { | ||
| byte[] buff = new byte[12]; |
There was a problem hiding this comment.
Again, this is an avoidable allocation...
No description provided.