nex-protocols-go icon indicating copy to clipboard operation
nex-protocols-go copied to clipboard

[Enhancement]: Modernize game-specific protocol extensions

Open JPeisach opened this issue 1 year ago • 1 comments
trafficstars

Checked Existing

  • [X] I have checked the repository for duplicate issues.

What enhancement would you like to see?

Some game server protocol extensions (for example, Splatoon), are not as modernized with the rest of the codebase.

For example, creating a Ranking protocol is normally handled like this:

func NewProtocol() *Protocol {
	return &Protocol{}
}

However, the Splatoon ranking protocol extension still requires the protocol to be made with the endpoint:

// NewProtocol returns a new RankingSplatoon protocol
func NewProtocol(endpoint nex.EndpointInterface) *Protocol {
	protocol := &Protocol{endpoint: endpoint}
	protocol.rankingProtocol.SetEndpoint(endpoint)

	return protocol
}

Mario Kart 8's ranking also has this:

// NewProtocol returns a new RankingMarioKart8 protocol
func NewProtocol(endpoint nex.EndpointInterface) *Protocol {
	protocol := &Protocol{endpoint: endpoint}
	protocol.rankingProtocol.SetEndpoint(endpoint)

	return protocol
}

The game-specific protocol extensions should be updated for consistency.

Any other details to share? (OPTIONAL)

No response

JPeisach avatar Jul 29 '24 00:07 JPeisach

I should mention that Jon said that he wants game-specific protocols to be moved out of this library though?

JPeisach avatar Jul 29 '24 01:07 JPeisach

Closing since we decided internally to remove game-specific protocols from this package

jonbarrow avatar Apr 06 '25 19:04 jonbarrow