示例#1
0
    def initialize(self):
        self.penguin.nickname = Nickname(self.dbpenguin.nickname, self.ref)
        self.penguin.swid = self.dbpenguin.swid

        #TODO: figure out why the hell EPF even exists.
        self.penguin.epf = EPFAgent(self.dbpenguin.agent,
                                    str(self.dbpenguin.epf), self.ref)

        self.penguin.RefreshHandler = Refresh(self.ref)

        self.penguin.moderator = int(self.dbpenguin.moderator)
        self.penguin.stealth_mode = self['moderator'] == 2
        self.penguin.mascot_mode = self['moderator'] == 3

        self.penguin.x = self.penguin.y = self.penguin.frame = 0
        self.penguin.age = Age(self.dbpenguin.create, self.ref)
        self.penguin.muted = False

        self.penguin.cache = Cache(self.ref)
        self.penguin.ninjaHandler = NinjaHandler(self.ref)
        self.penguin.currencyHandler = CurrencyHandler(self.ref)

        self.engine.musicHandler.init(self.ref)

        GeneralEvent('onBuildClient', self.ref)
示例#2
0
    def initialize(self):
        self.penguin.nickname = Nickname(self.dbpenguin.nickname, self)
        self.penguin.inventory = Inventory(self)
        self.penguin.inventory.parseFromString(self.dbpenguin.inventory)

        self.penguin.member = Membership(self.dbpenguin.membership, self)
        self.penguin.moderator = False  #:P

        self.penguin.x = self.penguin.y = self.penguin.frame = self.penguin.avatar = 0

        self.penguin.coins = Coins(self.dbpenguin.coins, self)
        self.penguin.age = Age(self.dbpenguin.create, self)

        self.penguin.cache = Cache(self)
        self.penguin.muted = False

        self.penguin.epf = EPFAgent(self.dbpenguin.agent,
                                    str(self.dbpenguin.epf), self)

        clothing = [Color, Head, Face, Neck, Body, Hand, Feet, Pin, Photo]
        for cloth in clothing:
            name = cloth.__name__.lower()
            self.penguin[name] = cloth(0, 0, name + " item", False, False,
                                       False)

        self.penguin.mail = MailHandler(self)
        self.penguin.iglooHandler = PenguinIglooHandler(self)
        self.penguin.puffleHandler = PuffleHandler(self)
        self.penguin.stampHandler = StampHandler(self)

        self.loadClothing()
示例#3
0
def HandleWorldPenguinLogin(client, nickname, _id, swid, password, confirmHash,
                            loginkey):
    exist = yield client.db_penguinExists(value=_id)

    if not exist:
        client.send("e", 101)
        returnValue(client.disconnect())

    client.penguin.nickname = Nickname(nickname, client)
    client.penguin.password = password
    client.penguin.id = _id
    client.penguin.swid = swid

    yield client.db_init()
    client.penguin.username = Username(client.dbpenguin.username, client)
    if not client.dbpenguin.swid == swid or not client.dbpenguin.nickname == nickname:
        client.send('e', 101)
        returnValue(client.disconnect())

    banned = yield client.banned()
    if banned:
        returnValue(0)
    a = yield client.engine.redis.server.ping()
    print a
    isLoggedIn = yield client.engine.redis.isPenguinLoggedIn(client.penguin.id)
    if isLoggedIn:
        client.send('e', 3)
        returnValue(client.disconnect())

    details = yield client.engine.redis.getPlayerKey(client.penguin.id)
    if not details:
        client.send('e', 101)
        returnValue(client.disconnect())

    if not client.CryptoHandler.bcheck(
            details, loginkey[32:]) or not client.CryptoHandler.bcheck(
                details, confirmHash) or not client.CryptoHandler.bcheck(
                    details, password):
        client.send('e', 101)
        returnValue(client.disconnect())

    yield client.engine.redis.server.delete("conf:{}".format(
        client.penguin.id))
    yield client.engine.redis.server.hmset(
        "online:{}".format(client.penguin.id), {
            'server': client.engine.id,
            'place': 0,
            'playing': 0,
            'waddling': 0,
            'joined': 0
        })

    client.ReceivePacketEnabled = True

    client.send('l', 'timeline')
示例#4
0
    def initialize(self):
        self.penguin.nickname = Nickname(self.dbpenguin.nickname,
                                         self.selfRefer)
        self.penguin.swid = self.dbpenguin.swid
        self.penguin.inventory = Inventory(self.selfRefer)
        self.penguin.inventory.parseFromString(self.dbpenguin.inventory)

        self.penguin.member = Membership(self.dbpenguin.membership,
                                         self.selfRefer)
        self.penguin.moderator = int(self.dbpenguin.moderator)
        self.penguin.stealth_mode = self['moderator'] == 2
        self.penguin.mascot_mode = self['moderator'] == 3

        self.penguin.x = self.penguin.y = self.penguin.frame = self.penguin.avatar = 0

        self.penguin.coins = Coins(self.dbpenguin.coins, self.selfRefer)
        self.penguin.age = Age(self.dbpenguin.create, self.selfRefer)

        self.penguin.cache = Cache(self.selfRefer)
        self.penguin.muted = False

        self.penguin.epf = EPFAgent(self.dbpenguin.agent,
                                    str(self.dbpenguin.epf), self.selfRefer)

        clothing = [Color, Head, Face, Neck, Body, Hand, Feet, Pin, Photo]
        for cloth in clothing:
            name = cloth.__name__.lower()
            self.penguin[name] = cloth(0, 0, name + " item", False, False,
                                       False)

        self.penguin.mail = MailHandler(self.selfRefer)
        self.penguin.iglooHandler = PenguinIglooHandler(self.selfRefer)
        self.penguin.puffleHandler = PuffleHandler(self.selfRefer)
        self.penguin.stampHandler = StampHandler(self.selfRefer)
        self.penguin.ninjaHandler = NinjaHandler(self.selfRefer)
        self.penguin.currencyHandler = CurrencyHandler(self.selfRefer)
        self.penguin.friendsHandler = FriendsHandler(self.selfRefer)

        self.engine.musicHandler.init(self.selfRefer)

        self.loadClothing()

        GeneralEvent('onBuildClient', self.selfRefer)
示例#5
0
    def initialize(self):
        self.penguin.nickname = Nickname(self.dbpenguin.nickname,
                                         self.selfRefer)
        self.penguin.swid = self.dbpenguin.swid

        self.penguin.RefreshHandler = Refresh(self)

        self.penguin.moderator = int(self.dbpenguin.moderator)
        self.penguin.stealth_mode = self['moderator'] == 2
        self.penguin.mascot_mode = self['moderator'] == 3

        self.penguin.x = self.penguin.y = self.penguin.frame = 0
        self.penguin.age = Age(self.dbpenguin.create, self.selfRefer)
        self.penguin.muted = False

        self.penguin.cache = Cache(self.selfRefer)
        self.penguin.ninjaHandler = NinjaHandler(self.selfRefer)
        self.penguin.currencyHandler = CurrencyHandler(self.selfRefer)

        self.engine.musicHandler.init(self.selfRefer)

        GeneralEvent('onBuildClient', self.selfRefer)