Working with Shoddy on the source code level

It's proving to be a bit tricky! For the record I'm using NetBeans 6.5.1 with JDK 1.6.0_13.

So when I tried to load the client, it was asking for a JAR not on the CVS repo: PokemonSprites.JAR
After rummaging around the WebStart files I grabbed it off the website and loaded it... but now it gives me this error:

This may be related to some other issues I am having...

When I opened the Team Builder and selected "Standard Metagame" I get the folowing in the debugger after the:
Code:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at shoddybattle.PokemonSpeciesData.getSpeciesNames(PokemonSpeciesData.java:321)
        at shoddybattleclient.PokemonStats.refreshPokemonList(PokemonStats.java:154)
        at shoddybattleclient.PokemonStats.<init>(PokemonStats.java:140)
        at shoddybattleclient.TeamBuilder.<init>(TeamBuilder.java:88)
        at shoddybattleclient.TeamBuilder.<init>(TeamBuilder.java:78)
        at shoddybattleclient.WelcomeWindow.cmdNewTeamActionPerformed(WelcomeWindow.java:273)
        at shoddybattleclient.WelcomeWindow.access$700(WelcomeWindow.java:26)
        at shoddybattleclient.WelcomeWindow$6.actionPerformed(WelcomeWindow.java:187)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
        at java.awt.Component.processMouseEvent(Component.java:6216)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
        at java.awt.Component.processEvent(Component.java:5981)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4583)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4413)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150)
        at java.awt.Container.dispatchEventImpl(Container.java:2085)
        at java.awt.Window.dispatchEventImpl(Window.java:2475)
        at java.awt.Component.dispatchEvent(Component.java:4413)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
But if I select Smogon's server, it loads fine.


Now, when I go to open a team file, after selecting the file I get this instead in the debugger:
Code:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at shoddybattle.PokemonSpeciesData.getSpecies(PokemonSpeciesData.java:311)
        at shoddybattle.PokemonSpecies.readObject(PokemonSpecies.java:204)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at shoddybattle.Pokemon.loadTeam(Pokemon.java:572)
        at shoddybattleclient.TeamBuilder.loadTeam(TeamBuilder.java:498)
        at shoddybattleclient.TeamBuilder.mnuOpenActionPerformed(TeamBuilder.java:543)
        at shoddybattleclient.TeamBuilder.access$300(TeamBuilder.java:44)
        at shoddybattleclient.TeamBuilder$4.actionPerformed(TeamBuilder.java:187)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)
        at java.awt.Component.processMouseEvent(Component.java:6216)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
        at java.awt.Component.processEvent(Component.java:5981)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4583)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4413)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150)
        at java.awt.Container.dispatchEventImpl(Container.java:2085)
        at java.awt.Window.dispatchEventImpl(Window.java:2475)
        at java.awt.Component.dispatchEvent(Component.java:4413)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
I'm using Xerces 2.9.1, if Shoddy requires a specific revision.

And trying to run the server from source gives me this:
Code:
java.io.StreamCorruptedException: invalid type code: 09
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
        at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
        at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at mechanics.moves.MoveSetData.loadFromFile(MoveSetData.java:139)
        at mechanics.moves.MoveSetData.loadFromFile(MoveSetData.java:126)
        at shoddybattle.Main.initialise(Main.java:152)
        at shoddybattle.Main.main(Main.java:309)
Anything I can do about these?
 

bearzly

Shoddy Battle dev
is a Battle Simulator Admin Alumnusis a Programmer Alumnusis a Forum Moderator Alumnus
You need to specify some command line arguments to get it to look for the resources. Right click on the project->properties->Run and put this into the Arguments field
Code:
sprites.PokemonSprite http://shoddybattle.com/client/dpmovesets.db
That should make it work.

Also, as you probably noticed we are now working on Shoddy Battle 2, so if you are interested in developing, I would recommend you work there. If you're just messing around or looking to fix bugs, feel free to work with Shoddy Battle 1 and submit a patch if you add anything. Xerces is only needed for Shoddy Battle 2, not Shoddy battle 1.

About the server error, it sounds like maybe your metagame file got corrupted somehow. That, or you changed your server.metagame property in server.properties
 
I actually had grabbed the Shoddy 2 code as well. Strangely, the team file format has changed? This is what I get when I try to load my team from Shoddy 1:
Code:
org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:277)
        at shoddybattleclient.utils.TeamFileParser.parseTeam(TeamFileParser.java:52)
        at shoddybattleclient.TeamBuilder.menuLoadActionPerformed(TeamBuilder.java:267)
        at shoddybattleclient.TeamBuilder.access$100(TeamBuilder.java:45)
        at shoddybattleclient.TeamBuilder$2.actionPerformed(TeamBuilder.java:183)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)
        at java.awt.Component.processMouseEvent(Component.java:6216)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
        at java.awt.Component.processEvent(Component.java:5981)
        at java.awt.Container.processEvent(Container.java:2041)
        at java.awt.Component.dispatchEventImpl(Component.java:4583)
        at java.awt.Container.dispatchEventImpl(Container.java:2099)
        at java.awt.Component.dispatchEvent(Component.java:4413)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150)
        at java.awt.Container.dispatchEventImpl(Container.java:2085)
        at java.awt.Window.dispatchEventImpl(Window.java:2475)
        at java.awt.Component.dispatchEvent(Component.java:4413)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
