chiark / gitweb /
pctb upload: _Do_ print a message to stderr (which ends up in the yohoho log) about...
[jarrg-ian.git] / src / com / tedpearson / ypp / market / MarketUploader.java
index d46125b42a13b832082e6db4d44ddf4473c90b27..d8efac50a27d23dbcf5b84cff45ada8efabc99a3 100644 (file)
@@ -435,7 +435,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
                //System.out.println(sells);
                //System.out.println("\n\n\n"+buys);
 
-               if (false) { // uploadToPCTB
+               if (uploadToPCTB) {
                        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
                        pm.setProgress(60);
                        pm.setNote("Sending data");
@@ -445,7 +445,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
                        GZIPOutputStream out = new GZIPOutputStream(outStream);
                        //FileOutputStream out = new FileOutputStream(new File("output.text"));
                        DataOutputStream dos = new DataOutputStream(out);
-                       dos.writeBytes("005\n");
+                       dos.writeBytes("005y\n");
                        dos.writeBytes(stallMap.size()+"\n");
                        dos.writeBytes(getAbbrevStallList(stallMap));
                        writeBuySellOffers(buys,sells,offerCount,out);
@@ -597,7 +597,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
                        //System.out.println(xml);
                        Reader reader = new CharArrayReader(xml.toCharArray());
                        Document d = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(reader));
-                       NodeList maps = d.getElementsByTagName("c");
+                       NodeList maps = d.getElementsByTagName("CommodMap");
                        for(int i=0;i<maps.getLength();i++) {
                                NodeList content = maps.item(i).getChildNodes();
                                Integer num = Integer.parseInt(content.item(1).getTextContent());
@@ -664,7 +664,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
                                        buySellCount[1]++;
                                }
                        } catch(IllegalArgumentException e) {
-                               // System.err.println("Error: Unsupported Commodity \"" + offer.get(0) + "\"");
+                               System.err.println("Error: Unsupported Commodity \"" + offer.get(0) + "\"");
                        }
                }
                return buySellCount;