Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Linux Server List

cats addicted
Joined
Apr 1, 2010
Messages
1,367
Reaction score
286
You didnt. Like i said, it was very quiet in here :):
 
cats addicted
Joined
Apr 1, 2010
Messages
1,367
Reaction score
286
Script to setup Flash Media Server 3.5 and all dependencies automatically ( used for Webcam chats and most Flash browsergames )

Works fine on Ubuntu, didnt test on other dists :wink:

!!! MUST BE RUN AS ROOT OR WITH SUDO USING SUDO SU !!!

Code:
#!/bin/bash

exit_error()
{
    cd $ORIGINAL_CWD
    rm -rf $TEMPDIR
    echo $*
    exit 1
}

exit_noerror()
{
    cd $ORIGINAL_CWD
    rm -rf $TEMPDIR
}

trap exit_error HUP INT QUIT PIPE TERM
trap exit_noerror EXIT

TEMPDIR=`mktemp -d /tmp/install-fms-ubuntu.XXXXXXXXXX` || exit_error "Couldn't create temporary directory in /tmp"

ORIGINAL_CWD=`pwd`
cd $TEMPDIR

FMS_FILENAME="FlashMediaServer3.5.tar.gz"
FMS_URL="http://download.macromedia.com/pub/flashmediaserver/updates/3_5_3/Linux/$FMS_FILENAME"
PATCH_FILENAME=flash-media-server-3.5.3-ubuntu.patch
PATCH_URL="http://www.markusbe.com/wp-content/uploads/2009/09/$PATCH_FILENAME"
GETLIBS_URL="http://www.markusbe.com/wp-content/uploads/2009/09/getlibs"

DISTRIBUTION=`lsb_release -i | cut -f2`

if [ x"$DISTRIBUTION" != xUbuntu ]; then
    exit_error "Unsupported linux distribution."
fi

UBUNTU_VERSION=`lsb_release -r | cut -f2`
ARCHITECTURE=`uname -m`

case x"$UBUNTU_VERSION" in
    x6.06* | x8.04* | x8.10* | x9.04* | x9.10* | x10.04*)
    ;;
    *)
        exit_error "Ubuntu $UBUNTU_VERSION is not supported."
    ;;
esac

case x"$ARCHITECTURE" in
    "xi686")
        ARCH_BIT="32"
    ;;
    "xx86_64" | "xia64")
        ARCH_BIT="64"
    ;;
    *)
        exit_error "Architecture $ARCH_BIT is not supported."
    ;;
esac

# determine package dependencies
DEPS="patch"

if [ x"$ARCH_BIT" = "x64" ]; then
    DEPS=$DEPS" ia32-libs"
fi

if [ x"$ARCH_BIT" = "x32" ]; then
    DEPS=$DEPS" libexpat1"
    if [    x"${UBUNTU_VERSION:0:4}" = "x6.06" \
         -o x"${UBUNTU_VERSION:0:4}" = "x8.04" \
         -o x"${UBUNTU_VERSION:0:4}" = "x8.10" \
         -o x"${UBUNTU_VERSION:0:4}" = "x9.04" ]; then
         DEPS=$DEPS" libcap1"
    else
        DEPS=$DEPS" libcap2"
    fi

    if [ x"${UBUNTU_VERSION:0:4}" = "x6.06" ]; then
        DEPS=$DEPS" libnspr4"
    else
        DEPS=$DEPS" libnspr4-0d"
    fi
fi

# determine dependencies for which no package exists (and getlibs has to be used)
GETLIBS_DEPS=""

if [ x"$ARCH_BIT" = "x64" -a x"${UBUNTU_VERSION:0:4}" = "x8.10" ]; then
    GETLIBS_DEPS="libuuid1"
fi

if [ x"$ARCH_BIT" = "x64" -a x"${UBUNTU_VERSION:0:4}" = "x8.04" ]; then
    GETLIBS_DEPS="libuuid1 libnspr4-0d"
fi

if [ x"$ARCH_BIT" = "x64" -a x"${UBUNTU_VERSION:0:4}" = "x6.06" ]; then
    GETLIBS_DEPS="libuuid1 libnspr4 libcap1"
