Skip to content

Commit

Permalink
Removed obsolete data param from 'give' command
Browse files Browse the repository at this point in the history
  • Loading branch information
MEDVEDx64 committed Jan 5, 2022
1 parent 8cfff0a commit a4bf546
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 27 deletions.
12 changes: 0 additions & 12 deletions driver.py

This file was deleted.

15 changes: 3 additions & 12 deletions funky.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def do_GET(self):
+ '<input type="text" size="8" name="amount" value="0.0"> '
+ '<input type="submit" value="Submit"></form>')
self.wfile.write("<h5><b style=\"color: #e11\">Warning:</b> "
+ "your order won't be delivered, unless you're in game! (this doesn't affects vouchers above)</h5>")
+ "your order won't be delivered, unless you're in game! (this doesn't affect vouchers above)</h5>")
is_admin = user_is_admin(username)
query = {'in_stock': True}
if is_admin:
Expand Down Expand Up @@ -230,7 +230,7 @@ def do_GET(self):
self.html_block_end()
if is_sold_items_hidden:
self.html_block_start()
self.wfile.write('<i style="font-size: 10pt">Some sold-out item entries is not shown, '
self.wfile.write('<i style="font-size: 10pt">Some sold-out item entries are not shown, '
+ 'check your <a style="color: #436" href="/settings">settings</a> if you want to see them.</i>')
self.html_block_end()
self.html_end()
Expand Down Expand Up @@ -799,18 +799,9 @@ def do_POST(self):
if d['price']:
ok, message = money.transfer(db, u, bank_user, d['price'] * amount)
if ok:
item = itemid
data = '0'
if ' ' in itemid:
s = itemid.strip().split(' ')
item = s[0]
data = s[1]
if 'left' in d:
db['items'].update({'item_id': itemid}, {'$set': {'left': d['left'] - amount}})
result = default_driver.process(nick, item, amount, data)
if result:
self.html_redirect('/message?m=Transaction fault: ' + str(result))
return
rcon.ItemSender(nick, itemid, amount).start()
db['sold'].insert({'who': nick, 'what': itemid, 'when': datetime.now(),
'amount': amount, 'price': d['price']})
self.html_redirect('/?m=' + message)
Expand Down
5 changes: 2 additions & 3 deletions rcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ def teleport_to_kernel(nick):
Teleporter(nick, -157, 59, 15).start()

class ItemSender(DetachedRconExecutor):
def __init__(self, nick, item_id, amount=1, data=0):
def __init__(self, nick, item_id, amount=1):
super(ItemSender, self).__init__()
self.nick = nick
self.item_id = item_id
self.amount = amount
self.data = data

def execute(self):
amount_left = self.amount
Expand All @@ -54,5 +53,5 @@ def execute(self):
if amount_left < 64:
c = amount_left
amount_left -= c
self.rcon.command('give ' + self.nick + ' ' + self.item_id + ' ' + str(c) + ' ' + self.data)
self.rcon.command('give ' + self.nick + ' ' + self.item_id + ' ' + str(c))
sleep(0.5)

0 comments on commit a4bf546

Please sign in to comment.