本文整理汇总了Golang中Network.QTPacket.ReadUint32方法的典型用法代码示例。如果您正苦于以下问题:Golang QTPacket.ReadUint32方法的具体用法?Golang QTPacket.ReadUint32怎么用?Golang QTPacket.ReadUint32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network.QTPacket
的用法示例。
在下文中一共展示了QTPacket.ReadUint32方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: NewTeamPokeFromPacket
func NewTeamPokeFromPacket(_packet *pnet.QTPacket) *TeamPoke {
teamPoke := TeamPoke{}
teamPoke.UID = NewUniqueIdFromPacket(_packet)
teamPoke.Nick = _packet.ReadString()
teamPoke.Item = int(_packet.ReadUint16())
teamPoke.Ability = int(_packet.ReadUint16())
teamPoke.Nature = int(_packet.ReadUint8())
teamPoke.Gender = int(_packet.ReadUint8())
// teamPoke.Gen = (int)_packet.ReadByte()
teamPoke.Shiny = _packet.ReadBool()
teamPoke.Happiness = int(_packet.ReadUint8())
teamPoke.Level = int(_packet.ReadUint8())
teamPoke.Moves = make([]int, 4)
for i := 0; i < 4; i++ {
teamPoke.Moves[i] = int(_packet.ReadUint32())
}
teamPoke.DVs = make([]int, 6)
for i := 0; i < 6; i++ {
teamPoke.DVs[i] = int(_packet.ReadUint8())
}
teamPoke.EVs = make([]int, 6)
for i := 0; i < 6; i++ {
teamPoke.EVs[i] = int(_packet.ReadUint8())
}
return &teamPoke
}
示例2: battleMessage
func (c *POClient) battleMessage(_packet *pnet.QTPacket) {
if c.battle != nil {
_packet.ReadUint32() // Supporting only one battle, unneeded
_packet.ReadUint32() // Discard the size, unneeded
c.battle.ReceiveCommand(_packet)
}
}
示例3: engageBattle
func (c *POClient) engageBattle(_packet *pnet.QTPacket) {
c.bID = int(_packet.ReadUint32())
pID1 := int(_packet.ReadUint32())
pID2 := int(_packet.ReadUint32())
if pID1 == 0 { // This is us!
battleConf := NewBattleConfFromPacket(_packet)
// Start the battle
c.battle = NewBattle(c, battleConf, _packet, c.players[battleConf.GetId(0)], c.players[battleConf.GetId(1)], c.mePlayer.Id, c.bID)
fmt.Printf("Battle between %s and %s started!\n", c.mePlayer.Nick, c.players[pID2].Nick)
}
}
示例4: NewShallowBattlePokeFromPacket
func NewShallowBattlePokeFromPacket(_packet *pnet.QTPacket, _isMe bool) *ShallowBattlePoke {
shallowPoke := ShallowBattlePoke{Types: make([]int, 2)}
shallowPoke.UID = NewUniqueIdFromPacket(_packet)
shallowPoke.RNick = _packet.ReadString()
shallowPoke.Nick = shallowPoke.RNick
if !_isMe {
shallowPoke.Nick = "the foe's " + shallowPoke.Nick
shallowPoke.getName()
shallowPoke.getTypes()
}
shallowPoke.LifePercent = int(_packet.ReadUint8())
shallowPoke.fullStatus = _packet.ReadUint32()
shallowPoke.Gender = int(_packet.ReadUint8())
shallowPoke.Shiny = _packet.ReadBool()
shallowPoke.Level = int(_packet.ReadUint32())
return &shallowPoke
}
示例5: receivedBeginTurn
func (b *Battle) receivedBeginTurn(_packet *pnet.QTPacket) {
turn := _packet.ReadUint32()
b.WriteToHist(fmt.Sprintf("Start of turn %d!\n", turn))
}