INNER CODE UNIT · Go

HandleWebSocketConnection

GoMudEngine/GoMud · main.go:1112

func HandleWebSocketConnection(conn *websocket.Conn) {

	var userObject *users.UserRecord
	connDetails := connections.Add(nil, conn)

	// Setup shared state map for this connection's handlers
	// Needs to be created BEFORE the first handler call
	var sharedState map[string]any = make(map[string]any)

	// Describes whatever the client sent us
	clientInput := &connections.ClientInput{
		ConnectionId: connDetails.ConnectionId(),
		DataIn:       []byte{},
		Buffer:       make([]byte, 0, connections.ReadBufferSize),
		EnterPressed: false,
		Clipboard:    []byte{},
		History:      connections.InputHistory{},
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…