-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport.py
More file actions
30 lines (23 loc) · 1.24 KB
/
report.py
File metadata and controls
30 lines (23 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# pack the message to send to the server
import struct
fields = {1: 'farm', 2: 'forest', 3: 'Jurassic Period'}
modes = {1: 'VIP', 2: 'normal'}
def chooseField(ID, field, mode):
head, kind, ID, field, mode, end = 0x0a, 0x27, ID, field, mode, 0x55
size = struct.calcsize('!HBB')
msg = struct.pack('!BBBHBBB', head, kind, size, ID, field, mode, end)
print('chooseField>>>>>>>>>>>>Client:player %d play in field %s and mode is %s' % (ID, field, mode))
return msg
def hitEgg(ID, table, field, site):
head, kind, ID, table, field, site, end = 0x0a, 0x31, ID, table, field, site, 0x55
size = struct.calcsize('!HHBB')
msg = struct.pack('!BBBHHBBB', head, kind, size, ID, table, field, site, end)
print('hitEgg>>>>>>>>>>>>Client:player %d player in field %s on %d table,hit the NO.%d egg'
% (ID, fields[field], table, site))
return msg
def morra(ID, stone, fabric, scissor):
head, kind, ID, stone, fabric, scissor, end = 0x0a, 0x35, ID, stone, fabric, scissor, 0x55
size = struct.calcsize('!HIII')
msg = struct.pack('!BBBHIIIB', head, kind, size, ID, stone, fabric, scissor, end)
print('morra>>>>>>>>>>>>Client:player %d bet stone %d,fabric %d,scissor %d' % (ID, stone, fabric, scissor))
return msg