def onWorldSave(): if ENABLEDFANCYSTATUS: # Creating Dialog dialog = cGump(nomove=1, nodispose=1, x=150, y=150) dialog.setType( 0x98FA2C10 ) # NEVER change this Type or Gump will not be closed in the end of save dialog.addResizeGump(0, 0, 9200, 291, 90) dialog.addCheckerTrans(0, 0, 291, 90) dialog.addText(47, 19, tr("WORLDSAVE IN PROGRESS"), 2122) dialog.addText(47, 37, tr("Saving %i items.") % (wolfpack.itemcount()), 2100) dialog.addText(47, 55, tr("Saving %i characters.") % (wolfpack.charcount()), 2100) dialog.addTilePic(3, 25, 4167) # Sending to players worldsocket = wolfpack.sockets.first() while worldsocket: dialog.send(worldsocket) worldsocket = wolfpack.sockets.next()
def handleStatus(socket, packet): statusPacket = 1 for i in range(0, packet.size): if packet.getbyte(i) != statusRequest[i]: statusPacket = 0 break if statusPacket: status = 'olfpack, Clients=%i, Items=%i, Chars=%i, Version="%s"' % ( wolfpack.sockets.count(), wolfpack.itemcount(), wolfpack.charcount(), wolfpack.serverversion()) packet = wolfpack.packet(87, len(status) + 2) packet.setascii(1, status) packet.send(socket) socket.log(LOG_MESSAGE, "Sent status information.\n") return statusPacket
def onWorldSave(): if ENABLEDFANCYSTATUS: # Creating Dialog dialog = cGump( nomove=1, nodispose=1, x=150, y=150 ) dialog.setType( 0x98FA2C10 ) # NEVER change this Type or Gump will not be closed in the end of save dialog.addResizeGump( 0, 0, 9200, 291, 90 ) dialog.addCheckerTrans( 0, 0, 291, 90 ) dialog.addText( 47, 19, tr( "WORLDSAVE IN PROGRESS" ), 2122 ) dialog.addText( 47, 37, tr( "Saving %i items." )%( wolfpack.itemcount() ), 2100 ) dialog.addText( 47, 55, tr( "Saving %i characters." )%( wolfpack.charcount() ), 2100 ) dialog.addTilePic( 3, 25, 4167 ) # Sending to players worldsocket = wolfpack.sockets.first() while worldsocket: dialog.send( worldsocket ) worldsocket = wolfpack.sockets.next()
def handleStatus(socket, packet): statusPacket = 1 for i in range(0, packet.size): if packet.getbyte(i) != statusRequest[i]: statusPacket = 0 break if statusPacket: status = 'olfpack, Clients=%i, Items=%i, Chars=%i, Version="%s"' % (wolfpack.sockets.count(), wolfpack.itemcount(), wolfpack.charcount(), wolfpack.serverversion()) packet = wolfpack.packet(87, len(status) + 2) packet.setascii(1, status) packet.send(socket) socket.log(LOG_MESSAGE, "Sent status information.\n") return statusPacket
def serverinfo(socket, command, arguments): global initialized if not initialized: initializeValues() char = socket.player version = wolfpack.serverversion() uptime = wolfpack.time.currenttime() / 1000 upseconds = uptime upminutes = (uptime / 60) upseconds -= (upminutes * 60) if upseconds <= 9: upseconds = '0%s' % (upseconds) uphours = (upminutes / 60) upminutes -= (uphours * 60) if upminutes <= 9: upminutes = '0%s' % (upminutes) if uphours <= 9: uphours = '0%s' % (uphours) timestring = '%s:%s:%s' % (uphours, upminutes, upseconds) onlinecount = wolfpack.sockets.count() accountcount = 0 admincount = 0 gmcount = 0 seercount = 0 counselorcount = 0 playercount = 0 acclist = wolfpack.accounts.list for i in acclist(): record = wolfpack.accounts.find(i) accountcount += 1 if record.acl == 'admin': admincount += 1 if record.acl == 'gm': gmcount += 1 if record.acl == 'seer': seercount += 1 if record.acl == 'counselor': counselorcount += 1 if record.acl == 'player': playercount += 1 gump = cGump(x=30, y=30) gump.addBackground(id=0x2436, width=280, height=400) # Basic Info text = '<basefont color="#FFFF00"><center><h3>%s Shard Status</h3></center><br />' % ( shardname) text += '<basefont color="#FEFEFE">' text += ' Version: %s<br />' % (version) text += ' Uptime: %s<br />' % (timestring) # Account Info text += '<basefont color="#FFFF00"><center><h3>Account Information</h3></center><br />' text += '<basefont color="#FEFEFE">' text += ' Online Accounts: <basefont color="#00FFFF">%i <basefont color="#FEFEFE">/ <basefont color="#00FFFF">%i<br />' % ( onlinecount, accountcount) text += '<basefont color="#FEFEFE">' text += ' Total Admins: <basefont color="#00FF00">%i<br />' % ( admincount) text += '<basefont color="#FEFEFE">' text += ' Total Seers: <basefont color="#00FF00">%i<br />' % ( seercount) text += '<basefont color="#FEFEFE">' text += ' Total Counselors: <basefont color="#00FF00">%i<br />' % ( counselorcount) text += '<basefont color="#FEFEFE">' text += ' Total Players: <basefont color="#00FF00">%i<br />' % ( playercount) text += '<basefont color="#FEFEFE">' text += ' Total Characters: <basefont color="#00FF00">%i<br />' % ( wolfpack.charcount()) text += '<basefont color="#FEFEFE">' text += ' Total Items: <basefont color="#00FF00">%i<br />' % ( wolfpack.itemcount()) # Hardware Info text += '<basefont color="#FFFF00"><center><h3>Server Information</h3></center><br />' text += '<basefont color="#FEFEFE">' text += ' OS: %s<br />' % (operatingsystem) text += ' Processor: %s<br />' % (processor) text += ' Memory: %s<br />' % (memory) gump.addHtmlGump(x=20, y=20, width=240, height=360, html=text) gump.send(char) return
def serverinfo( socket, command, arguments ): global initialized if not initialized: initializeValues() char = socket.player version = wolfpack.serverversion() uptime = wolfpack.time.currenttime() / 1000 upseconds = uptime upminutes = ( uptime / 60 ) upseconds -= ( upminutes * 60 ) if upseconds <= 9: upseconds = '0%s' % ( upseconds ) uphours = ( upminutes / 60 ) upminutes -= ( uphours * 60 ) if upminutes <= 9: upminutes = '0%s' % ( upminutes ) if uphours <= 9: uphours = '0%s' % ( uphours ) timestring = '%s:%s:%s' % ( uphours, upminutes, upseconds ) onlinecount = wolfpack.sockets.count() accountcount = 0 admincount = 0 gmcount = 0 seercount = 0 counselorcount = 0 playercount = 0 acclist = wolfpack.accounts.list for i in acclist(): record = wolfpack.accounts.find( i ) accountcount += 1 if record.acl == 'admin': admincount += 1 if record.acl == 'gm': gmcount += 1 if record.acl == 'seer': seercount += 1 if record.acl == 'counselor': counselorcount += 1 if record.acl == 'player': playercount += 1 gump = cGump( x=30, y=30) gump.addBackground( id=0x2436, width=280, height=400 ) # Basic Info text = '<basefont color="#FFFF00"><center><h3>%s Shard Status</h3></center><br />' % ( shardname ) text += '<basefont color="#FEFEFE">' text += ' Version: %s<br />' % ( version ) text += ' Uptime: %s<br />' % ( timestring ) # Account Info text += '<basefont color="#FFFF00"><center><h3>Account Information</h3></center><br />' text += '<basefont color="#FEFEFE">' text += ' Online Accounts: <basefont color="#00FFFF">%i <basefont color="#FEFEFE">/ <basefont color="#00FFFF">%i<br />' % ( onlinecount, accountcount ) text += '<basefont color="#FEFEFE">' text += ' Total Admins: <basefont color="#00FF00">%i<br />' % ( admincount ) text += '<basefont color="#FEFEFE">' text += ' Total Seers: <basefont color="#00FF00">%i<br />' % ( seercount ) text += '<basefont color="#FEFEFE">' text += ' Total Counselors: <basefont color="#00FF00">%i<br />' % ( counselorcount ) text += '<basefont color="#FEFEFE">' text += ' Total Players: <basefont color="#00FF00">%i<br />' % ( playercount ) text += '<basefont color="#FEFEFE">' text += ' Total Characters: <basefont color="#00FF00">%i<br />' % ( wolfpack.charcount() ) text += '<basefont color="#FEFEFE">' text += ' Total Items: <basefont color="#00FF00">%i<br />' % ( wolfpack.itemcount() ) # Hardware Info text += '<basefont color="#FFFF00"><center><h3>Server Information</h3></center><br />' text += '<basefont color="#FEFEFE">' text += ' OS: %s<br />' % ( operatingsystem ) text += ' Processor: %s<br />' % ( processor ) text += ' Memory: %s<br />' % ( memory ) gump.addHtmlGump( x=20, y=20, width=240, height=360, html=text ) gump.send( char ) return