Set max packet size to 10mb, and also send client info on connect
This commit is contained in:
@@ -26,6 +26,10 @@ public class WebsocketHandler : MonoBehaviour
|
||||
DontDestroyOnLoad(gameObject);
|
||||
|
||||
_Connection = gameObject.AddComponent<WebSocketConnection>();
|
||||
_Connection.DesiredConfig = new WebSocketConfig
|
||||
{
|
||||
MaxReceiveBytes = 10 * 1024 * 1024
|
||||
};
|
||||
_Connection.StateChanged += OnStateChanged;
|
||||
_Connection.ErrorMessageReceived += OnErrorMessageReceived;
|
||||
|
||||
@@ -73,15 +77,6 @@ public class WebsocketHandler : MonoBehaviour
|
||||
sceneName = currentSceneName
|
||||
};
|
||||
_Connection.AddOutgoingMessage(JsonUtility.ToJson(msg));
|
||||
|
||||
if (currentSceneName == "ChatroomMenu")
|
||||
{
|
||||
RequestInfoMessage msg2 = new()
|
||||
{
|
||||
kind = "chatroom_messages"
|
||||
};
|
||||
_Connection.AddOutgoingMessage(JsonUtility.ToJson(msg2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,15 +104,6 @@ public class WebsocketHandler : MonoBehaviour
|
||||
from = lastSceneName
|
||||
};
|
||||
_Connection.AddOutgoingMessage(JsonUtility.ToJson(msg));
|
||||
|
||||
if (scene.name == "ChatroomMenu")
|
||||
{
|
||||
RequestInfoMessage msg2 = new()
|
||||
{
|
||||
kind = "chatroom_messages"
|
||||
};
|
||||
_Connection.AddOutgoingMessage(JsonUtility.ToJson(msg2));
|
||||
}
|
||||
}
|
||||
lastSceneName = scene.name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user