Skip to content

Commit

Permalink
Remove gamepad and server code
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandoislas committed May 30, 2017
1 parent d933657 commit fc09c01
Show file tree
Hide file tree
Showing 37 changed files with 154 additions and 1,453 deletions.
30 changes: 6 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
FROM debian:jessie

RUN apt-get update \
&& apt-get install -y curl \
&& curl -s https://packagecloud.io/install/repositories/rolandoislas/drc-sim/script.deb.sh | bash
RUN apt-get update \
&& apt-get install -y \
wpasupplicant-drc \
python3 \
python3-dev \
python3-pip \
libffi-dev \
zlib1g-dev \
libjpeg-dev \
net-tools \
wireless-tools \
sysvinit-utils \
psmisc \
libavcodec-dev \
libswscale-dev \
rfkill \
isc-dhcp-client \
ifmetric

ADD drc*.py /root/
ADD setup.py /root/
ADD src/ /root/src/
ADD resources/ /root/resources/
ADD MANIFEST.in /root/
RUN cd /root/ && python3 setup.py install
ADD install.sh /root/

RUN apt-get update \
&& cd /root/ \
&& ./install.sh local

ENV TERM xterm
ENTRYPOINT ["drc-sim-backend.py", "--cli"]
ENTRYPOINT ["drc-sim-backend", "--cli"]
CMD ["-h"]
19 changes: 12 additions & 7 deletions drc-info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@
import time
from threading import Thread

from src.server.data import constants
from src.server.data.struct import input, command

PORT_WII_MSG = 50010
PORT_WII_VID = 50020
PORT_WII_AUD = 50021
PORT_WII_HID = 50022
PORT_WII_CMD = 50023

sock_cmd = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock_cmd.bind(("192.168.1.10", constants.PORT_WII_CMD))
sock_cmd.bind(("192.168.1.10", PORT_WII_CMD))
sock_msg = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock_msg.bind(("192.168.1.10", constants.PORT_WII_MSG))
sock_msg.bind(("192.168.1.10", PORT_WII_MSG))
sock_hid = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock_hid.bind(("192.168.1.10", constants.PORT_WII_HID))
sock_hid.bind(("192.168.1.10", PORT_WII_HID))
sock_vid = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock_vid.bind(("192.168.1.10", constants.PORT_WII_VID))
sock_vid.bind(("192.168.1.10", PORT_WII_VID))
sock_aud = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock_aud.bind(("192.168.1.10", constants.PORT_WII_AUD))
sock_aud.bind(("192.168.1.10", PORT_WII_AUD))

json_dump = {}

Expand Down Expand Up @@ -50,7 +55,7 @@ def print_packet_cmd(sock):


def send_cmd(data):
sock_cmd.sendto(data, ("192.168.1.11", constants.PORT_WII_CMD + 100))
sock_cmd.sendto(data, ("192.168.1.11", PORT_WII_CMD + 100))


def send_command_from_string(command_string, sid):
Expand Down
4 changes: 2 additions & 2 deletions drc-sim-backend.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from src.server.data import constants
from src.server.data.config_server import ConfigServer
from src.server.util.logging.logger_wpa import LoggerWpa
from src.server.data.args import Args
from src.server.data.config_server import ConfigServer
from src.server.ui.cli.cli_main import CliMain
from src.server.util.logging.logger import Logger
from src.server.util.logging.logger_backend import LoggerBackend
from src.server.util.logging.logger_cli import LoggerCli
from src.server.util.logging.logger_gui import LoggerGui
from src.server.util.logging.logger_wpa import LoggerWpa
from src.server.util.os_util import OsUtil


Expand Down
42 changes: 30 additions & 12 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

