for prc in args.config: loadPrcFile(prc) localconfig = '' if args.base_channel: localconfig += 'air-base-channel %s000000\n' % args.base_channel if args.max_channels: localconfig += 'air-channel-allocation %s\n' % args.max_channels if args.stateserver: localconfig += 'air-stateserver %s\n' % args.stateserver if args.astron_ip: localconfig += 'air-connect %s\n' % args.astron_ip if args.eventlogger_ip: localconfig += 'eventlog-host %s\n' % args.eventlogger_ip loadPrcFileData('Command-line', localconfig) from src.coginvasion.base.Metadata import Metadata __builtins__.metadata = Metadata() metadata.PROCESS = 'server' metadata.DEDICATED_SERVER = True loadPrcFileData('', 'window-type none') loadPrcFileData('', 'audio-library-name none') #PStatClient.connect("127.0.0.1") from direct.showbase.ShowBase import ShowBase base = ShowBase() # Limit server to a certain number of ticks per second #base.setSleep(1 / base.config.GetFloat('server-ticks', 30)) from p3recastnavigation import RNNavMeshManager
import builtins import sys sys.dont_write_bytecode = True from src.coginvasion.base.Metadata import Metadata metadata = Metadata() builtins.metadata = metadata metadata.PROCESS = 'server' metadata.DEDICATED_SERVER = True from panda3d.core import loadPrcFile, loadPrcFileData, ConfigVariableString, ConfigVariableDouble, VirtualFileSystem, Filename, PStatClient loadPrcFile('config/Confauto.prc') loadPrcFile('config/config_server.prc') loadPrcFileData('', 'model-path ./resources') # Don't require mounting of phases #PStatClient.connect() vfs = VirtualFileSystem.getGlobalPtr() vfs.mount(Filename("resources/phase_0.mf"), ".", VirtualFileSystem.MFReadOnly) vfs.mount(Filename("resources/phase_3.mf"), ".", VirtualFileSystem.MFReadOnly) vfs.mount(Filename("resources/phase_3.5.mf"), ".", VirtualFileSystem.MFReadOnly) vfs.mount(Filename("resources/phase_4.mf"), ".", VirtualFileSystem.MFReadOnly) vfs.mount(Filename("resources/phase_5.mf"), ".", VirtualFileSystem.MFReadOnly) vfs.mount(Filename("resources/phase_5.5.mf"), ".", VirtualFileSystem.MFReadOnly) vfs.mount(Filename("resources/phase_6.mf"), ".", VirtualFileSystem.MFReadOnly) vfs.mount(Filename("resources/phase_7.mf"), ".", VirtualFileSystem.MFReadOnly) vfs.mount(Filename("resources/phase_8.mf"), ".", VirtualFileSystem.MFReadOnly) vfs.mount(Filename("resources/phase_9.mf"), ".", VirtualFileSystem.MFReadOnly) vfs.mount(Filename("resources/phase_10.mf"), ".", VirtualFileSystem.MFReadOnly) vfs.mount(Filename("resources/phase_11.mf"), ".", VirtualFileSystem.MFReadOnly) vfs.mount(Filename("resources/phase_12.mf"), ".", VirtualFileSystem.MFReadOnly)
import PyQt5 except ImportError: print("ERROR: You need to pull in PyQt5 via pip to use the level editor") sys.exit(1) try: import py_linq except ImportError: print("ERROR: You need to pull in py_linq via pip to use the level editor") sys.exit(1) from PyQt5 import QtWidgets, QtGui import builtins from src.coginvasion.base.Metadata import Metadata metadata = Metadata() builtins.metadata = metadata from panda3d.core import loadPrcFile, loadPrcFileData, ConfigVariableString, ConfigVariableDouble loadPrcFile('config/Confauto.prc') loadPrcFile('config/config_client.prc') loadPrcFileData('', 'model-path ./resources') # Don't require mounting of phases loadPrcFileData('', 'model-path ./hl2/materials') loadPrcFileData('', 'model-path ./tf/materials') loadPrcFileData('', 'window-type none') from src.coginvasion.settings.SettingsManager import SettingsManager from src.coginvasion.settings.Setting import SHOWBASE_PREINIT, SHOWBASE_POSTINIT jsonFile = "settings.json"
if __name__ == "__main__": import builtins from src.coginvasion.base.Metadata import Metadata metadata = Metadata() builtins.metadata = metadata from panda3d.core import loadPrcFile, loadPrcFileData, ConfigVariableString, ConfigVariableDouble loadPrcFile('config/Confauto.prc') loadPrcFile('config/config_client.prc') loadPrcFileData( '', 'model-path ./resources') # Don't require mounting of phases if ConfigVariableString("threading-model", "").getValue() == "Cull/Draw": metadata.MULTITHREADED_PIPELINE = 1 from src.coginvasion.settings.SettingsManager import SettingsManager from src.coginvasion.settings.Setting import SHOWBASE_PREINIT, SHOWBASE_POSTINIT jsonFile = "settings.json" sm = SettingsManager() from src.coginvasion.globals import CIGlobals CIGlobals.SettingsMgr = sm sm.loadFile(jsonFile) sm.doSunriseFor(sunrise=SHOWBASE_PREINIT) from src.mod.ModBase import ModBase base = ModBase() sm.doSunriseFor(sunrise=SHOWBASE_POSTINIT)
Copyright (c) CIO Team. All rights reserved. @file Standalone.py @author Maverick Liberty @date November 7, 2015 @desc This is so you can use client objects in a stand-alone program easily. """ from panda3d.core import loadPrcFile, loadPrcFileData from panda3d.core import CullBinManager, AntialiasAttrib from panda3d.core import UniqueIdAllocator import builtins from src.coginvasion.base.Metadata import Metadata builtins.metadata = Metadata() metadata.USE_LIGHTING = 1 loadPrcFile('config/Confauto.prc') loadPrcFile('config/config_client.prc') loadPrcFileData('', 'model-path ./resources') # Don't require mounting of phases loadPrcFileData('', 'framebuffer-multisample 0') loadPrcFileData('', 'multisamples 16') loadPrcFileData('', 'tk-main-loop 0') loadPrcFileData('', 'egg-load-old-curves 0') loadPrcFileData('', 'model-path resources') cbm = CullBinManager.getGlobalPtr() cbm.addBin('ground', CullBinManager.BTUnsorted, 18) cbm.addBin('shadow', CullBinManager.BTBackToFront, 19)