Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Jul 5th, 2015 3 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using BeardedManStudios.Network;
  5.  
  6. public class Startup : MonoBehaviour {
  7.  
  8.     public string host = "127.0.0.1";
  9.     public int port = 15937;
  10.     public Networking.TransportationProtocolType protocolType = Networking.TransportationProtocolType.UDP;
  11.  
  12.     private NetWorker socket = null;
  13.     public Chat chat;
  14.  
  15.         void Start () {
  16.         Networking.InitializeFirewallCheck((ushort)port);
  17.         }
  18.  
  19.     public void StartServer() {
  20.         socket = Networking.Host((ushort)port, protocolType, 10);
  21.         socket.playerConnected += PlayerConnected;
  22.         socket.playerDisconnected += PlayerDisconnected;
  23.         chat.SendMessage("Starting server...");
  24.     }
  25.  
  26.     public void StartClient() {
  27.         socket = Networking.Connect("127.0.0.1", (ushort)port, protocolType);
  28.         chat.SendMessage("Starting client...");
  29.     }
  30.  
  31.     private void PlayerDisconnected(NetworkingPlayer player) {
  32.         chat.SendMessage(string.Format("Player [{0}] disconnected", player.Ip));
  33.     }
  34.  
  35.     private void PlayerConnected(NetworkingPlayer player) {
  36.         chat.SendMessage(string.Format("Player [{0}] connected", player.Ip));
  37.     }
  38. }
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