本文整理汇总了C#中UnityEngine.WWWForm.AddField方法的典型用法代码示例。如果您正苦于以下问题:C# WWWForm.AddField方法的具体用法?C# WWWForm.AddField怎么用?C# WWWForm.AddField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.WWWForm
的用法示例。
在下文中一共展示了WWWForm.AddField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Balance
/**
* Authenticated resource which returns the current balance of the player in Bitcoins
*/
public void Balance(string name, string pass, Action<JSONObject> success, Action<string> error)
{
WWWForm form = new WWWForm();
form.AddField("name", name);
form.AddField("pass", Util.Encrypt(pass));
t.Get("player/balance", form, success, error);
}
示例2: Authenticate
public IEnumerator Authenticate(string gameId, string hostname, int httpPort, string username, string password, Success success, Error error)
{
string prefix;
if (NetworkSettings.instance.httpUseSSL) {
prefix = "https://";
} else {
prefix = "http://";
}
string uri = prefix + hostname + ":" + httpPort + "/api/client/login/" + gameId;
//Debug.Log ("Authenticating via " + uri);
var form = new WWWForm ();
form.AddField ("username", username);
form.AddField ("password", password);
WWW www = new WWW (uri, form.data, form.headers);
yield return www;
if (www.error != null) {
Debug.Log(www.error);
error (www.error);
} else {
//Debug.Log(www.text);
Dictionary<string, string> values = JsonConvert.DeserializeObject<Dictionary<string, string>> (www.text);
success (values);
}
}
示例3: Balance
/**
* Authenticated resource which returns the current balance of the developer in Bitcoins
*/
public void Balance(string email, string pass, Action<JSONObject> success, Action<string> error)
{
WWWForm form = new WWWForm();
form.AddField("email", email);
form.AddField("pass", Util.Encrypt(pass));
t.Get("developer/balance", form, success, error);
}
示例4: AddParams
private WWWForm AddParams()
{
WWWForm form = new WWWForm();
form.AddField( GameConstants.REQUEST_KEY_API_KEY, Encryption.API_KEY);
form.AddField( GameConstants.REQUEST_KEY_TIMESTAMP, "" + (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond));
return form;
}
示例5: Register
/**
* Creates a new player account
*/
public void Register(string name, string pass, Action<JSONObject> success, Action<string> error)
{
WWWForm form = new WWWForm();
form.AddField("name", name);
form.AddField("pass", Util.Encrypt(pass));
t.Post("player/register", form, success, error);
}
示例6: GetNewTrades
IEnumerator GetNewTrades()
{
WWWForm form = new WWWForm();
form.AddField("_Token", APIKey); //The token
form.AddField("Symbols", symbols); //The Symbols you want
DateTimeOffset currentTimeEST = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, easternZone);
form.AddField("StartDateTime", lastUpdatedEST.ToString(timeFormat)); //The proper DateTime in the proper format
form.AddField("EndDateTime", currentTimeEST.AddTicks(-1000000).ToString(timeFormat)); //The proper DateTime in the proper format
var url = "http://ws.nasdaqdod.com/v1/NASDAQTrades.asmx/GetTrades HTTP/1.1";
WWW www = new WWW(url, form);
yield return www;
if (www.error == null)
{
//Sucessfully loaded the JSON string
Debug.Log("Loaded following JSON string" + www.text);
}
else
{
Debug.Log("ERROR: " + www.error);
}
}
示例7: Register
/**
* Adds a new game to the network
*/
public void Register(string name, string dev, string url, Action<JSONObject> success, Action<string> error)
{
WWWForm form = new WWWForm();
form.AddField("name", name);
form.AddField("dev", dev);
form.AddField("url", url);
t.Post("game/register", form, success, error);
}
示例8: Login
public void Login(string username, string password)
{
WWWForm form = new WWWForm();
form.AddField("username", username);
form.AddField("password", password);
httpService.HttpPost(LOGIN_URL, form, LoginCallback);
}
示例9: Register
public void Register(string username, string password, string email)
{
WWWForm form = new WWWForm();
form.AddField("username", username);
form.AddField("password", password);
form.AddField("email", email);
httpService.HttpPost(REGISTRATION_URL, form, RegistrationCallback);
}
示例10: AccountLoginCorrect
public void AccountLoginCorrect(string username, string pwd)
{
string salt = "";
string CorrectHashedPwd = "";
string answer = "";
password = pwd;
UnityEngine.WWWForm form = new UnityEngine.WWWForm();
form.AddField("Command", "GetHashSalt");
form.AddField("acctName", username);
WWWLoader.instance.myDelegate += OnGetHashAndSalt;
WWWLoader.Load("http://unitytowerdefense.com/WebService.php", form);
}
示例11: SendData
//Data is sent using HTTP GET
public void SendData(string data)
{
WWWForm formData = new WWWForm();
formData.AddField("userid", _ID);
formData.AddField("appversion", _AppVersion);
formData.AddField("data", data);
if (Reta.DEBUG_ENABLED && Reta.Instance.onDebugLog != null)
Reta.Instance.onDebugLog("[Reta] Sending Data " + data + " to " + _ID);
//Create URL
StartCoroutine(SendingData(formData));
}
示例12: Login
public static IEnumerator Login()
{
if (Credentials.user_email != "" && Credentials.user_password != "")
{
LWInterface.NewNotification("Attempting to log in..", LWInterface.Notification.LWNotificationType.Message);
WWWForm requestForm = new WWWForm();
requestForm.AddField("email", Credentials.user_email);
requestForm.AddField("password", Credentials.user_password);
WWW request = new WWW(Domain, requestForm);
yield return request;
string requestText = request.text;
if (requestText != "NLI")
{
string[] creds;
char delim = '&';
creds = requestText.Split(delim);
Credentials.SetUser(creds[0], creds[1]);
isLoggedIn = true;
if (LoginMode == LWLoginMode.automatic_connection)
{
LWInterface.NewNotification(Credentials.user_name + " logged in. Connecting...", LWInterface.Notification.LWNotificationType.Success);
LWNetwork.Client.InitializeClient();
}
else
{
LWInterface.NewNotification(Credentials.user_name + " logged in.", LWInterface.Notification.LWNotificationType.Success);
}
//Automatically connect after logging in if configured to do so
}
else
{
LWInterface.NewNotification("Incorrect login.", LWInterface.Notification.LWNotificationType.Error);
//Do something else if the login is invalid
}
//If the page does not return "NLI", the login is valid
//Otherwise, the incorrect credentials were provided
Credentials.ClearLogin();
//Clear the user's login credentials, regardless of their validity
}
else
{
Debug.LogError("Login credentials not set, use LWLogin.Credentials.SetLogin()");
}
}
示例13: SendBuildEvent
public static void SendBuildEvent()
{
Settings settings = Settings.Instance;
Utils.Log ("Sending build information");
#if UNITY_CLOUD_BUILD
settings.Organization.ApiKey = "ffb52e2b5f4b59267466b65b90a7bf0e7f9c6190";
#else
if (string.IsNullOrEmpty(settings.Organization.ApiKey)) {
Utils.Error ("API key not found");
return;
}
#endif
var bundleId = PlayerSettings.bundleIdentifier;
WWWForm form = new WWWForm();
form.AddField("app_name", bundleId);
form.AddField("app_identifier", bundleId);
form.AddField("base_identifier", bundleId);
form.AddField("platform_id", "android");
var headers = new Dictionary<string, string> ();
headers.Add("X-CRASHLYTICS-DEVELOPER-TOKEN", "771b48927ee581a1f2ba1bf60629f8eb34a5b63f");
headers.Add("X-CRASHLYTICS-API-KEY", settings.Organization.ApiKey);
headers.Add("X-CRASHLYTICS-API-CLIENT-ID", "io.fabric.tools.unity");
headers.Add("X-CRASHLYTICS-API-CLIENT-DISPLAY-VERSION", "1.0.0");
string url = "https://api.crashlytics.com/spi/v1/platforms/android/apps/" + bundleId + "/built";
byte[] rawData = form.data;
WWW www = new WWW(url, rawData, headers);
var timeout = false;
var t0 = DateTime.UtcNow;
while (!www.isDone) {
var t1 = DateTime.UtcNow;
var delta = (int)(t1-t0).TotalSeconds;
if (delta > 5) {
timeout = true;
break;
}
};
if (timeout) {
Utils.Warn ("Timed out waiting for build event response. If this is a production build, you may want to build again to ensure it has been properly sent.");
} else if (string.IsNullOrEmpty(www.error)) {
Utils.Log ("Build information sent");
} else {
Utils.Error ("Could not send build event. Error: " + www.error);
}
}
示例14: Character
public void Character()
{
_log = "Loading...";
WWWForm form = new WWWForm();
form.AddField("u900151974_login", username);
form.AddField("u900151974_pass", pswd);
connect = new WWW(getCharacter, form);
StartCoroutine(WaitForRequestCharacter(connect));
}
示例15: SaveFloat
private IEnumerator SaveFloat(string serverAddress,string key, float value){
WWWForm newForm = new WWWForm ();
newForm.AddField ("key", key);
newForm.AddField ("value", value.ToString());
WWW w = new WWW (serverAddress + "/saveFloat.php", newForm);
while (!w.isDone) {
yield return new WaitForEndOfFrame();
}
if (w.error != null) {
Debug.LogError (w.error);
}
}