Skip to content

Commit

Permalink
Send the client request action sequence information
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Fernandez committed Oct 31, 2010
1 parent 4a1cc5f commit 095ed40
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
14 changes: 7 additions & 7 deletions nbproject/Package-Debug.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP=`pwd`
CND_PLATFORM=GNU-Linux-x86
CND_CONF=Debug
CND_DISTDIR=dist
TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
NBTMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
TMPDIRNAME=tmp-packaging
OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/shoddybattle2
OUTPUT_BASENAME=shoddybattle2
Expand Down Expand Up @@ -53,22 +53,22 @@ function copyFileToTmpDir
# Setup
cd "${TOP}"
mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
rm -rf ${TMPDIR}
mkdir -p ${TMPDIR}
rm -rf ${NBTMPDIR}
mkdir -p ${NBTMPDIR}

# Copy files and create directories and links
cd "${TOP}"
makeDirectory ${TMPDIR}/shoddybattle2/bin
copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
makeDirectory "${NBTMPDIR}/shoddybattle2/bin"
copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755


# Generate tar file
cd "${TOP}"
rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/shoddybattle2.tar
cd ${TMPDIR}
cd ${NBTMPDIR}
tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/shoddybattle2.tar *
checkReturnCode

# Cleanup
cd "${TOP}"
rm -rf ${TMPDIR}
rm -rf ${NBTMPDIR}
14 changes: 7 additions & 7 deletions nbproject/Package-Release.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP=`pwd`
CND_PLATFORM=GNU-Linux-x86
CND_CONF=Release
CND_DISTDIR=dist
TMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
NBTMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
TMPDIRNAME=tmp-packaging
OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/shoddybattle2
OUTPUT_BASENAME=shoddybattle2
Expand Down Expand Up @@ -53,22 +53,22 @@ function copyFileToTmpDir
# Setup
cd "${TOP}"
mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
rm -rf ${TMPDIR}
mkdir -p ${TMPDIR}
rm -rf ${NBTMPDIR}
mkdir -p ${NBTMPDIR}

# Copy files and create directories and links
cd "${TOP}"
makeDirectory ${TMPDIR}/shoddybattle2/bin
copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
makeDirectory "${NBTMPDIR}/shoddybattle2/bin"
copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755


# Generate tar file
cd "${TOP}"
rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/shoddybattle2.tar
cd ${TMPDIR}
cd ${NBTMPDIR}
tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/shoddybattle2.tar *
checkReturnCode

# Cleanup
cd "${TOP}"
rm -rf ${TMPDIR}
rm -rf ${NBTMPDIR}
4 changes: 4 additions & 0 deletions src/network/NetworkBattle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,8 @@ struct NetworkBattleImpl {
* byte : slot of relevant pokemon
* byte : position of relevant pokemon
* byte : whether this is a replacement
* byte : index of the request sequence
* byte : number of sequential requests
* int32 : number of pokemon
* for each pokemon:
* byte : whether it is legal to switch to this pokemon
Expand All @@ -756,6 +758,8 @@ struct NetworkBattleImpl {
msg << (unsigned char)(p->getSlot());
msg << (unsigned char)(p->getPosition());
msg << (unsigned char)m_replacement;
msg << (unsigned char)turn.size();
msg << (unsigned char)m_requests[party].size();

vector<bool> switches;
m_field->getLegalSwitches(p.get(), switches);
Expand Down

0 comments on commit 095ed40

Please sign in to comment.