diff options
author | Meistache <crie.fernanda@gmail.com> | 2015-02-22 14:15:36 -0300 |
---|---|---|
committer | Meistache <crie.fernanda@gmail.com> | 2015-02-22 14:15:36 -0300 |
commit | bd6b97110b2e73bcdb3ad83c6b605e10bc75736a (patch) | |
tree | 27ddc4a6011b0d8639a3a9a97cc66232408cf372 /storage.py | |
parent | 576f092fda4d3b89f9cf6fd3de96e280a0d8b775 (diff) | |
download | manamarket-bd6b97110b2e73bcdb3ad83c6b605e10bc75736a.tar.gz manamarket-bd6b97110b2e73bcdb3ad83c6b605e10bc75736a.tar.bz2 manamarket-bd6b97110b2e73bcdb3ad83c6b605e10bc75736a.tar.xz manamarket-bd6b97110b2e73bcdb3ad83c6b605e10bc75736a.zip |
Storage finally working - may enter on test
Diffstat (limited to 'storage.py')
-rw-r--r-- | storage.py | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -22,6 +22,7 @@ class Storage: def __init__(self): self.storage = {} self.timer = 0 + self.mapserv = 0 self.Open = mutex.mutex() def reset(self): @@ -89,27 +90,27 @@ class Storage: if not item_found: return "Server and client storage out of sync." - def storage_send(self, mapserv, index, amount): + def storage_send(self, index, amount): packet = PacketOut(CMSG_MOVE_TO_STORAGE) packet.write_int16(index + inventory_offset) packet.write_int32(amount) - mapserv.sendall(str(packet)) + self.mapserv.sendall(str(packet)) return 0 - def storage_get(self, mapserv, index, amount): + def storage_get(self, index, amount): packet = PacketOut(CMSG_MOVE_FROM_STORAGE) packet.write_int16(index + storage_offset) packet.write_int32(amount) - mapserv.sendall(str(packet)) + self.mapserv.sendall(str(packet)) return 0 - def storage_open(self, mapserv): + def storage_open(self): self.timer = time.time() - mapserv.sendall(chat("@storage")) + self.mapserv.sendall(chat("@storage")) - def storage_close(self, mapserv): + def storage_close(self): self.reset() - mapserv.sendall(str(PacketOut(CMSG_CLOSE_STORAGE))) + self.mapserv.sendall(str(PacketOut(CMSG_CLOSE_STORAGE))) if __name__ == '__main__': print "Do not run this file directly. Run main.py" |