mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-16 17:35:57 -05:00
6367929688
* Added automap.go stub * Fixed bad error handling * Handle header error from io.Copy() * d2client.ClientConnection renamed to ServerConnection Having two interfaces named ClientConnection in adjacent packages was a point of confusion for me. Renamed the client ClientConnection to ServerConnection since clients connect to servers and servers to clients. * Fix lint warnings in remote_client_connection.go * Tidying and lint warnings in remote_client_connection.go * Switch statement in remote_client_connection.go now has matching blocks. * RemoteClientConnection.serverListener refactor. The switch statement is still repetitive but now it's separate. I think we would need generics to make it smaller. * Receiver name change from l to r. * Comments and other adjustments. * Old commits * Fixed bad error handling * Cleaned up remote_client_connection.go * SendPacketToClient removed.
16 lines
458 B
Go
16 lines
458 B
Go
package d2client
|
|
|
|
import (
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2networking"
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2networking/d2netpacket"
|
|
)
|
|
|
|
// ServerConnection is an interface for abstracting local and
|
|
// remote server connections.
|
|
type ServerConnection interface {
|
|
Open(connectionString string, saveFilePath string) error
|
|
Close() error
|
|
SendPacketToServer(packet d2netpacket.NetPacket) error
|
|
SetClientListener(listener d2networking.ClientListener)
|
|
}
|