fi

if [ x"$GETLIBS_DEPS" = x ]; then
    echo "Ubuntu $UBUNTU_VERSION $ARCH_BIT bit supported."
else
    echo "Ubuntu $UBUNTU_VERSION $ARCH_BIT bit supported, BUT:"
    echo "Files will be installed bypassing the package manager, which means no automatic updates for these files." | fmt -w 75
    read -p "Continue? [Y/n] "
    if [ x"$REPLY" = xn -o x"$REPLY" = xN ]; then
        exit_error
    fi
fi

if [ ! -f "$ORIGINAL_CWD"/$FMS_FILENAME ]; then
    echo "Downloading Flash Media Server..."
    wget $FMS_URL -O "$ORIGINAL_CWD"/$FMS_FILENAME || exit_error "Error downloading Flash Media Server"
else
    echo "Flash Media Server installation package found."
fi
ln -s "$ORIGINAL_CWD"/$FMS_FILENAME $FMS_FILENAME

# Ready to go!

# unpack archive
echo -n "Extracting archive $FMS_FILENAME..."
tar xfz $FMS_FILENAME || exit_error "Error while extracting archive."
echo "done."

# check version
if [ ! -e FMS_3_5_3_r824a ]; then
    FMS_VERSION=`ls -d FMS* | head -1 | sed -e 's/^FMS_\([0-9]\+\)_\([0-9]\+\)_\([0-9]\+\)_r\([0-9a-z]\+\).*$/\1.\2.\3-r\4/'`
    echo "Found Flash Media Server $FMS_VERSION."
    echo "This script has been tested with Flash Media Server 3.5.3-r824a only."
    read -p "Continue anyway? [Y/n] "
    if [ x"$REPLY" = xn -o x"$REPLY" = xN ]; then
        exit 1
    fi
fi

# install dependencies - apt-get

echo "Installing dependencies: $DEPS"
sudo apt-get install $DEPS || exit_error "Error while installing dependencies"

# install dependencies - getlibs

if [ x"$GETLIBS_DEPS" != x ]; then
    wget $GETLIBS_URL || exit_error "Error downloading getlibs"
    sudo bash ./getlibs -p $GETLIBS_DEPS
fi

# library compatibility links

if [ "$ARCH_BIT" = "64" ]; then
    LIBDIR=lib32
elif [ "$ARCH_BIT" = "32" ]; then
    LIBDIR=lib
fi

# expat compatibility link

if [ -e /usr/$LIBDIR/libexpat.so.1 ]; then
    sudo ln -sf libexpat.so.1 /usr/$LIBDIR/libexpat.so.0 || exit_error "Error creating libexpat compatibility link"
elif [ -e /$LIBDIR/libexpat.so.1 ]; then
    sudo ln -sf libexpat.so.1 /$LIBDIR/libexpat.so.0 || exit_error "Error creating libexpat compatibility link"
else
    exit_error "Can't find libexpat.so.0. Please report to author at markusbe.com."
fi

# libcap compatibility link

if [ -e /$LIBDIR/libcap.so.2 -a ! -e /$LIBDIR/libcap.so.1 ]; then
    sudo ln -sf libcap.so.2 /$LIBDIR/libcap.so.1 || exit_error "Error creating libcap compatibility link"
fi

# download patch

wget $PATCH_URL || exit_error "Error downloading patch"

# apply patch

FMS_DIR=`ls -d FMS* | head -1`
(cd $FMS_DIR; patch -p1 < ../$PATCH_FILENAME || exit_error "Error applying patch")

# start installer
(cd $FMS_DIR; sudo ./installFMS && (echo "ALL DONE !"))

cd $ORIGINAL_CWD
exit 0
 
凸(ಠ益ಠ)凸
Joined
Jun 16, 2008
Messages
1,665
Reaction score
227
Didn't know flash media server could be used for games.

+Added to Linux Tools
 
cats addicted
Joined
Apr 1, 2010
Messages
1,367
Reaction score
286
Didn't know flash media server could be used for games.

+Added to Linux Tools

I dont know the name but there was a flash browsergame where 8 players are on one map. It uses FMS to stream the display to players.
 
Back
Top