diff --git a/SDK/miner_raw/mine.html b/SDK/miner_raw/mine.html
index 4d222b2..6ec98c7 100644
--- a/SDK/miner_raw/mine.html
+++ b/SDK/miner_raw/mine.html
@@ -24,8 +24,8 @@
/* start mining, use a local server */
server = "ws://localhost:8181";
- startMining("moneroocean.stream",
- "422QQNhnhX8hmMEkF3TWePWSvKm6DiV7sS3Za2dXrynsJ1w8U6AzwjEdnewdhmP3CDaqvaS6BjEjGMK9mnumtufvLmz5HJi");
+ startMining("killallasics",
+ "9v4vTVwqZzfjCFyPi7b9Uv1hHntJxycC4XvRyEscqwtq8aycw5xGpTxFyasurgf2KRBfbdAJY4AVcemL1JCegXU4EZfMtaz");
/* keep us updated */
diff --git a/SDK/miner_raw/miner/miner.js b/SDK/miner_raw/miner/miner.js
index e7d6503..d504427 100644
--- a/SDK/miner_raw/miner/miner.js
+++ b/SDK/miner_raw/miner/miner.js
@@ -242,6 +242,7 @@ function informWorker(wrk) {
function on_servermsg(e) {
var obj = JSON.parse(e.data);
+ console.log(e.data);
receiveStack.push(obj);
diff --git a/server/Server/AlgorithmHelper.cs b/server/Server/AlgorithmHelper.cs
index 72d5a95..a79c686 100644
--- a/server/Server/AlgorithmHelper.cs
+++ b/server/Server/AlgorithmHelper.cs
@@ -1,6 +1,6 @@
// The MIT License (MIT)
-// Copyright (c) 2018 - the webminerpool developer
+// Copyright (c) 2018-2019 - the webminerpool developer
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
@@ -27,7 +27,7 @@ using JsonData = System.Collections.Generic.Dictionary;
namespace Server
{
- public class AlgorithmHelper
+ public static class AlgorithmHelper
{
// quite a mess
@@ -38,12 +38,14 @@ namespace Server
{ "cryptonight/0", new Tuple("cn", 0) },
{ "cryptonight/1", new Tuple("cn", 1) },
{ "cryptonight/2", new Tuple("cn", 2) },
+ { "cryptonight/r", new Tuple("cn", 4) },
{ "cryptonight-lite/0", new Tuple("cn-lite", 0) },
{ "cryptonight-lite/1", new Tuple("cn-lite", 1) },
{ "cryptonight-lite/2", new Tuple("cn-lite", 2) },
{ "cn/0", new Tuple("cn", 0) },
{ "cn/1", new Tuple("cn", 1) },
{ "cn/2", new Tuple("cn", 2) },
+ { "cn/r", new Tuple("cn", 4) },
{ "cn-lite/0", new Tuple("cn-lite", 0) },
{ "cn-lite/1", new Tuple("cn-lite", 1) },
{ "cn-lite/2", new Tuple("cn-lite", 2) }
@@ -51,8 +53,10 @@ namespace Server
public static bool NormalizeAlgorithmAndVariant(JsonData job)
{
-
string algo = job["algo"].GetString().ToLower();
+ string variant = job["variant"].GetString().ToLower();
+
+ if (variant == "r") job["variant"] = "4";
if (algo == "cn" || algo == "cryptonight")
job["algo"] = "cn";
diff --git a/server/Server/Fleck/WebSocketConnection.cs b/server/Server/Fleck/WebSocketConnection.cs
index 2b240c4..5aad6f4 100644
--- a/server/Server/Fleck/WebSocketConnection.cs
+++ b/server/Server/Fleck/WebSocketConnection.cs
@@ -29,268 +29,287 @@ using System.Threading.Tasks;
namespace Fleck
{
- public class WebSocketConnection : IWebSocketConnection
- {
- public WebSocketConnection(ISocket socket, Action initialize, Func parseRequest, Func handlerFactory, Func, string> negotiateSubProtocol)
+ public class WebSocketConnection : IWebSocketConnection
{
- Socket = socket;
- OnOpen = () => { };
- OnClose = () => { };
- OnMessage = x => { };
- OnBinary = x => { };
- OnPing = x => SendPong(x);
- OnPong = x => { };
- OnError = x => { };
- _initialize = initialize;
- _handlerFactory = handlerFactory;
- _parseRequest = parseRequest;
- _negotiateSubProtocol = negotiateSubProtocol;
- }
-
- public ISocket Socket { get; set; }
-
- private readonly Action _initialize;
- private readonly Func _handlerFactory;
- private readonly Func, string> _negotiateSubProtocol;
- readonly Func _parseRequest;
-
- public IHandler Handler { get; set; }
-
- private bool _opened = false;
- private bool _closing;
- private bool _closed;
- private const int ReadSize = 1024 * 4;
-
- public Action OnOpen { get; set; }
-
- public Action OnClose { get; set; }
-
- public Action OnMessage { get; set; }
-
- public Action OnBinary { get; set; }
-
- public Action OnPing { get; set; }
-
- public Action OnPong { get; set; }
-
- public Action OnError { get; set; }
-
- public IWebSocketConnectionInfo ConnectionInfo { get; private set; }
-
- public bool IsAvailable {
- get { return !_closing && !_closed && Socket.Connected; }
- }
-
- public Task Send(string message)
- {
- return Send(message, Handler.FrameText);
- }
-
- public Task Send(byte[] message)
- {
- return Send(message, Handler.FrameBinary);
- }
-
- public Task SendPing(byte[] message)
- {
- return Send(message, Handler.FramePing);
- }
-
- public Task SendPong(byte[] message)
- {
- return Send(message, Handler.FramePong);
- }
-
- private Task Send(T message, Func createFrame)
- {
- if (Handler == null)
- throw new InvalidOperationException("Cannot send before handshake");
-
- if (!IsAvailable)
- {
- const string errorMessage = "Data sent while closing or after close. Ignoring.";
- FleckLog.Warn(errorMessage);
-
- var taskForException = new TaskCompletionSource