Ejemplo n.º 1
0
                                MIN_TERRITORY_COUNT, MAX_TERRITORY_COUNT,
                                UPDATE_FREQUENCY, UPDATE_FPS, NETWORK_FPS)
from pyspades.types import MultikeyDict, IDPool
from pyspades.master import get_master_connection
#from pyspades.debug import *
from pyspades.team import Team
from pyspades.entities import Territory
# importing tc_data is a quick hack since this file writes into it
from pyspades.player import ServerConnection, tc_data
from pyspades import world
from pyspades.bytes import ByteWriter
from pyspades import contained as loaders
from pyspades.common import make_color
from pyspades.mapgenerator import ProgressiveMapGenerator

fog_color = loaders.FogColor()
world_update = loaders.WorldUpdate()
intel_capture = loaders.IntelCapture()
territory_capture = loaders.TerritoryCapture()


class ServerProtocol(BaseProtocol):
    connection_class = ServerConnection

    name = 'pyspades server'
    game_mode = CTF_MODE
    max_players = 32
    connections = None
    player_ids = None
    master = False
    max_score = 10
Ejemplo n.º 2
0
 def set_fog_color(self, color):
     self.fog_color = color
     fog_color = loaders.FogColor()
     fog_color.color = make_color(*color)
     self.send_contained(fog_color, save=True)
Ejemplo n.º 3
0
def send_fog(player, color):
    fog_color = loaders.FogColor()
    fog_color.color = make_color(*color)
    player.send_contained(fog_color)