-
Notifications
You must be signed in to change notification settings - Fork 15
/
Packet90Callback.go
37 lines (28 loc) · 1.41 KB
/
Packet90Callback.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
package main
import (
"fmt"
"github.com/Gskartwii/roblox-dissector/peer"
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/widgets"
)
func ShowPacket90(layerLayout *widgets.QVBoxLayout, context *peer.CommunicationContext, layers *peer.PacketLayers) {
MainLayer := layers.Main.(*peer.Packet90Layer)
layerLayout.AddWidget(NewQLabelF("Schema version: %d", MainLayer.SchemaVersion), 0, 0)
layerLayout.AddWidget(NewQLabelF("Int 1: %d", MainLayer.Int1), 0, 0)
layerLayout.AddWidget(NewQLabelF("Int 2: %d", MainLayer.Int2), 0, 0)
requestList := widgets.NewQTreeView(nil)
standardModel := NewProperSortModel(nil)
standardModel.SetHorizontalHeaderLabels([]string{"Flag name"})
requestListRootNode := standardModel.InvisibleRootItem()
for i := 0; i < len(MainLayer.RequestedFlags); i++ {
requestListRootNode.AppendRow([]*gui.QStandardItem{NewStringItem(MainLayer.RequestedFlags[i])})
}
requestList.SetModel(standardModel)
requestList.SetSelectionMode(0)
requestList.SetSortingEnabled(true)
layerLayout.AddWidget(NewLabel("Requested flags:"), 0, 0)
layerLayout.AddWidget(requestList, 0, 0)
layerLayout.AddWidget(widgets.NewQTextEdit2(fmt.Sprintf("Join data: %s", MainLayer.JoinData), nil), 0, 0)
layerLayout.AddWidget(widgets.NewQTextEdit2(fmt.Sprintf("Pubkey data: %X", MainLayer.PubKeyData), nil), 0, 0)
layerLayout.AddWidget(widgets.NewQTextEdit2(fmt.Sprintf("Version ID: %X", MainLayer.VersionID[:]), nil), 0, 0)
}