Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
In the meantime we've documented our current web API for people like yourself interested in writing a desktop client. You can find that here: http://multiplayerrobot.com/About/Api
Let us know if you have any questions about it!
thanks for your answer.
Just started to play around at
https://yagmrc.codeplex.com/
I have a question about the API at
http://multiplayerrobot.com/About/Api
GetLatestSaveFileBytes:
Is there an encoding that needs to be aware of (base64) or is it just downloading the byte array ?
Regards
Alex B.
I think downloading works (for me) now.
I still have a problem when I try to upload a game.
(The current turn is me.)
Here is a little code snippet that demonstrates my problem.(.Net 4.5)
using System;
using System.IO;
using System.Net;
using System.Text;
FileInfo savedFile = new FileInfo(@"c:\andsoon.Civ5Save"); // use the correct file
string myauthKey = "myAuthkey"; // use the correct authKey
string myturnId = "myturnID"; // use the correct turnID
using (WebClient wc = new WebClient())
{
byte[] response = wc.UploadFile(new Uri("http://multiplayerrobot.com/api/Diplomacy/SubmitTurn?authKey="+myauthKey+"&turnId="+myturnId), "POST", savedFile.FullName);
string str = Encoding.UTF8.GetString(response);
}
The result from uploading the file this way is always: "{"ResultType":0,"PointsEarned":0}".
That means that there is an error reported by the webserver.
When I investigate the traffic with a tool, I was able to see that the .Net Webclient clas itself adds a
Content-Length to the header:
"
POST http://multiplayerrobot.com/api/Diplomacy/SubmitTurn?authKey=XXXXXXX&turnId=XXXXX HTTP/1.1
Content-Type: multipart/form-data; boundary=---------------------8d17c0520950906
Host: multiplayerrobot.com
Content-Length: 462125
Expect: 100-continue
...
"
My question would be, can you reproduce that behaviour with the WebClient class ?
Do you suggest using a different way of uploading a file ?
Regards
Alex B.
I released a beta 1 under
https://yagmrc.codeplex.com/
Thanks again for all your hints regarding the api.
Regards Alex B.