Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make all appends in realm re-init slices #147

Merged
merged 2 commits into from
Sep 25, 2023
Merged

Conversation

thehowl
Copy link
Collaborator

@thehowl thehowl commented Sep 25, 2023

still need to test this out with the live realm :)

@netlify
Copy link

netlify bot commented Sep 25, 2023

Deploy Preview for gnochess-signup-form canceled.

Name Link
🔨 Latest commit 1012ae2
🔍 Latest deploy log https://app.netlify.com/sites/gnochess-signup-form/deploys/6511d357d772e4000825e622

@netlify
Copy link

netlify bot commented Sep 25, 2023

Deploy Preview for gnochess canceled.

Name Link
🔨 Latest commit 1012ae2
🔍 Latest deploy log https://app.netlify.com/sites/gnochess/deploys/6511d357266cc8000812d782

Copy link
Contributor

@tbruyelle tbruyelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with all the traces I've setup to track that bug and it works perfectly, match making is stable now!!

Here is the trace I added, can be helpful for other bug:

func Render(string) string {
	var s string
	now := time.Now()
	for tc, sublob := range lobby {
		s += ufmt.Sprintf("<h3>lobby %s</h3>", tc)
		for i, pl := range sublob {
			lastSeen := now.Sub(lobby[tc][i].seenAt)			
			s += ufmt.Sprintf("<p>player%d %s<br/>seentAt=%s</br>now=%s</br>duration=%s </p>", i, pl.player.Address, pl.seenAt, now, lastSeen)
		}
	}
	s += "<h3>GAMES</h3>"
	lobbyPlayer2Game.Iterate("", "", func(key string, value interface{}) bool {
		g := value.(*Game)
		s += ufmt.Sprintf("<p>Player %s %s</p>", key, g.ID)
		return false
	})

	s += "<h3>PLAYERS</h3>"

	playerStore.Iterate("", "", func(key string, value interface{}) bool {
		s += ufmt.Sprintf("<p>Player %s</p>", key)
		return false
	})

	return s
}

@thehowl thehowl merged commit ab8c600 into main Sep 25, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants