Skip to content

Instantly share code, notes, and snippets.

@sebolio
Last active October 23, 2019 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebolio/ca38a52640c3e0c53bc853e8cb1aa2b8 to your computer and use it in GitHub Desktop.
Save sebolio/ca38a52640c3e0c53bc853e8cb1aa2b8 to your computer and use it in GitHub Desktop.
Permitir usar URLs para conseguir HOST dinamicamente en uMMORPG
  1. NetworkManager.cs inside public void StartClient before OnStartclient():
//SEB -- OBTAIN SERVER FROM URL O HOST
if (networkAddress.Contains("://")) {
    var networkAddressFromURL = new WebClient().DownloadString(networkAddress);
    networkAddress = networkAddressFromURL.Replace("\n","").Replace("\r","");
    Debug.Log("HOST from URL: " +networkAddress);
}
NetworkClient.Connect(networkAddress);
  1. NetworkManagerMMO.cs at the begining
using System.Net;
  1. NetworkManagerMMO.cs before public List<ServerInfo> serverList = new List<ServerInfo>() {:
[Header("HOST OR URL THAT RETURNS A HOST")]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment