Shoddy Battle 2 test server problem

I'm not sure if we're allowed to ask about building the shoddy battle 2 server yet, if not I apologize for posting this, I'm just anxious to give the server a try.

Anyways, I have the server under Ubuntu 8.10, and I've installed all the necessary libraries (I believe). The problem is that the .js files don't link correctly. For example:


g++ -ljs -lboost_thread-mt -lboost_regex -lboost_system-mt -lnspr4 -lxerces-c -lmysqlpp -c -g -Wall -I/usr/local/include/boost-1_38/ -I/usr/local/include/mysql++ -I/usr/include/mysql -I/usr/local/include/nspr -I/usr/local/include/boost -I/usr/local/include/js -MMD -MP -MF build/Debug/GNU-Linux-x86/resources/constants.o.d -o build/Debug/GNU-Linux-x86/resources/constants.o resources/constants.js
g++: resources/constants.js: linker input file unused because linking not done

I thought maybe the -c flag was causing the issues so i removed the -c flag and got:

g++ -ljs -lboost_thread-mt -lboost_regex -lboost_system-mt -lnspr4 -lxerces-c -lmysqlpp -Wl,-V -g -I/usr/local/include/boost-1_38/ -I/usr/local/include/mysql++ -I/usr/include/mysql -I/usr/local/include/nspr -I/usr/local/include/boost -I/usr/local/include/js -MMD -MP -MF build/Debug/GNU-Linux-x86/resources/constants.o.d -o build/Debug/GNU-Linux-x86/resources/constants.o resources/constants.js
GNU ld (GNU Binutils for Ubuntu) 2.18.93.20081009
Supported emulations:
elf_i386
i386linux
elf_x86_64
/usr/bin/ld:resources/constants.js: file format not recognized; treating as linker script
/usr/bin/ld:resources/constants.js:25: syntax error
collect2: ld returned 1 exit status

if anyone knows what the issues here is, I'd really appreciate some guidance here. Thanks in advance.
 
I actually wanted to compile it myself to see if there were any changes I could do to it or the client side of the server, but I couldn't get it to compile either. My problem though was with -ljs, so I think I didn't install TraceMonkey right. Removing that though made a game of removing each X of "X command not found" until it finally got compiler errors.

Other than that though, it is an open source project so I don't think we aren't "allowed".
 
Well i was more so unsure if we should be asking for help with it yet :P

i was able to resolve most of the other compilation errors without too much trouble - but i can't find anything about compiling javascript files alongside the rest of the C++ project.
 
The *.js files are JavaScript and are loaded at runtime by the pokemon engine. You do not want to run them through the C++ compiler, or any other compiler.
 
Alright thanks for clearing that up Colin, I thought they needed to be compile to .o objects because if I run the make file as normal I get this:

g++ -ljs -lboost_thread-mt -lboost_regex -lboost_system-mt -lnspr4 -lxerces-c -lmysqlpp -o dist/Debug/GNU-Linux-x86/shoddybattle2 build/Debug/GNU-Linux-x86/resources/text.o build/Debug/GNU-Linux-x86/resources/StatusEffect.o build/Debug/GNU-Linux-x86/src/moves/PokemonMove.o build/Debug/GNU-Linux-x86/src/shoddybattle/Pokemon.o build/Debug/GNU-Linux-x86/src/scripting/StatusObject.o build/Debug/GNU-Linux-x86/resources/items.o build/Debug/GNU-Linux-x86/resources/statuses.o build/Debug/GNU-Linux-x86/src/mechanics/stat.o build/Debug/GNU-Linux-x86/resources/abilities.o build/Debug/GNU-Linux-x86/src/scripting/FieldObject.o build/Debug/GNU-Linux-x86/src/shoddybattle/PokemonSpecies.o build/Debug/GNU-Linux-x86/src/shoddybattle/BattleField.o build/Debug/GNU-Linux-x86/src/text/Text.o build/Debug/GNU-Linux-x86/src/shoddybattle/SimpleBattle.o build/Debug/GNU-Linux-x86/src/database/rijndael.o build/Debug/GNU-Linux-x86/resources/GlobalEffect.o build/Debug/GNU-Linux-x86/src/matchmaking/MetagameList.o build/Debug/GNU-Linux-x86/src/network/NetworkBattle.o build/Debug/GNU-Linux-x86/resources/moves.o build/Debug/GNU-Linux-x86/resources/main.o build/Debug/GNU-Linux-x86/resources/clauses.o build/Debug/GNU-Linux-x86/src/scripting/ScriptMachine.o build/Debug/GNU-Linux-x86/src/mechanics/PokemonType.o build/Debug/GNU-Linux-x86/src/matchmaking/glicko2.o build/Debug/GNU-Linux-x86/src/mechanics/JewelMechanics.o build/Debug/GNU-Linux-x86/src/database/DatabaseRegistry.o build/Debug/GNU-Linux-x86/src/mechanics/PokemonNature.o build/Debug/GNU-Linux-x86/src/shoddybattle/ObjectTeamFile.o build/Debug/GNU-Linux-x86/src/network/network.o build/Debug/GNU-Linux-x86/resources/hazards.o build/Debug/GNU-Linux-x86/src/scripting/MoveObject.o build/Debug/GNU-Linux-x86/resources/constants.o build/Debug/GNU-Linux-x86/src/network/Channel.o build/Debug/GNU-Linux-x86/src/scripting/PokemonObject.o build/Debug/GNU-Linux-x86/src/database/sha2.o build/Debug/GNU-Linux-x86/src/shoddybattle/Team.o -L/usr/local/lib -L/usr/lib
g++: build/Debug/GNU-Linux-x86/resources/text.o: No such file or directory
g++: build/Debug/GNU-Linux-x86/resources/StatusEffect.o: No such file or directory
g++: build/Debug/GNU-Linux-x86/resources/items.o: No such file or directory
g++: build/Debug/GNU-Linux-x86/resources/statuses.o: No such file or directory
g++: build/Debug/GNU-Linux-x86/resources/abilities.o: No such file or directory
g++: build/Debug/GNU-Linux-x86/resources/GlobalEffect.o: No such file or directory
g++: build/Debug/GNU-Linux-x86/resources/moves.o: No such file or directory
g++: build/Debug/GNU-Linux-x86/resources/main.o: No such file or directory
g++: build/Debug/GNU-Linux-x86/resources/clauses.o: No such file or directory
g++: build/Debug/GNU-Linux-x86/resources/hazards.o: No such file or directory
g++: build/Debug/GNU-Linux-x86/resources/constants.o: No such file or directory
make[2]: *** [dist/Debug/GNU-Linux-x86/shoddybattle2] Error 1
make[2]: Leaving directory `/home/j/Desktop/ShoddyBattle2'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/j/Desktop/ShoddyBattle2'
make: *** [.build-impl] Error 2
 
That's because you have stuff like build/Debug/GNU-Linux-x86/resources/GlobalEffect.o in that command. You need to remove that. (If those are already there in the command in the repository version, it's an error.)
 
awesome, thanks Colin. After clearing out the javasccript and resolving the set of boost reference issues, i got this..

g++ -ljs -lboost_thread -lboost_filesystem -lboost_regex -lboost_date_time -lboost_system -lnspr4 -lxerces-c -lmysqlpp -o dist/Debug/GNU-Linux-x86/shoddybattle2-d2afee6893de build/Debug/GNU-Linux-x86/src/moves/PokemonMove.o build/Debug/GNU-Linux-x86/src/shoddybattle/Pokemon.o build/Debug/GNU-Linux-x86/src/scripting/StatusObject.o build/Debug/GNU-Linux-x86/src/mechanics/stat.o build/Debug/GNU-Linux-x86/src/scripting/FieldObject.o build/Debug/GNU-Linux-x86/src/shoddybattle/PokemonSpecies.o build/Debug/GNU-Linux-x86/src/shoddybattle/BattleField.o build/Debug/GNU-Linux-x86/src/text/Text.o build/Debug/GNU-Linux-x86/src/shoddybattle/SimpleBattle.o build/Debug/GNU-Linux-x86/src/database/rijndael.o build/Debug/GNU-Linux-x86/src/matchmaking/MetagameList.o build/Debug/GNU-Linux-x86/src/network/NetworkBattle.o build/Debug/GNU-Linux-x86/src/scripting/ScriptMachine.o build/Debug/GNU-Linux-x86/src/mechanics/PokemonType.o build/Debug/GNU-Linux-x86/src/matchmaking/glicko2.o build/Debug/GNU-Linux-x86/src/mechanics/JewelMechanics.o build/Debug/GNU-Linux-x86/src/database/DatabaseRegistry.o build/Debug/GNU-Linux-x86/src/mechanics/PokemonNature.o build/Debug/GNU-Linux-x86/src/shoddybattle/ObjectTeamFile.o build/Debug/GNU-Linux-x86/src/network/network.o build/Debug/GNU-Linux-x86/src/scripting/MoveObject.o build/Debug/GNU-Linux-x86/src/network/Channel.o build/Debug/GNU-Linux-x86/src/scripting/PokemonObject.o build/Debug/GNU-Linux-x86/src/database/sha2.o build/Debug/GNU-Linux-x86/src/shoddybattle/Team.o -L/usr/local/lib -lboost_regex -lboost_system -lboost_filesystem -lboost_date_time -lxerces-c -lnspr4 -lboost_thread
/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crt1.o: In function `_start':
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/shoddybattle2-d2afee6893de] Error 1
make[2]: Leaving directory `/home/j/Desktop/ShoddyBattle2-d2afee6893de'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/j/Desktop/ShoddyBattle2-d2afee6893de'
make: *** [.build-impl] Error 2

any idea what's going on there? Thanks for the help so far Colin
 
The problem is you have to modify src/network/network.cpp slightly to enable the main entry point there, and also to specify the information for your MySQL database. Specifically, scroll down to the bottom of that file and change line 1388 from
Code:
#if 0
to
Code:
#if 1
and then also alter line 1403 to specify your MySQL info:
Code:
registry->connect("shoddybattle2", "localhost", "Colin", "");
 
Your the man Colin have it working now.

I hate to keep asking but have one more question:

Is the mySQL structure stated somewhere? right now Im adding the fields and table as they cause exceptions in the program - pretty painful process
 
This is the current database schema. It is subject to change.

Code:
CREATE TABLE IF NOT EXISTS `channel1` (
  `user` int(11) NOT NULL,
  `flags` int(11) NOT NULL,
  UNIQUE KEY `user` (`user`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `channels` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `topic` varchar(255) NOT NULL,
  `flags` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

INSERT INTO `channels` (`id`, `name`, `topic`, `flags`) VALUES
(1, 'main', 'Main chat.', 0);

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  `password` varchar(64) NOT NULL,
  `level` int(11) NOT NULL,
  `activity` datetime NOT NULL,
  `ip` varchar(15) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
 
Back
Top