-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Horrible refactor to allow unpacking net messages
- Loading branch information
1 parent
a78bf12
commit 81f6b89
Showing
10 changed files
with
79 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
package messages7 | ||
|
||
import "github.com/teeworlds-go/teeworlds/network7" | ||
import ( | ||
"github.com/teeworlds-go/teeworlds/network7" | ||
"github.com/teeworlds-go/teeworlds/packer" | ||
) | ||
|
||
type NetMessage interface { | ||
MsgId() int | ||
MsgType() network7.MsgType | ||
System() bool | ||
Vital() bool | ||
Pack() []byte | ||
Unpack(u *packer.Unpacker) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package messages7 | ||
|
||
import ( | ||
"github.com/teeworlds-go/teeworlds/network7" | ||
"github.com/teeworlds-go/teeworlds/packer" | ||
) | ||
|
||
type ReadyToEnter struct { | ||
} | ||
|
||
func (msg ReadyToEnter) MsgId() int { | ||
return network7.MsgGameReadyToEnter | ||
} | ||
|
||
func (msg ReadyToEnter) MsgType() network7.MsgType { | ||
return network7.TypeNet | ||
} | ||
|
||
func (msg ReadyToEnter) System() bool { | ||
return false | ||
} | ||
|
||
func (msg ReadyToEnter) Vital() bool { | ||
return true | ||
} | ||
|
||
func (msg ReadyToEnter) Pack() []byte { | ||
return []byte{} | ||
} | ||
|
||
func (msg *ReadyToEnter) Unpack(u *packer.Unpacker) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters