INNER CODE UNIT · Go

detectClientType

GoMudEngine/GoMud · main.go:625

func detectClientType(connDetails *connections.ConnectionDetails, clientInput *connections.ClientInput, sharedState map[string]any) {

	connId := connDetails.ConnectionId()

	if connDetails.ConnType() == connections.ConnAI {
		cs := connections.GetClientSettings(connId)
		cs.DetectionComplete = true
		connections.OverwriteClientSettings(connId, cs)
		return
	}

	// Ask the client to enable NEW-ENVIRON. A Mudlet client replies WILL, which
	// TelnetIACHandler answers with the MNES SEND request; Mudlet then returns
	// its CLIENT_NAME. Non-Mudlet clients reply WONT (or never reply -> timeout).
	connections.SendTo(term.TelnetRequestNewEnviron.BytesWithPayload(nil), connId)

	buf := make([]byte, connections.ReadBufferSize)
	deadline := time.Now().Add(clientDetectTimeout)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…