It also blanks out the Team Builder window unless I load a new team file. Though improving the format is nice, IMHO you could greatly benefit from some sort of Shoddy 1 to Shoddy 2 converter for the players, otherwise everyone will have to rebuild their teams.

Also, I've yet to set up the GCC toolchain so i haven't built the server yet, but I took a look at the new battle window in NetBeans' design view, and hooray! The interface is more like what I was asking for in the suggestions thread! :D

...Hm, you need help implementing hold items? I see you don't have any except Leftovers...

Hmm, when I try to connect to the Shoddy server from the new client, like Smogon, it brings up a message box with the URL to Smogon's Shoddy server, and manually entering the URL and port to Smogon's server... causes Shoddy 2 to quit. O_o

EDIT: Alright, got Dev-C++ set up. Now to build the server...
Code:
Running "C:\Dev-Cpp\bin\make.exe  -f Makefile CONF=Debug" in C:\Users\Techokami\Unzipped\shoddybattle\ShoddyBattle2

C:/Dev-Cpp/bin/make.exe -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf

make.exe[1]: Entering directory `C:/Users/Techokami/Unzipped/shoddybattle/ShoddyBattle2'

C:/Dev-Cpp/bin/make.exe  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/shoddybattle2

make.exe[2]: Entering directory `C:/Users/Techokami/Unzipped/shoddybattle/ShoddyBattle2'

make.exe[2]: Leaving directory `C:/Users/Techokami/Unzipped/shoddybattle/ShoddyBattle2'

make.exe[2]: *** No rule to make target `/home/Colin/ShoddyBattle2/src/moves/PokemonMove.cpp', needed by `build/Debug/GNU-Linux-x86/_ext/home/Colin/ShoddyBattle2/src/moves/PokemonMove.o'.  Stop.

make.exe[1]: *** [.build-conf] Error 2

make.exe[1]: Leaving directory `C:/Users/Techokami/Unzipped/shoddybattle/ShoddyBattle2'

C:\Dev-Cpp\bin\make.exe: *** [.build-impl] Error 2


Build failed. Exit value 2.
Or not.
 

bearzly

Shoddy Battle dev
is a Battle Simulator Admin Alumnusis a Programmer Alumnusis a Forum Moderator Alumnus
We changed the team format to be XML so that it could be editable by hand. Colin has already made a something to read the old team files, we just haven't implemented it in the client yet.

Just so you know, we have never tried building the server on Windows, so you're on your own really. It's not exactly a walk in the park either. The libraries that you need are:
  • The boost libraries (might as well grab them all)
  • Spidermonkey (with multi threading enabled)
  • Xerces XML parsing library
  • mysql++ (you'll also need a mysql server running on your computer)
 
We changed the team format to be XML so that it could be editable by hand. Colin has already made a something to read the old team files, we just haven't implemented it in the client yet.
That's good to know! :)

Just so you know, we have never tried building the server on Windows, so you're on your own really. It's not exactly a walk in the park either. The libraries that you need are:
  • The boost libraries (might as well grab them all)
  • Spidermonkey (with multi threading enabled)
  • Xerces XML parsing library
  • mysql++ (you'll also need a mysql server running on your computer)
Currently my Linux install is SOL due to IDE controller issues (my desktop computer can't read both drives, so all I have right now is Windows Vista with Fedora 8 inaccessible), and even then with the hotter temps I really don't use my desktop PC much because it overheats very quickly. (yes I dusted the whole thing out, doesn't help much)

So it's just me and Windows 7 beta 1 on my laptop right now. I'll grab the needed libraries and try compiling the server again.

EDIT: Wahahahahaha, wow this is proving to be a pain. God I miss bash already :(
Gotta get SUA going so I can use the bash shell so I can run the configure script for Xerces. What fun~
 
Well, guess what? Even on Linux, I can't build the server because of, you guessed it,
Code:
$> make
make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/techokami/cvs/shoddy/ShoddyBattle2'
make  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/shoddybattle2
make[2]: Entering directory `/home/techokami/cvs/shoddy/ShoddyBattle2'
make[2]: *** No rule to make target `/home/Colin/ShoddyBattle2/src/moves/PokemonMove.cpp', needed by `build/Debug/GNU-Linux-x86/_ext/home/Colin/ShoddyBattle2/src/moves/PokemonMove.o'.  Stop.
make[2]: Leaving directory `/home/techokami/cvs/shoddy/ShoddyBattle2'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/techokami/cvs/shoddy/ShoddyBattle2'
make: *** [.build-impl] Error 2
$>
the same exact error. And it's not an error with libraries.
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top