Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added table and name to the Event when CHAT is sent.

  • Loading branch information...
commit e080e8007ad2e16367d8b3347de9491283731448 1 parent 8806e63
@mstead authored
Showing with 3 additions and 7 deletions.
  1. +1 −1  api/tarabish.thrift
  2. +2 −6 server/src/table.erl
View
2  api/tarabish.thrift
@@ -72,7 +72,7 @@ enum EventType {
SIT, # table, name, seat
STAND, # table, name, seat
- CHAT, # table, message TODO: update to contain name?
+ CHAT, # table, name, message
NEW_GAME, # table
View
8 server/src/table.erl
@@ -27,8 +27,8 @@ start(Id) ->
%% TODO: check if table is still alive
chat(Table, From, Message) ->
- ExpandedMessage = bjoin([From, <<" --> ">>, Message]),
- Event = #event{type=?tarabish_EventType_CHAT, message=ExpandedMessage},
+ Event = #event{type=?tarabish_EventType_CHAT, table=Table,
+ name=From, message=Message},
broadcast(Table, Event).
join(Table, ClientName, Client) ->
@@ -349,10 +349,6 @@ send_cards(TableId, Dealer, Cards, MembersDict) ->
seat=Dealer},
send_cards1(Event, Cards, Persons).
-bjoin(List) ->
- F = fun(A, B) -> <<A/binary, B/binary>> end,
- lists:foldr(F, <<>>, List).
-
% Passes a list, but returns a tuple.
get_seat(State, SeatNum) ->
element(SeatNum + 1, State#state.seats).
Please sign in to comment.
Something went wrong with that request. Please try again.