Skip to content
Permalink
Browse files

Merge pull request #123 from polserver/feature/xml_function_return

XML method returns.
  • Loading branch information
turleypol committed Jan 19, 2020
2 parents 0cd4a2f + 396e673 commit 790d847147c5763546690943bdac287662f7096c
@@ -2,9 +2,16 @@
<ESCRIPT>
<header>
<topic>Latest Core Changes</topic>
<datemodified>01-12-2020</datemodified>
<datemodified>01-18-2020</datemodified>
</header>
<version name="POL100">
<entry>
<date>01-18-2020</date>
<author>DevGIB:</author>
<change type="Changed">Return type of XMLFile method .appendxmlnode() now returns the created node on success.</change>
<change type="Changed">Return type of XMLNode method .appendxmlnode() now returns the created node on success.</change>
<change type="Changed">Return type of XMLNode methods .setxmlattribute() and .removexmlattribute() now returns parent node on success.</change>
</entry>
<entry>
<date>01-12-2020</date>
<author>Kevin:</author>
@@ -894,7 +894,7 @@ Object can be copied inside the same script, but cannot be stored in cprops or t
ForEach support: iterates over all child nodes, iterator is XMLNode object _iterator_iter is integer index.</explain>
<method proto="removexmlnode(integer/string/XMLNode)" returns="1/0" desc="removes node by index, first node with given name or passed one." />
<method proto="setxmldeclaration(string version, string encoding, string standalone)" returns="1" desc="Sets the xml declaration." />
<method proto="appendxmlnode(string value, [struct{attributes}])" returns="1" desc="Appends node with name value and given attributes (key=name, value=value)." />
<method proto="appendxmlnode(string value, [struct{attributes}])" returns="Created node on success." desc="Appends node with name value and given attributes (key=name, value=value)." />
<method proto="appendxmlcomment(string value)" returns="1" desc="Adds comment." />
<method proto="savexml(string filename)" returns="1/0" desc="Saves to file." />
<method proto="xmltostring([string ident])" returns="String" desc="Returns XML as string, identation is by default \t." />
@@ -910,10 +910,10 @@ ForEach support: iterates over all child nodes, iterator is XMLNode object _iter
<method proto="clonenode()" returns="XMLNode" desc="Create a copy of node which is then valid longer then the file object." />
<method proto="firstxmlchild([string value])" returns="XMLNode" desc="Returns first children or first with given name." />
<method proto="nextxmlsibling([string value])" returns="XMLNode" desc="Returns next sibling or first with given name." />
<method proto="appendxmlnode(string value, [struct{attributes}])" returns="1" desc="Appends node with name value and given attributes (key=name, value=value)." />
<method proto="appendxmlnode(string value, [struct{attributes}])" returns="Created node on success." desc="Appends node with name value and given attributes (key=name, value=value)." />
<method proto="appendxmlcomment(string value)" returns="1" desc="Adds comment." />
<method proto="setxmlattribute(struct{attributes})" returns="1" desc="Sets node attributes (key=name, value=value)." />
<method proto="removexmlattribute(string key)" returns="1" desc="Removes attribute with given name." />
<method proto="setxmlattribute(struct{attributes})" returns="Parent node on success." desc="Sets node attributes (key=name, value=value)." />
<method proto="removexmlattribute(string key)" returns="Parent node on success." desc="Removes attribute with given name." />
<method proto="appendxmltext(string text)" returns="1" desc="Adds node text." />
</class>

@@ -1,4 +1,8 @@
-- POL100 --
01-18-2020 DevGIB:
Changed: Return type of XMLFile method .appendxmlnode() now returns the created node on success.
Changed: Return type of XMLNode method .appendxmlnode() now returns the created node on success.
Changed: Return type of XMLNode methods .setxmlattribute() and .removexmlattribute() now returns parent node on success.
01-12-2020 Kevin:
Changed: On Windows, the pol.cfg setting UoDataFileRoot will now default to the directory of the Ultima Online installation found in
the Windows Registry. This setting MUST be set for servers that do not have Ultima Online installed through the operating
@@ -120,9 +120,8 @@ Bscript::BObjectImp* BXMLfile::call_method_id( const int id, Executor& ex, bool
}
}
}

file.LinkEndChild( elem.release() );
return new BLong( 1 );
return new BXmlNode(file.LastChild());
}
break;
}
@@ -418,7 +417,7 @@ Bscript::BObjectImp* BXmlNode::call_method_id( const int id, Executor& ex, bool

TiXmlElement* nodeelem = node->ToElement();
nodeelem->LinkEndChild( elem.release() );
return new BLong( 1 );
return new BXmlNode(nodeelem->LastChild());
}
break;
}
@@ -456,7 +455,8 @@ Bscript::BObjectImp* BXmlNode::call_method_id( const int id, Executor& ex, bool
else
elem->SetAttribute( name, ref->getStringRep() );
}
return new BLong( 1 );
return new BXmlNode(elem);

}
break;
}
@@ -469,7 +469,7 @@ Bscript::BObjectImp* BXmlNode::call_method_id( const int id, Executor& ex, bool
{
TiXmlElement* elem = node->ToElement();
elem->RemoveAttribute( pstr->value() );
return new BLong( 1 );
return new BXmlNode(elem);
}
break;
}
@@ -516,7 +516,7 @@ Bscript::BObjectImp* BXmlNode::call_method_id( const int id, Executor& ex, bool
{
TiXmlElement* elem = node->ToElement();
elem->LinkEndChild( new TiXmlText( pstr->value() ) );
return new BLong( 1 );
return new BXmlNode(elem->LastChild());
}
break;
}

0 comments on commit 790d847

Please sign in to comment.
You can’t perform that action at this time.