SHARE
TWEET

Untitled

a guest Sep 19th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top