/usr/games/balazar3 is in balazar3-common 0.1-10.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | #!/usr/bin/python -O
# -*- python -*-
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import sys, os, os.path
HERE = os.path.dirname(sys.argv[0])
if HERE.endswith("games"): # /usr/{local/}games
APPDIR = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..", "share", "games"))
elif HERE.endswith("bin"): # /usr/{local/}bin
APPDIR = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..", "share"))
else: # Raw source not installed
APPDIR = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))
print "* Balazar 3 * Balazar 3 lives in %s" % APPDIR
sys.path.insert(0, APPDIR)
try:
import psyco
psyco.full()
except:
print "* Balazar 3 * (Psyco not found; if you are using an x86 processor, installing psyco can speed up Balazar 3)"
import balazar3.globdef as globdef
import balazar3.tofu as tofu
mode = "gui"
i = 1
while i < len(sys.argv):
if sys.argv[i] == "--zaurus" : globdef.ZAURUS = 1
elif sys.argv[i] == "--single" : mode = "single"; i += 1; globdef.SINGLE_LOGIN = sys.argv[i]; i += 1; globdef.SINGLE_PASSWORD = sys.argv[min(i, len(sys.argv) - 1)]
elif sys.argv[i] == "--client" : mode = "client"; i += 1; globdef.CLIENT_HOST = sys.argv[i]; i += 1; globdef.CLIENT_LOGIN = sys.argv[i]; i += 1; globdef.CLIENT_PASSWORD = sys.argv[min(i, len(sys.argv) - 1)]
elif sys.argv[i] == "--server" : mode = "server"; i += 1; globdef.SERVER_HOST = sys.argv[i]; globdef.DRIVER = "dummy"
elif sys.argv[i] == "--port" : i += 1; globdef.CLIENT_PORT = globdef.SERVER_PORT = int(sys.argv[i])
elif sys.argv[i] == "--gui" : mode = "gui"
elif sys.argv[i] == "--2d" : globdef.DRIVER = "2d"
elif sys.argv[i] == "--2d800x480" : globdef.DRIVER = "2d800x480"
elif sys.argv[i] == "--3d" : globdef.DRIVER = "3d"
elif sys.argv[i] == "--no-fps-limit" : globdef.LIMIT_FPS = 0
elif sys.argv[i] == "--fullscreen" : globdef.FULLSCREEN = 1
elif sys.argv[i] == "--windowed" : globdef.FULLSCREEN = 0
elif sys.argv[i] == "--screensize" : i += 1; globdef.SCREEN_WIDTH = int(sys.argv[i]); i += 1; globdef.SCREEN_HEIGHT = int(sys.argv[i])
elif sys.argv[i] == "--sound" : i += 1; globdef.SOUND_VOLUME = float(sys.argv[i])
elif sys.argv[i] == "--saved-game-dir": i += 1; globdef.SAVED_GAME_DIR = sys.argv[i]
elif sys.argv[i] == "--version" :
print "Balazar III version %s." % globdef.VERSION
sys.exit()
elif sys.argv[i] == "--help" :
print """Balazar III : a dungeon adventure game
Usages :
balazar3 [options...]
Starts the game menu.
balazar3 [options...] --single <login> [<password>]
Starts a single player game named <login>.
balazar3 [options...] --server <host>
Starts the server on <host>.
balazar3 [options...] --client <host> <login> [<password>]
Starts a client and connect to server <host> with login <login>
and password <password>. If login doesn't exist, a new player is
created.
Where options are:
--3d Use the 3D driver
--2d Use the 2D driver in 640x480
--2d800x480 Use the 2D driver in 800x480
--saved-game-dir <path> Set the directory where games are saved and loaded to <path>
--sound <volume> Set sound volume (0.0 - 1.0)
--port <port> Use network port <port>
--fullscreen Fullscreen mode (3D driver only)
--windowed Windowed mode (3D driver only)
--screensize <width> <height> Sets the screen size (in pixel, 3D driver only)
--zaurus Zaurus optimized mode (disable key repeat)
--no-fps-limit Disable FPS limit, for benchmarking (default is to limit the FPS to 30-40)
--help This help
--version Shows version number
Available drivers: %s.
""" % ", ".join(globdef.AVAILABLE_DRIVERS)
sys.exit()
else:
print "Unknown option %s!"% sys.argv[i]
sys.exit(1)
i += 1
if globdef.ZAURUS:
globdef.DRIVER = "2d"
# On Zaurus, key repeat consumes A LOT of time ! => disable them during the game
os.system("khctl killrepeat")
import atexit
def reset_khctl_normal(): os.system("khctl reload")
atexit.register(reset_khctl_normal)
from balazar3.game import *
init()
if mode == "single": start_single()
elif mode == "client": start_multi()
elif mode == "server": start_server()
elif mode == "gui":
exec "import balazar3.menu_%s as menu" % globdef.DRIVER
menu.start()
# python ./balazar3/balazar3 --single jiba
# python ./balazar3/balazar3 --server localhost
# python ./balazar3/balazar3 --client localhost jiba
# python ./balazar3/balazar3 --client localhost blam
# service shorewall clear
# python ./balazar3/balazar3 --server 192.168.100.5
# python ./balazar3/balazar3 --client 192.168.100.5 jiba
# python ./balazar3/balazar3 --client 192.168.100.5 blam
|