Forum C# XML Parsing ?

XML Parsing ?

Postby Vania » April 20th, 2010, 1:38 am

I think being able to parse XML files is important.
A lot of people will want this feature.

At the moment we cant use the parser, just a heads up.

Reference found to System.Xml. You can only reference PlayerIO.GameLibrary.dll
ServersideGameCode.ServerLogic.initializeObjects(...) has varible of the non-allowed type: System.Xml.XmlDocument
ServersideGameCode.ServerLogic.initializeObjects(...) has varible of the non-allowed type: System.Xml.XmlNodeList
ServersideGameCode.ServerLogic.initializeObjects(...) has varible of the non-allowed type: System.Xml.XmlNodeList
ServersideGameCode.ServerLogic.initializeObjects(...) has varible of the non-allowed type: System.Xml.XmlNodeList
ServersideGameCode.ServerLogic.initializeObjects(...) uses the non-allowed method: System.Void System.IO.FileStream::.ctor(System.String,System.IO.FileMode,System.IO.FileAccess)
ServersideGameCode.ServerLogic.initializeObjects(...) uses the non-allowed method: System.Void System.Xml.XmlDocument::.ctor()
ServersideGameCode.ServerLogic.initializeObjects(...) uses the non-allowed method: System.Xml.XmlNodeList System.Xml.XmlDocument::GetElementsByTagName(System.String)
ServersideGameCode.ServerLogic.initializeObjects(...) uses the non-allowed method: System.Xml.XmlNodeList System.Xml.XmlDocument::GetElementsByTagName(System.String)
ServersideGameCode.ServerLogic.initializeObjects(...) uses the non-allowed method: System.Xml.XmlNodeList System.Xml.XmlDocument::GetElementsByTagName(System.String)
Vania
 
Posts: 198
Joined: March 24th, 2010, 9:01 pm

Re: XML Parsing ?

Postby Oliver » April 20th, 2010, 1:03 pm

Why do you want to parse xml files?

For configuration you should just have the object structure defined directly in the code.

For communication between client and server, xml is not very efficient, and using the builtin message type will be much faster.

- oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: XML Parsing ?

Postby koseki » April 20th, 2010, 1:28 pm

Hm... :)
Since there is no database solution for Player.IO, I for example want to store configs for different ingame items, their prices, string tables, some sort of maps and a lot of different stuff in XML. I don't want to rebuild server code every time I change configuration of game resources.
Last edited by koseki on April 20th, 2010, 3:43 pm, edited 1 time in total.
koseki
 
Posts: 4
Joined: April 17th, 2010, 8:32 pm

Re: XML Parsing ?

Postby Vania » April 20th, 2010, 3:33 pm

I dont want to use XML for communication beetween client and server.

What I want to do (in the future, and if the database supports it) is to load things like levels, items, etc... from the database.

So for example I can upload new levels to the database, those levels would be loaded and parsed by the server and inmediately available for the players. Thats the way HexWars works on whirled.com. This allows you to add stuff to your game without having to recompile and upload the new code for the server.

Even if the database doesnt support this feature I would like to store the levels and other data in XML format inside my code. Why? Because that way I can make a level editor that outputs XML and just store the level in a string variable, then parse it. Without an XML parser I would have to manually initialize object structures for every level or item I add into my game.

Also if levels are in XML format I can do some cool stuff in the future, like adding a level editor to the game and allowing players to share their levels.

It doesnt have to be XML, it could be YAML or something else, I'm going to look for a C# YAML parser right away and tell you if its compatible with playerio.
Vania
 
Posts: 198
Joined: March 24th, 2010, 9:01 pm

Re: XML Parsing ?

Postby iksnae » December 11th, 2010, 7:11 am

any luck? i need to parse xml or json.. i'm not loading level data. i'm loading data from webservices. is this something possible with the Web object?
iksnae
 
Posts: 9
Joined: August 6th, 2010, 4:59 am

Re: XML Parsing ?

Postby Oliver » December 16th, 2010, 1:30 pm

XML support is on the todo list.

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: XML Parsing ?

Postby eXpressionist » February 9th, 2011, 9:40 am

iksnae wrote:any luck? i need to parse xml or json.. i'm not loading level data. i'm loading data from webservices. is this something possible with the Web object?

I need to load data from webservices too.. Is there still no solution?
In Soviet Russia PlayerIO plays you

I'm just a newbie here, don't hit me hard, plz =)
eXpressionist
 
Posts: 9
Joined: January 27th, 2011, 9:55 am
Location: Russia, Nalchik

Re: XML Parsing ?

Postby Oliver » February 18th, 2011, 3:02 pm

Hi,

No, sorry XML parsing is still not available in serverside code.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: XML Parsing ?

Postby tef » March 2nd, 2011, 12:28 am

I posted my solution to Json decoding/encoding in this thread. I fixed a Json decoder/encoder to work in the PlayerIO environment. Works like a charm.

csharp/json-with-c-and-playerio-t617#p4555
tef
 
Posts: 10
Joined: January 7th, 2011, 3:38 pm

Re: XML Parsing ?

Postby Oliver » March 9th, 2011, 6:43 pm

I posted my solution to Json decoding/encoding in this thread. I fixed a Json decoder/encoder to work in the PlayerIO environment. Works like a charm.


:-)
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am


Return to C#



cron