Skip to content

Commit

Permalink
Revert player mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
blair55 committed May 16, 2023
1 parent e2401db commit 38ad3ad
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/Server/EventHandling.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,20 @@ module EventHandling =
let (|MapPredictionSetEventPlayerIdId|) (PlayerId playerId) : PlayerId =
match playerId with
// | "fb-10160345161488703" -> PlayerId "tw-414832159" // JB reverse
| "tw-414832159" -> PlayerId "fb-10160345161488703" // JB
// | "tw-414832159" -> PlayerId "fb-10160345161488703" // JB
| "fb-735238821018" -> PlayerId "tw-458540585" // PB
| "tw-462436725" -> PlayerId "fb-10152951016485684" // TD
| _ -> PlayerId playerId

let (|MapPlayerEventPlayerId|) (PlayerId playerId) : PlayerId =
match playerId with
| "tw-462436725" -> PlayerId "fb-10152951016485684" // TD
// | "tw-462436725" -> PlayerId "fb-10152951016485684" // TD
| _ -> PlayerId playerId

let onEvent deps (DatedEvent (event, created)) =
printfn "handling event: %A" event

match event with
// players
| PlayerLoggedIn (MapPlayerEventPlayerId playerId) ->
| PlayerLoggedIn playerId ->
PlayerLoggedInSubscribers.all
|> List.iter (fun f -> f deps created playerId)
| PlayerCreated (MapPlayerEventPlayerId playerId, playerName, email) ->
| PlayerCreated (playerId, playerName, email) ->
PlayerCreatedSubscribers.all
|> List.iter (fun f -> f deps created (playerId, playerName, email))
| PlayerRemoved playerId ->
Expand All @@ -45,7 +40,7 @@ module EventHandling =
| LeagueRenamed (leagueId, leagueName) ->
LeagueRenamedSubscribers.all
|> List.iter (fun f -> f deps (leagueId, leagueName))
| LeagueJoined (leagueId, MapPlayerEventPlayerId playerId) ->
| LeagueJoined (leagueId, playerId) ->
LeagueJoinedSubscribers.all
|> List.iter (fun f -> f deps created (leagueId, playerId))
| LeagueLeft (leagueId, playerId) ->
Expand Down

0 comments on commit 38ad3ad

Please sign in to comment.