PretendoNetwork / nex-protocols-go

NEX servers with protocol support in Go
GNU Affero General Public License v3.0
31 stars 12 forks source link

[Enhancement]: Modernize game-specific protocol extensions #82

Open ItzSwirlz opened 1 month ago

ItzSwirlz commented 1 month ago

Checked Existing

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

ItzSwirlz commented 1 month ago

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