Skip to content

Commit af0c202

Browse files
committed
Change dates and got permission from Hajime Hoshi to relicense to MIT
1 parent b2697b5 commit af0c202

File tree

3 files changed

+23
-26
lines changed

3 files changed

+23
-26
lines changed

ebiten-game/game/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
1+
// SPDX-FileCopyrightText: 2025 The Pion community <https://pion.ly>
22
// SPDX-License-Identifier: MIT
33

44
package main

ebiten-game/game/ui.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
2-
// SPDX-License-Identifier: MIT
3-
4-
// SPDX-License-Identifier: Apache-2.0
51
// SPDX-FileCopyrightText: 2024 The Ebitengine Authors
2+
// SPDX-License-Identifier: MIT
63

74
package main
85

ebiten-game/signaling-server/main.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
1+
// SPDX-FileCopyrightText: 2025 The Pion community <https://pion.ly>
22
// SPDX-License-Identifier: MIT
33

44
package main
@@ -19,7 +19,7 @@ import (
1919

2020
type ClientConnection struct {
2121
IsHost bool
22-
Offer *webrtc.SessionDescription
22+
Offer *webrtc.SessionDescription
2323
Answer *webrtc.SessionDescription
2424
}
2525

@@ -41,11 +41,11 @@ var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
4141
func generateNewLobbyId() string {
4242
// have random size for lobby id
4343
size := 6
44-
buffer := make([]rune, size)
45-
for i := range buffer {
46-
buffer[i] = letters[rand.Intn(len(letters))]
47-
}
48-
id := string(buffer)
44+
buffer := make([]rune, size)
45+
for i := range buffer {
46+
buffer[i] = letters[rand.Intn(len(letters))]
47+
}
48+
id := string(buffer)
4949

5050
// check if room id is already in lobby_list
5151
_, ok := lobby_list[id]
@@ -90,10 +90,10 @@ func main() {
9090

9191
fmt.Println("Server started on port 3000")
9292
// cors.Default() setup the middleware with default options being
93-
// all origins accepted with simple methods (GET, POST). See
94-
// documentation below for more options.
95-
handler := cors.Default().Handler(mux)
96-
http.ListenAndServe(":3000", handler)
93+
// all origins accepted with simple methods (GET, POST). See
94+
// documentation below for more options.
95+
handler := cors.Default().Handler(mux)
96+
http.ListenAndServe(":3000", handler)
9797
}
9898

9999
func lobbyHost(w http.ResponseWriter, r *http.Request) {
@@ -106,7 +106,7 @@ func lobbyHost(w http.ResponseWriter, r *http.Request) {
106106
// return lobby id to host
107107
io.Writer.Write(w, []byte(lobby_id))
108108
fmt.Println("lobbyHost")
109-
fmt.Printf("lobby added: %s\n",lobby_id)
109+
fmt.Printf("lobby added: %s\n", lobby_id)
110110
// print all lobbies
111111
fmt.Printf("lobby_list:%s\n", getLobbyIds())
112112
}
@@ -124,7 +124,7 @@ func lobbyJoin(w http.ResponseWriter, r *http.Request) {
124124
lobby, ok := lobby_list[lobby_id]
125125
// If the key doesn't exist, return error
126126
if !ok {
127-
w.WriteHeader(http.StatusNotFound)
127+
w.WriteHeader(http.StatusNotFound)
128128
w.Write([]byte("404 - Lobby not found"))
129129
return
130130
}
@@ -172,7 +172,7 @@ func lobbyUnregisteredPlayers(w http.ResponseWriter, r *http.Request) {
172172
lobby := lobby_list[lobby_id]
173173
lobby.mutex.Lock()
174174
defer lobby.mutex.Unlock()
175-
175+
176176
// get all players who haven't been registered yet
177177
player_ids := []int{}
178178
for i, client := range lobby.Clients {
@@ -198,18 +198,18 @@ func validatePlayer(w http.ResponseWriter, r *http.Request) (*Lobby, int, error)
198198
defer lobby.mutex.Unlock()
199199
// If the key doesn't exist, return error
200200
if !ok {
201-
w.WriteHeader(http.StatusNotFound)
201+
w.WriteHeader(http.StatusNotFound)
202202
w.Write([]byte("404 - Lobby not found"))
203203
return nil, 0, errors.New("Lobby not found")
204204
}
205205

206206
player_id_string := r.URL.Query().Get("player_id")
207207
player_id, err := strconv.Atoi(player_id_string)
208-
if err != nil {
209-
w.WriteHeader(http.StatusNotFound)
208+
if err != nil {
209+
w.WriteHeader(http.StatusNotFound)
210210
w.Write([]byte("404 - Player not found"))
211211
return nil, 0, errors.New("Player not found")
212-
}
212+
}
213213
//fmt.Printf("player_id: %d\n", player_id)
214214
//fmt.Printf("length of lobby.Clients: %d\n", len(lobby_list[lobby_id].Clients))
215215
//fmt.Println(lobby.Clients)
@@ -245,14 +245,14 @@ func offerGet(w http.ResponseWriter, r *http.Request) {
245245
io.Writer.Write(w, jsonValue)
246246

247247
/*
248-
fmt.Println("offerGet")
249-
fmt.Println(jsonValue)
248+
fmt.Println("offerGet")
249+
fmt.Println(jsonValue)
250250
*/
251251
}
252252

253253
func offerPost(w http.ResponseWriter, r *http.Request) {
254254
fmt.Println("offerPost")
255-
255+
256256
lobby, player_id, err := validatePlayer(w, r)
257257
if err != nil {
258258
return

0 commit comments

Comments
 (0)