Ah, I just responded to your email, but I missed this earlier, thanks! There's a possibility that this version might be the issue, in my research I do see some of these errors appearing for older versions of Unity. Is it possible for you to use a newer version of Unity?
Madora_Team
Creator of
Recent community posts
Awesome work on this, you can tell a lot of love went into it! I'd love to see this developed more. I see you were having some issues with the Nano plugin. Is there anything we can help with? We've extended the voting deadline until February 2nd, and we're encouraging everyone to try to get their Nano integrations working by then. If we can help at all please let us know!
Hi! Seems like the Nano integration is working now, love to see it! One thing we noticed though, I think the QR codes for the Jackpot and Player Wallet are mixed up. We tried adding to our wallet by scanning the QR code, but it sent to the jackpot instead. The address displayed seems correct though, we copied that to the clipboard and sent there and it worked.
Otherwise the game is a lot of fun and seems to be working great!
Hey Everyone,
Thank you to all that signed up and to those that submitted a game to the 2022 Madora Game Jam! The voting period will be extended to February 2nd. During this time feel free to update and upload any patches. Please reach out if you require assistance. We understand the difficulty in integrating Nano with various game engines and we appreciate your patience. If you were unable to submit your game, but still wish to complete and post on Itch, you are free to use the game jam credits on our website.
Cheers!
Brandon + Patrick
Hi, we were able to work with Kalinka to resolve this. It seems the Unity plugin doesn't easily support authentication with our servers (we did not develop it, another member of the Nano community did). I will be putting up a pull request later this week to fix this, which will hopefully be accepted! In the meantime however, you will need to make some manual changes to the code in your integration with the plugin. Here are the instructions:
In the Nano Plugin, under Nano > Plugins > Nano there should be a NanoWebsocket.cs file. If you open this up, you will need to add the following lines of code:
Under the using section:
using System.Text;
In async void Start(), as the first lines in the function:
byte[] bytesToEncode = Encoding.UTF8.GetBytes ("<yourkey>:<yoursecret>");
string auth = "Basic " + Convert.ToBase64String (bytesToEncode);
Dictionary<string, string> headers = new Dictionary<string, string>();
headers.Add("Authorization", auth);
websocket = new WebSocket(url, headers);
The last line there is replacing the existing line of websocket = new WebSocket(url);
In the Nano Plugin under Nano > Plugins > Nano there should be a RPC.cs file. In here, you will need to replace the beginning of the RPC class with the following:
public class RPC { public string url; private string auth; public RPC(string url) { this.url = url; byte[] bytesToEncode = Encoding.UTF8.GetBytes ("<yourkey>:<yoursecret>"); this.auth = "Basic " + Convert.ToBase64String (bytesToEncode); } public IEnumerator MakeRequest(UnityWebRequest webRequest, byte[] body, Action<string> callback) { webRequest.uploadHandler = new UploadHandlerRaw(body); webRequest.downloadHandler = new DownloadHandlerBuffer(); webRequest.SetRequestHeader("Content-Type", "application/json"); webRequest.SetRequestHeader("Accepts", "application/json"); webRequest.SetRequestHeader("Authorization", this.auth);
The key additions here are: generating the authorization when the class is initialized, and then adding it in every request made.
ALSO, very important, make sure you replace the instances of <yourkey> and <yoursecret> with a key and secret that you generate on your account on the Madora website.
There may also be some issues with the websocket that I am still investigating (it does not perform keep-alive properly, so it keeps timing out after 1 minute. This should be an easy fix but I haven't had time yet). Let me know if you have any questions, and if there's anything else I can do to help!
Hi Kalinka,
We have responded to your email, apologies for the issues you are having with connection. If we're unable to resolve the connection issues by the end of the jam that is alright, your game will still be eligible. Hopefully we can resolve this quickly so that we are all able to enjoy your game to the fullest extent.
Hi Kalinka, sorry you are running into issues. It's hard to tell what website you are trying to access with the websocket from this error log, can you post that here? My guess is that you are using a ws:// connection, when it needs to be a wss:// connection. ws:// is an insecure websocket connection (akin to http) vs wss:// is a secure websocket connection (similar to https). The browser will stop you from making an insecure websocket connection from a secure (https) connection, which I think is what you are running into here. The fix should be to change ws:// in your websocket url to wss://, unless I've misdiagnosed the issue.
If that doesn't work, can you please post your code around setting up the websocket to help diagnose the issue?