Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using WebSocketSharp;
  5. using WebSocketSharp.Server;
  6.  
  7. public class ServerManager: MonoBehaviour
  8. {
  9. public string serverAddress = "ws://0.0.0.0:8080";
  10.  
  11. public static string message = "";
  12.  
  13. // Use this for initialization
  14. void Start()
  15. {
  16. var wssv = new WebSocketServer(serverAddress);
  17. wssv.AddWebSocketService<ServerInfo>("/GAQuest");
  18. wssv.Start();
  19. }
  20.  
  21. // Update is called once per frame
  22. void Update()
  23. {
  24. Debug.Log(message);
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement