-
Notifications
You must be signed in to change notification settings - Fork 13
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
Releases? #7
Comments
Hello @hmlendea I'm not actively developing this project but the master branch should have a complete functional working RS317 C# client. I haven't published builds because I'd prefer to setup some auto-build rather than do releases manually. There are two client implementations. One might work with the mono runtime on Linux but it depends on Winforms/GDI so I'm not 100% sure, it should maybe work on monoforms though. The other is the OpenTK/OpenGL version, not sure it that'll work on Linux as I haven't tried. OpenTK doesn't officially support .NET Core yet either. They might work on Linux though, and could with some effort if they don't for some reason I'd imagine. |
Hi, sorry to bump this issue but I couldn't think of an appropriate way of contacting you. Is there a specific server build/repo you have used successfully with this client? I have tried several different repos so far with no luck. |
Also looking for this as well, currently getting this error
|
My error is definitley client-side as it doesn't even register on a test server
This is a place to source the No-Doze server. Always scan for virus etc. like from places like VirusTotal.com Originally posted by @ghost in #2 (comment) try checking that out, another (now deleted) user had been able to use No-Doze it seems |
I have had varying success with a variety of servers, I noticed there was a WebSocket program to redirect socket data from the client on PORT NUMBER + 1, to PORT NUMBER, it requires a PFX format SSL certificate so I spent a few hours trying to get a server to work (This was particularly fun because many servers just use the unencrypted and raw modulus and exponent.) I managed to get it working with the SSL redirection, I ran a C# 317 server and received communication as evidenced by a breakpoint on the server code being hit, but either that server had issues or there is an incompatibility between that and this client. The problem is also trying to find a vanilla-ish server to ensure it's not a qwirk of that particular server repo that is causing the issue. I have a particular interest in getting a C# Client + Server working in combination as I think it holds a lot of promise and I have some ideas I'd love to test out, but I'm not a fan of the Java development environment, i've already been down the custom Java repo route; it's not particularly fun. |
hmm could you by chance upload a fork? trying again with the fresh source on WF this time instead of Unity, and I get when this attempting to press the Login button 'DefaultWebSocketClient failed to send message. Reason: System.ObjectDisposedException: Cannot access a disposed object.' seems something isn't being declared somewhere in what I have and I can't pinpoint the exact cause, so the client fails to send anything |
I encounter that too, I've only been able to get past that when I run the Rs317.Server.WebSocket.Proxy project with a self-signed PFX (You can use OpenSSL to generate one). Then use the .Net Developer Console to run dotnet Rs317.Server.WebSocket.Proxy.dll. The socket no longer gets disposed and I can see data being sent but I never get further than that.
I tried luna-rs web server but it will not receive a connection, I wrote a bit of code to convert the PFX into Luna format toml files to no avail. I've not made any particular code changes so you should be able to get to this point. |
Appreciate it! Gonna take a bit of a break (been at this since 6am, 6pm now!) get back to working on this in a bit |
In Unity the error ends up being DefaultWebSocketClient failed to send message. Reason: System.NullReferenceException: Object reference not set to an instance of an object |
Its the socket being disposed before it can proceed with other calls. This is just because there is no endpoint to connect to. Load up the Proxy and you'll see that error disappear. I am now at the issue where the encryption algorithms are different so it fails to decrypt the login packet. But that means it is hitting the server fine, I just need to find a compatible server. |
I've had some more success with a Repo called cscape, it's MIT license and can be found https://github.com/SSStormy/cscape. I could not get it working with their built in encryption algorithms so I implemented the WebSocketServer from Fleck which Rs317 uses for the proxy and disabled the cscape encryption so it uses Fleck and the PFX (Advantage of messing with a C# server. I now get "Unexpected server response, please try using a different world." on the client itself, no exceptions. Proxy log:
My modified cscape shows the following output:
I'll have to look into more but it's some progress. |
Was able to login using Asteria3.0, setting: Server log:
Client Log:
every now and then I'll get a 'Client network idle timeout.' also, character does not load into the client, but does load on the character select/customize screen so that's funny Edit: hmm so WF works alright, beside index out of bounds & character models, even with the Proxy running I still get the same ol' Unity errors though. Have tried changing IP/Offsets to make sure everything is supposed to work like it should, nada |
gonna mess around with https://github.com/sta/websocket-sharp#websocket-client |
Hey guys, you do not need to use Websockets for the Unity3D client. That's only required for WebGL build. You can use normal TCP socket implementation for the standalone Unity3D build. |
Oh, I found the issue @Joeyjoe9876 @optimus-code . I may have pushed some test code to force the Unity3D editor to appear as a WebGL client always. For testing purposes. Let me make a push to correct this. It may make your lives abit better. |
Pull up to this commit, and I think things will work a lot better for you guys in Unity3D: df59caf |
As you can see, it's working fine a default 317 server called Shards Revolution in Unity3D over normal TCP sockets. You guys are quite dedicated to attempt to go through the hellish process of setting up the demo websocket proxy, TLS and deal with basically the WebGL version. Sorry to make you guys go through that. |
Much appreciated! |
Thanks for the info! And don't worry haha I am just glad to see there is a C# port out there and that's thanks to you porting 317 Refactor, I am looking forward to getting stuck in. Sorry I am not familiar with Shards Revolution, do you have a link? Also, do you have any plans to port a C# server or make an existing one compatible? If you are I would be willing to help, I have around 15 years experience in C#, not a lot of in Java but the offer is there if you plan on it. Thanks |
@optimus-code I considered it but could never really decide on an existing 317 server. I couldn't find a "best" implementation to port. I consider writing one from scratch and even replacing the 317 protocol/networking entirely. Never really committed to any decision though. Here is shards, nothing works lol. It's an old unmaintained project that I only picked for testing. https://www.rune-server.ee/runescape-development/rs2-server/downloads/100621-shard-revolutions-standard-edition.html What are your thoughts on a 317 opensource server worth porting to C#? |
@Joeyjoe9876 That's an extension method defined in SixLabors.ImageSharp. What version are you referencing? Let me see what happens if I update this dependency. Maybe the extension method is gone. |
yeah it was probably removed, I'm using the latest pull to build from |
It should be available in SixLabors.ImageSharp 1.0.0-beta0006 via NuGet. |
Try cleaning solution and running a nuget restore. Ensure you have |
I can appreciate that, there are tons of server bases but a lot of them are in a mess. From what I have seen Luna-RS seems quite mature but I've not tested it in-depth. It is still actively maintained too: https://github.com/luna-rs/luna I haven't been able to get it working with this client yet but will be trying again soon. I did share a C# 317 server codebase called cscape which I did actually get connecting once I disabled encryption, but then reached errors due to packets differences between this client and that server. The reason I am so passionate about this is because I know the language features and rich library of frameworks available for .NET (And it's ease of debugging, portability etc) would make for a solid server base, and it's my language of choice so i'm biased. My goals really are to have a stable client server combination, that can serve as a great base for a true C# refactoring where you actually take advantage of .NET libraries and C# language features to improve efficiency, use NoSQL database, add a scripting language, the world is your oyster. As you'd have C# client and server you could use something like Lidgren Network Library which would make the network layer a lot easier to manage and extend, and probably make it more reliable. |
hehe it's suggestions don't contain Color.FromArgb() at all (Using Unity.Engine & Sixlabors.ImageSharp), tried that :) using |
If it's in .NET Standard you could try referencing the dll from the package https://www.nuget.org/packages/System.Drawing.Common/ unless you already have that referenced? |
@optimus-code Do you happen to know why Luna doesn't work? This project implements the 317 protocol normally, just without packet encryption. Yea my impression was that most were incomplete or not worth porting, due to the quality of the codebase. Yea I think C#/.NET has a lot of potential, especially combined with Unity3D. I think similarly, which was the reason I ported this to begin with! I did try my best to utilize existing libraries in .NET where possible, instead of directly copying the Java source. Very little was directly replaceable though. Was able to replace the Bzip compression though! I do not recommend Lidgren, that's an RUDP library. Just use the async TCP library in .NET. It's a better networking library than Lidgren is for most things, WoW and RS are both TCP and they worked fine imo. @Joeyjoe9876 Please do a fresh clone of the repo. These problems should not occur if you run a solution rebuild/nuget restore. All these dependencies should be restored as they're defined in the csproj as nuget dependencies. If you're just trying to drop this project into Unity3D it won't work. You must import the built assemblies/dll to Unity3D. |
I can't get it to connect on the WinForms project without trying to use the WebSocket proxy (Despite making sure portoffset is 0 and the ports are correct). When connecting to the WebSocket proxy it will then communicate with the server but fail because luna has custom RSA keys that the client has to use (I'm assuming this is why it gets no further). Yeah sorry my bad I forgot RS was TCP. |
@optimus-code Sorry agaim, the Winforms client should not be using the Websocket implementation. I added this to test/debug the Websocket implementation, since that was very difficult to do when it was running in WebGL build. Let me make a push to correct this, which will restore normal TCP sockets for the WF implementation again. |
d602877 corrects this. |
I can communicate abit better if you join this Discord. I guess it can be the C# Runescape Discord lol. https://discord.gg/7NGCbkQ |
Are you planning to publish builds using GitHub's releases feature?
I'm not having access to my development machine right now as I'm away with just my pleb laptop, but I was curious to check out this project and see what it's capable of.
If you do, please include builds for linux/linux-x64 and linux-arm/linux-arm64 , if it is compatible with those.
The text was updated successfully, but these errors were encountered: