SHARE
TWEET

Untitled

a guest Aug 22nd, 2018 71 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 PlayFab;
  5. using PlayFab.ServerModels;
  6. using PlayFab.ClientModels;
  7. using UnityEngine.Networking;
  8. using System.Net;
  9. using System.Net.Sockets;
  10.  
  11. public class PlayfabControl : MonoBehaviour
  12. {
  13.  
  14.     public NetworkManager netManager;
  15.  
  16.     [SerializeField] private string gameID;
  17.     [SerializeField] private string buildVersion;
  18.     [SerializeField] private string gameMode;
  19.     [SerializeField] private string serverHostDomain;
  20.     [SerializeField] private int serverPort;
  21.     [SerializeField] private string serverRegion;
  22.     [SerializeField] private string playfabAPIEndpoint;
  23.     [SerializeField] private string titleSecretKey;
  24.  
  25.     private string currentLobbyID;
  26.  
  27.     // Use this for initialization
  28.     void Start()
  29.     {
  30.         var cliArgs = System.Environment.GetCommandLineArgs();
  31.         gameID = cliArgs[0];
  32.         buildVersion = cliArgs[1];
  33.         gameMode = cliArgs[2];
  34.         serverHostDomain = cliArgs[3];
  35.         serverPort = System.Convert.ToInt32(cliArgs[4]);
  36.         serverRegion = cliArgs[5];
  37.         playfabAPIEndpoint = cliArgs[6];
  38.         titleSecretKey = cliArgs[7];
  39.  
  40.         netManager.networkAddress = serverHostDomain;
  41.         netManager.networkPort = serverPort;
  42.        
  43.         netManager.StartServer();
  44.     }
  45.    
  46.     private void OnPlayerDisconnected(NetworkPlayer player)
  47.     {
  48.        
  49.     }
  50.  
  51.     private void OnPlayerConnected(NetworkPlayer player)
  52.     {
  53.        
  54.     }
  55.  
  56.    
  57. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top