fix: replace usages of MLAPI with Netcode in js part (#123)
This commit is contained in:
Родитель
93febe1faa
Коммит
8dded1c742
|
@ -4,7 +4,7 @@ using System.Collections.Generic;
|
|||
using System.Runtime.InteropServices;
|
||||
using WebSocketSharp;
|
||||
|
||||
namespace MLAPI.Transports.WebSocket
|
||||
namespace Netcode.Transports.WebSocket
|
||||
{
|
||||
public class JSWebSocketClient : IWebSocketClient
|
||||
{
|
||||
|
|
|
@ -35,7 +35,7 @@ var LibraryWebSocket = {
|
|||
|
||||
state.ws.onopen = function () {
|
||||
if (state.debug) {
|
||||
console.log("[MLAPI.WebSocket] Connected.");
|
||||
console.log("[Netcode.WebSocket] Connected.");
|
||||
}
|
||||
|
||||
if (state.onOpen) {
|
||||
|
@ -45,7 +45,7 @@ var LibraryWebSocket = {
|
|||
|
||||
state.ws.onmessage = function (ev) {
|
||||
if (state.debug) {
|
||||
console.log("[MLAPI.WebSocket] Received message:", ev.data);
|
||||
console.log("[Netcode.WebSocket] Received message:", ev.data);
|
||||
}
|
||||
|
||||
if (!state.onMessage) {
|
||||
|
@ -68,7 +68,7 @@ var LibraryWebSocket = {
|
|||
|
||||
state.ws.onerror = function (ev) {
|
||||
if (state.debug) {
|
||||
console.log("[MLAPI.WebSocket] Error occured.");
|
||||
console.log("[Netcode.WebSocket] Error occured.");
|
||||
}
|
||||
|
||||
if (state.onError) {
|
||||
|
@ -87,7 +87,7 @@ var LibraryWebSocket = {
|
|||
|
||||
state.ws.onclose = function (ev) {
|
||||
if (state.debug) {
|
||||
console.log("[MLAPI.WebSocket] Closed.");
|
||||
console.log("[Netcode.WebSocket] Closed.");
|
||||
}
|
||||
|
||||
if (state.onClose) {
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace Netcode.Transports.WebSocket
|
|||
}
|
||||
|
||||
var protocol = SecureConnection ? "wss" : "ws";
|
||||
WebSocketClient = WebSocketClientFactory.Create($"{protocol}://{ConnectAddress}:{Port}/mlapi");
|
||||
WebSocketClient = WebSocketClientFactory.Create($"{protocol}://{ConnectAddress}:{Port}/netcode");
|
||||
WebSocketClient.Connect();
|
||||
|
||||
IsStarted = true;
|
||||
|
@ -124,7 +124,7 @@ namespace Netcode.Transports.WebSocket
|
|||
}
|
||||
|
||||
WebSocketServer = new WebSocketServer(Port);
|
||||
WebSocketServer.AddWebSocketService<WebSocketServerConnectionBehavior>("/mlapi");
|
||||
WebSocketServer.AddWebSocketService<WebSocketServerConnectionBehavior>("/netcode");
|
||||
WebSocketServer.Start();
|
||||
|
||||
IsStarted = true;
|
||||
|
|
Загрузка…
Ссылка в новой задаче