REPO_DRC_SIM="https://github.com/rolandoislas/drc-sim.git"
REPO_WPA_SUPPLICANT_DRC="https://github.com/rolandoislas/drc-hostap.git"
REPO_DRC_SIM_C="https://github.com/rolandoislas/drc-sim-c.git"
INSTALL_DIR="/opt/drc_sim/"
PATH_APPLICATION_LAUNCHER="/usr/share/applications/drc-sim-backend.desktop"
PATH_ICON="/usr/share/icons/hicolor/512x512/apps/drcsimbackend.png"
Expand All @@ -19,11 +20,13 @@ check_os() {
if command -v apt-get &> /dev/null; then
echo "Command apt-get found."
# Backend dependencies
dependencies=("python3" "python3-dev" "python3-pip" "libffi-dev" "zlib1g-dev" "libjpeg-dev"
"net-tools" "wireless-tools" "sysvinit-utils" "psmisc" "libavcodec-dev" "libswscale-dev" "rfkill"
dependencies=("python3" "python3-pip"
"net-tools" "wireless-tools" "sysvinit-utils" "psmisc" "rfkill"
"isc-dhcp-client" "ifmetric" "python3-tk" "gksu")
# Wpa supplicant compile dependencies
dependencies+=("git" "libssl-dev" "libnl-genl-3-dev" "gcc" "make")
# DRC Sim Server C++
dependencies+=("libavcodec-dev" "libswscale-dev" "libjpeg-dev" "cmake")
else
echo "The command apt-get was not found. This OS is not supported."
exit 1
Expand Down Expand Up @@ -108,18 +111,13 @@ get_git() {

# Compiles wpa_supplicant after fetching it from git
compile_wpa() {
if command -v wpa_supplicant_drc &> /dev/null && command -v wpa_cli_drc &> /dev/null; then
echo "Skipping wpa_supplicant compile"
return 0
fi
get_git ${REPO_WPA_SUPPLICANT_DRC} "wpa"
echo "drc-hostap"
echo "Compiling wpa_supplicant_drc"
wpa_dir="${INSTALL_DIR}wpa/wpa_supplicant/"
compile_dir="${INSTALL_DIR}wpa/wpa_supplicant/"
cur_dir="${PWD}"
cd "${wpa_dir}" &> /dev/null || return 1
cd "${compile_dir}" &> /dev/null || return 1
cp ../conf/wpa_supplicant.config ./.config &> /dev/null || return 1
compile_log="${wpa_dir}make.log"
compile_log="${compile_dir}make.log"
echo "Compile log at ${compile_log}"
make &> ${compile_log} || return 1
echo "Installing wpa_supplicant_drc and wpa_cli_drc to /usr/local/bin"
Expand All @@ -129,8 +127,26 @@ compile_wpa() {
return 0
}

# Compiles drc_sim_c after fetching it from git
compile_drc_sim_c() {
get_git ${REPO_DRC_SIM_C} "drc_sim_c"
echo "Compiling drc_sim_c"
compile_dir="${INSTALL_DIR}drc_sim_c/"
cur_dir="${PWD}"
cd "${compile_dir}" &> /dev/null || return 1
compile_log="${compile_dir}make.log"
echo "Compile log at ${compile_log}"
cmake "$compile_dir" &> /dev/null || return 1
make &> ${compile_log} || return 1
echo "Installing drc_sim_c to /usr/local/bin"
make install &> /dev/null || return 1
cd "${cur_dir}" &> /dev/null || return 1
return 0
}

# Installs drc-sim in a virtualenv
install_drc_sim() {
echo "Installing DRC Sim Server GUI/CLI Utility"
# Paths
drc_dir="${INSTALL_DIR}drc/"
cur_dir="${PWD}"
Expand Down Expand Up @@ -158,8 +174,9 @@ install_drc_sim() {
echo "Activating virtualenv"
source "${venv_dir}bin/activate" || return 1
# Remove an existing install of drc-sim
#echo "Attempting to remove previous installations"
#pip uninstall drc-sim &> /dev/null || return 1
echo "Attempting to remove previous installations"
pip uninstall -y drcsim &> /dev/null || \
echo "Failed to remove the previous installation. Attempting to install anyway."
# Set the directory
cd "${drc_dir}" &> /dev/null || return 1
# Branch to checkout
Expand Down Expand Up @@ -268,6 +285,7 @@ post_install() {
install() {
install_dependencies
pass_fail compile_wpa "Compiled wpa_supplicant" "Failed to compile wpa_supplicant"
pass_fail compile_drc_sim_c "Compiled drc_sim_c" "Failed to compile drc_sim_c"
pass_fail install_drc_sim "Created virtualenv for drc-sim" "Failed to create virtualenv for drc-sim"
pass_fail install_launch_script "Launch script installed." "Failed to install launch script"
pass_fail install_desktop_launcher "Installed application launcher" "Failed to install desktop application launcher"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
setup(name='drcsim',
version=constants.VERSION,
description='Wii U gamepad simulator.',
install_requires=['construct==2.8.11', 'Pillow==3.4.2', 'cffi==1.9.1', 'netifaces==0.10.5', 'pexpect==4.2.1'],
install_requires=['netifaces==0.10.5', 'pexpect==4.2.1'],
packages=find_packages(),
include_package_data=True,
data_files=[('resources/config', ['resources/config/get_psk.conf']),
Expand Down
Empty file removed src/server/control/__init__.py
Empty file.
165 changes: 0 additions & 165 deletions src/server/control/gamepad.py

This file was deleted.

26 changes: 0 additions & 26 deletions src/server/control/server.py

This file was deleted.

Empty file.
Loading

0 comments on commit fc09c01

Please sign in to comment.