Documentation ¶
Index ¶
Constants ¶
View Source
const ( HostMethodUnknown = 0 HostMethodManual = 1 HostMethodUPNP = 2 HostMethodMITM = 3 )
The enum values for HostMethod.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct { ID string `json:"-" gorm:"primary_key;size:64"` ContentHash string `json:"-" gorm:"size:64"` RoomID int32 `json:"id" gorm:"AUTO_INCREMENT;unique_index"` Username string `json:"username"` Country string `json:"country" gorm:"size:2"` GameName string `json:"game_name"` GameCRC string `json:"game_crc"` CoreName string `json:"core_name"` CoreVersion string `json:"core_version"` SubsystemName string `json:"subsystem_name"` RetroArchVersion string `json:"retroarch_version"` Frontend string `json:"frontend"` IP net.IP `json:"ip" gorm:"not null"` Port uint16 `json:"port"` MitmHandle string `json:"-"` MitmAddress string `json:"mitm_ip"` MitmPort uint16 `json:"mitm_port"` MitmSession string `json:"mitm_session"` HostMethod HostMethod `json:"host_method"` HasPassword bool `json:"has_password"` HasSpectatePassword bool `json:"has_spectate_password"` Connectable bool `json:"connectable"` IsRetroArch bool `json:"is_retroarch"` CreatedAt time.Time `json:"created"` UpdatedAt time.Time `json:"updated" gorm:"index"` }
Session is the database presentation of a netplay session.
func (*Session) CalculateContentHash ¶
func (s *Session) CalculateContentHash()
CalculateContentHash creates a 32 byte SHAKE256 (SHA3) hash of the session content.
func (*Session) CalculateID ¶
func (s *Session) CalculateID()
CalculateID creates a 32 byte SHAKE256 (SHA3) hash of the session for the db to use as PK.
func (*Session) PrintForRetroarch ¶
PrintForRetroarch prints out the session information in a format that retroarch is expecting.
Click to show internal directories.
Click to hide internal directories.