This repository has been archived by the owner on Oct 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpacketfuncs.go
72 lines (66 loc) · 1.83 KB
/
packetfuncs.go
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package main
import (
"bytes"
"encoding/json"
"fmt"
"os"
)
func (b *Bot) updateGameBoard() string {
r := UpdateHomePageRequest{}
r.OnBoardVariantDailyReward = 0
r.OnBoardVariantScratcher = 1
bb := new(bytes.Buffer)
json.NewEncoder(bb).Encode(&r)
return string(bb.Bytes())
}
//the id is the "resultid" obtained from the big boi packet (updatehomepageresponse)
func (b *Bot) playScratcherRequest(resultid int) string {
ps := PlayScratcherRequest{}
ps.AreaPlayed = 1
ps.IsSpecialScratcher = false
ps.VariantDailyReward = 0
ps.ResultID = resultid
bb := new(bytes.Buffer)
json.NewEncoder(bb).Encode(&ps)
return string(bb.Bytes()[:bb.Len()-1]) //some sort of hidden line feed byte at the end causes it to bug out (ascii decimal code 10)
}
func (b *Bot) enterLuckyCodeRequest(code string) string {
lc := SaveLuckyCodeRequest{}
lc.Code = code
bb := new(bytes.Buffer)
json.NewEncoder(bb).Encode(&lc)
return string(bb.Bytes())
}
func (b *Bot) registerRequest(email, password, devicev, token, first, last string) string {
p := RegisterRequest{}
p.Email = email
p.UserDevice.DeviceToken = genTotalDeviceToken()
p.UserDevice.DeviceVersion = "iPhone 6s Plus"
p.UserDevice.OperatingSys = 0
p.FirstName = getRandString(10)
p.LastName = getRandString(10)
p.Password = "SomePassword123"
buf := new(bytes.Buffer)
enc := json.NewEncoder(buf)
err := enc.Encode(&p)
if err != nil {
fmt.Printf("error encoding config file: %s\n", err)
os.Exit(1)
}
return string(buf.Bytes())
}
func (b *Bot) loginRequest() string {
lr := LoginRequest{}
lr.Email = b.Account.Email
lr.Password = b.Account.Password
lr.MyDevice = b.Account.MyDevice
loc := Location{}
loc.City = ""
loc.Country = ""
lr.MyLocation = loc
lr.GameVersion = gameVersion
lr.Notification = ""
bb := new(bytes.Buffer)
json.NewEncoder(bb).Encode(&lr)
return string(bb.Bytes())
}