Skip to content

Commit

Permalink
Removed and modified comments
Browse files Browse the repository at this point in the history
  • Loading branch information
luskaner committed Jul 21, 2024
1 parent 2beb4d0 commit 59dcbfe
Show file tree
Hide file tree
Showing 22 changed files with 10 additions and 104 deletions.
2 changes: 0 additions & 2 deletions server/models/advertisement.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ type Advertisement struct {
startTime int64
chat []Message
peers *orderedmap.OrderedMap[*User, *Peer]
//tags map[string]int32
}

var peers = make(map[*User]interface{})
Expand Down Expand Up @@ -215,7 +214,6 @@ func StoreAdvertisement(advFrom *shared.AdvertisementHostRequest) *Advertisement
adv.team = advFrom.Team
adv.statGroup = advFrom.StatGroup
adv.peers = orderedmap.New[*User, *Peer]()
//adv.tags = make(map[string]int32)
adv.chat = make([]Message, 0)
u, _ := GetUserById(advFrom.HostId)
adv.NewPeer(u, advFrom.Race, advFrom.Team)
Expand Down
5 changes: 0 additions & 5 deletions server/models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,6 @@ func (u *User) GetExtraProfileInfo() i.A {
}

func (u *User) GetProfileInfo(includePresence bool) i.A {
/*isSteamInt := 1
if u.isXbox {
isSteamInt = 0
}*/
profileInfo := i.A{
time.Now().UTC().Unix() - rand.Int63n(300-50+1) + 50,
u.id,
Expand All @@ -196,7 +192,6 @@ func (u *User) GetProfileInfo(includePresence bool) i.A {
u.alias,
"",
u.statId,
//isSteamInt,
1,
1,
0,
Expand Down
1 change: 0 additions & 1 deletion server/routes/game/account/setAvatarMetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ import (
)

func SetAvatarMetadata(w http.ResponseWriter, _ *http.Request) {
// TODO: Implement
i.JSON(&w, i.A{2, i.A{}})
}
1 change: 0 additions & 1 deletion server/routes/game/account/setLanguage.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ import (
)

func SetLanguage(w http.ResponseWriter, _ *http.Request) {
// TODO: Implement
i.JSON(&w, i.A{2})
}
1 change: 0 additions & 1 deletion server/routes/game/achievement/getAchievements.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ func GetAchievements(w http.ResponseWriter, r *http.Request) {
sess.GetUser().GetId(),
// DO NOT RETURN ACHIEVEMENTS AS IT WILL *REALLY* GRANT THEM ON XBOX
i.A{},
// asset.Achievements,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion server/routes/game/achievement/syncStats.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

func SyncStats(w http.ResponseWriter, _ *http.Request) {
// TODO: What does it do?
// What does it do?
i.JSON(&w,
i.A{2},
)
Expand Down
77 changes: 0 additions & 77 deletions server/routes/game/advertisement/shared/advertisementRequest.go
Original file line number Diff line number Diff line change
@@ -1,82 +1,5 @@
package shared

/*type ModDllRequest struct {
File string `schema:"moddllfile"`
Checksum uint32 `schema:"moddllchecksum"`
}
type ObserversRequest struct {
Enabled bool `schema:"isObservable"`
Delay bool `schema:"observerDelay"`
Password string `schema:"observerPassword"`
}
type PasswordBaseRequest struct {
Value string `schema:"password"`
}
type PasswordRequest struct {
PasswordBaseRequest
Enabled bool `schema:"passworded"`
}
type AdvertisementBaseRequest struct {
Id int32 `schema:"advertisementid"`
AppBinaryChecksum uint32 `schema:"appbinarychecksum"`
DataChecksum uint32 `schema:"datachecksum"`
ModDll ModDllRequest
ModName string `schema:"modname"`
ModVersion string `schema:"modversion"`
Party int32 `schema:"party"`
Race int32 `schema:"race"`
Team int32 `schema:"team"`
VersionFlags uint32 `schema:"versionFlags"`
}
type AdvertisementUpdateRequest struct {
Id int32 `schema:"advertisementid"`
AppBinaryChecksum uint32 `schema:"appbinarychecksum"`
DataChecksum uint32 `schema:"datachecksum"`
ModDll ModDllRequest
ModName string `schema:"modname"`
ModVersion string `schema:"modversion"`
VersionFlags uint32 `schema:"versionFlags"`
Description string `schema:"description"`
AutomatchPollId int32 `schema:"automatchPoll_id"`
MapName string `schema:"mapname"`
HostId int32 `schema:"hostid"`
Observers ObserversRequest
Password PasswordRequest
Visible bool `schema:"visible"`
Joinable bool `schema:"joinable"`
MatchType uint8 `schema:"matchtype"`
MaxPlayers uint8 `schema:"maxplayers"`
Options string `schema:"options"`
SlotInfo string `schema:"slotinfo"`
PlatformSessionId uint64 `schema:"psnSessionID"`
State int8 `schema:"state"`
}
type AdvertisementHostRequest struct {
AdvertisementBaseRequest
Description string `schema:"description"`
AutomatchPollId int32 `schema:"automatchPoll_id"`
RelayRegion string `schema:"relayRegion"`
MapName string `schema:"mapname"`
HostId int32 `schema:"hostid"`
Observers ObserversRequest
Password PasswordRequest
Visible bool `schema:"visible"`
StatGroup int32 `schema:"statgroup"`
Joinable bool `schema:"joinable"`
MatchType uint8 `schema:"matchtype"`
MaxPlayers uint8 `schema:"maxplayers"`
Options string `schema:"options"`
SlotInfo string `schema:"slotinfo"`
PlatformSessionId uint64 `schema:"psnSessionID"`
State int8 `schema:"state"`
}*/

type AdvertisementBaseRequest struct {
Id int32 `schema:"advertisementid"`
AppBinaryChecksum uint32 `schema:"appbinarychecksum"`
Expand Down
2 changes: 1 addition & 1 deletion server/routes/game/challenge/shared/challenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import (
)

func GetChallengeProgressData() i.A {
// TODO: Empty means all completed?
// Empty means all completed?
return i.A{}
}
2 changes: 1 addition & 1 deletion server/routes/game/chat/getChatChannels.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import (
)

func GetChatChannels(w http.ResponseWriter, _ *http.Request) {
// TODO: What even are chat channels? plus the server seems to always return the same thing
// What even are chat channels? plus the server seems to always return the same thing
i.JSON(&w, i.A{0, i.A{}, 100})
}
2 changes: 1 addition & 1 deletion server/routes/game/chat/getOfflineMessages.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func GetOfflineMessages(w http.ResponseWriter, r *http.Request) {
// TODO: What even are chat channels? plus the server seems to always return the same thing
// What even are chat channels? plus the server seems to always return the same thing
sess, _ := middleware.Session(r)
i.JSON(&w, i.A{0, i.A{}, i.A{i.A{strconv.Itoa(int(sess.GetUser().GetId())), i.A{}}}, i.A{}, i.A{}, i.A{}})
}
1 change: 0 additions & 1 deletion server/routes/game/clan/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ import (
)

func Create(w http.ResponseWriter, _ *http.Request) {
// TODO: Implement in memory?
i.JSON(&w, i.A{2, nil, nil, i.A{}})
}
4 changes: 2 additions & 2 deletions server/routes/game/item/getInventoryByProfileIDs.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ func GetInventoryByProfileIDs(w http.ResponseWriter, r *http.Request) {
initialData := make(i.A, len(profileIds))
finalData := make(i.A, len(profileIds))
finalDataArr := i.A{
// TODO: What this mean?
// What this mean?
i.A{1, 0, 0, 0, 10000, 0, 0, 0, 1},
i.A{2, 0, 1, 0, 10000, 0, 1, 1, 0},
}
for j, profileId := range profileIds {
profileIdStr := strconv.Itoa(int(profileId))
initialData[j] = i.A{
profileIdStr,
// TODO: Understand what these values mean
// And this?
i.A{},
}
finalData[j] = i.A{
Expand Down
2 changes: 1 addition & 1 deletion server/routes/game/item/getItemLoadouts.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import (
)

func GetItemLoadouts(w http.ResponseWriter, _ *http.Request) {
// TODO: Implement, what is this? maybe mods?
// What is this? maybe mods?
i.JSON(&w, i.A{0, i.A{}})
}
2 changes: 1 addition & 1 deletion server/routes/game/leaderboard/applyOfflineUpdates.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import (
)

func ApplyOfflineUpdates(w http.ResponseWriter, _ *http.Request) {
// TODO: Implement? which kind of updates?
// Which kind of updates?
i.JSON(&w, i.A{0, i.A{}, i.A{}})
}
1 change: 0 additions & 1 deletion server/routes/game/leaderboard/getRecentMatchHistory.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ import (
)

func GetRecentMatchHistory(w http.ResponseWriter, _ *http.Request) {
// TODO: Implement? just in memory does not make much sense
i.JSON(&w, i.A{0, i.A{}})
}
1 change: 0 additions & 1 deletion server/routes/game/leaderboard/setAvatarStatValues.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ import (
)

func SetAvatarStatValues(w http.ResponseWriter, _ *http.Request) {
// TODO: Implement?
i.JSON(&w, i.A{0})
}
1 change: 0 additions & 1 deletion server/routes/game/party/finalizeReplayUpload.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ import (
)

func FinalizeReplayUpload(w http.ResponseWriter, _ *http.Request) {
// TODO: Implement? in memory-only does not make much sense
i.JSON(&w, i.A{0})
}
2 changes: 1 addition & 1 deletion server/routes/game/party/peerUpdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func PeerUpdate(w http.ResponseWriter, r *http.Request) {
// TODO: What about isNonParticipants[]? observers? ai players?
// What about isNonParticipants[]? observers? ai players?
adv, length, profileIds, raceIds, statGroupIds, teamIds := shared.ParseParameters(r)
if adv == nil {
i.JSON(&w, i.A{2})
Expand Down
1 change: 0 additions & 1 deletion server/routes/game/party/reportMatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ import (
)

func ReportMatch(w http.ResponseWriter, _ *http.Request) {
// What else is needed to implement?
i.JSON(&w, i.A{2, i.A{}, i.A{}, i.A{}, nil, i.A{}, i.A{}, i.A{}, i.A{}, i.A{}, i.A{}, 0, nil, i.A{}, i.A{}, i.A{}})
}
2 changes: 1 addition & 1 deletion server/routes/game/party/sendMatchChat.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func SendMatchChat(w http.ResponseWriter, r *http.Request) {
currentUser := sess.GetUser()

// Only peers within the match can send messages
// TODO: What about AI?
// What about AI?
if _, ok := adv.GetPeer(currentUser); !ok {
i.JSON(&w, i.A{2})
return
Expand Down
1 change: 0 additions & 1 deletion server/routes/game/relationship/clearRelationship.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ import (
)

func ClearRelationship(w http.ResponseWriter, _ *http.Request) {
// TODO: Implement just in memory?
i.JSON(&w, i.A{0})
}
1 change: 0 additions & 1 deletion server/routes/game/relationship/ignore.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
)

func Ignore(w http.ResponseWriter, r *http.Request) {
// TODO: Implement just in memory?
profileIdStr := r.PostFormValue("targetProfileID")

profileId, err := strconv.ParseInt(profileIdStr, 10, 32)
Expand Down

0 comments on commit 59dcbfe

Please sign in to comment.