Maxim Sokhatsky 10 лет назад
Родитель
Сommit
2e63f24dcd

+ 53 - 25
apps/server/src/auth/anonymous.erl

@@ -3,32 +3,60 @@
 -include_lib("db/include/config.hrl").
 -include_lib("kvs/include/user.hrl").
 
-names() ->
-   ["pinar","betul","eda","lale","ilgin","alp","ayberk","mehmet","ozan","doruk",
-    "duman","boran","dursun","taner","uzay","ali","musa","halit","yusuf","isa",
-    "asena","aysu","konca","ceren","oylum","filiz","ezgi","ece","sevil","damla",
-    "bahar","arzu","dilara","esra","leyla","jale","fatma","irem","yasmin","zeynep",
-    "magnolia","jenifer","roksolana","tsering","suomi"].
+males() ->
+  [ "alp","ayberk","doruk","mehmet","ozan","ali","musa","boran","isa",
+    "dursun","uzay","taner","halit","yusuf","duman","serdar","halil",
+    "emre","kadir","hasan","zeki","ihsan","rıza","kasım","ılgın" ].
 
-surnames() ->
-   ["ozcelik","acar","ozgur","ozkan","tez","ustel",
-    "vural","akbulut","arslan","avci","ayhan","basturk","caglar","celik","cetinkaya","demir",
-    "dikmen","acar","dogan","ekinci","elmas","erdem","erdogan","guler","gunes","ilhan",
-    "inan","karaca","karadag","kaya","kemal","keskin","koc","korkmaz","mestafa","osman",
-    "ozbek","ozcan","ozdemir","ozden","ozturk","pasa","polat","sezer","sahin","sen",
-    "simsek","tekin","tosun","tunc","turan","unal","yalcin","yazici","yildirim","yilmaz"].
+females() ->
+  [ "betül","eda","lale","pınar","filiz","ezgi","aysu","damla","konca",
+    "oylum","ceren","ece","sevil","asena","jale","fatma","arzu","zeynep",
+    "dilara","leyla","esra","irem","yasemin","bahar" ].
 
-ima_gio(N) -> {Id,Name,Surname} = lists:nth(N,imagionary_users()), Id.
-ima_gio(N,L) -> {Id,Name,Surname} = lists:nth(N,L), Id.
+malesex() -> [ {male,X} || X <- males()].
+femalesex() -> [ {female,X} || X <- females()].
+names() -> malesex() ++ femalesex().
+
+surnames() -> 
+  [ "özçelik","acar","özgür","özkan","tez","vural",
+    "akbulut","arslan","avcı","ayhan","baştürk","çağlar","çelik",
+    "çetinkaya","demir","dikmen","acar","doğan","ekinci","elmas",
+    "erdem","erdoğan","güler","güneş","ilhan","inan","karaca",
+    "karadağ","kaya","kemal","keskin","koç","korkmaz","mustafa",
+    "osman","özbek","özcan","özdemir","özden","öztürk","paşa",
+    "polat","sezer","şahin","sen","şimşek","tekin","tosun","tunç",
+    "turan","ünal","yalçın","yazıcı","yıldırım","yılmaz" ].
+
+ima_gio(N) -> {Id,Name,Surname,Sex} = lists:nth(N,imagionary_users()), Id.
+ima_gio(N,L) -> {Id,Name,Surname,Sex} = lists:nth(N,L), Id.
 
 imagionary_users() ->
     List = [ begin
-        [HX|TX] = X, NX = [string:to_upper(HX)] ++ TX,
-        [HY|TY] = Y, NY = [string:to_upper(HY)] ++ TY,
-        {wf:to_binary(X++"_"++Y),wf:to_binary(NX),wf:to_binary(NY)}
-    end || X<-names(), Y<-surnames()],
+        {Sex,X} = SX,
+        [HX|TX] = X, NX = [tru(HX)] ++ TX,
+        [HY|TY] = Y, NY = [tru(HY)] ++ TY,
+        {wf:to_binary([ tr2en(Char) || Char <- unicode:characters_to_list(X++"_"++Y) ]),
+         unicode:characters_to_binary(NX),
+         unicode:characters_to_binary(NY),Sex}
+    end || SX<-names(), Y<-surnames()],
     lists:keysort(1,List).
 
+tru($ü) -> $Ü;
+tru($ş) -> $Ş;
+tru($ö) -> $Ö;
+tru($ı) -> $İ;
+tru($ğ) -> $Ğ;
+tru($ç) -> $Ç;
+tru(Ch) -> string:to_upper(Ch).
+
+tr2en($ü) -> $u;
+tr2en($ö) -> $o;
+tr2en($ç) -> $c;
+tr2en($ı) -> $i;
+tr2en($ş) -> $u;
+tr2en($ğ) -> $g;
+tr2en(Sym) -> Sym.
+
 fake_id() ->
     FakeUsers = imagionary_users(),
     Pos = crypto:rand_uniform(1, length(FakeUsers)),
@@ -40,21 +68,21 @@ fake_id(Login) -> wf:to_binary(wf:to_list(Login) ++ wf:to_list(id_generator:get_
 create_users(A,B) ->
     ImagioUsers = imagionary_users(),
     [ begin 
-        {Id,Name,Surname} = lists:nth(N,ImagioUsers),
+        {Id,Name,Surname,Sex} = lists:nth(N,ImagioUsers),
         U = #user{  username = Id,
                     id = Id,
                     names = Name,
+                    sex = Sex,
                     surnames = Surname,
                     birth={1981,9,29} }, kvs:put(U) end || N <- lists:seq(A, B) ].
 
 virtual_users() ->
-    case kvs:get(user,<<"maxim@synrc.com">>) of
-        {aborted,_} -> kvs:join(), kvs:init_db(),
-                create_users(1,100), kvs:put(#user{id= <<"maxim@synrc.com">>});
-        _ -> skip end,
+    case kvs:get(user,<<"imam@synrc.com">>) of
+        {ok,_} -> skip;
+        _ -> kvs:join(), create_users(1,100), kvs:put(#user{id= <<"imam@synrc.com">>}) end,
 
     AllUsers = imagionary_users(),
-    F = fun({UserId,_,_}, Acc) ->
+    F = fun({UserId,_,_,Sex}, Acc) ->
         User = auth_server:get_user_info_by_user_id(UserId),
         case User of
                     {error,_} -> Acc;

+ 6 - 6
apps/server/src/auth/auth_server.erl

@@ -48,7 +48,7 @@ handle_call({get_user_info, Token}, _From, #state{tokens = E} = State) ->
             Reply = case user_info(UserId) of
                 {error, not_found} ->
                     gas:info(?MODULE,"User is not in DB", []),
-                    user_info(#user{id = UserId });
+                    user_info(#user{id = UserId, names= UserId, surnames = <<>> });
                 UserInfo ->
                     gas:info(?MODULE,"Registered User", []),
                     UserInfo
@@ -80,14 +80,14 @@ player_name(#'PlayerInfo'{login = Id, name = Name, surname = Surname}) ->
 
 user_info(#user{}=UserData) ->
 %    gas:info(?MODULE,"PlayerInfo by #user: ~p",[UserData]),
-    #'PlayerInfo'{id = wf:to_binary(UserData#user.id),
+    #'PlayerInfo'{id = UserData#user.id,
         login = UserData#user.username,
         name = UserData#user.names,
         sex = UserData#user.sex,
-        avatar_url = wf:to_binary(UserData#user.avatar),
-        skill = 0,
-        score = 0,
-        surname = wf:to_binary(UserData#user.surnames)};
+        avatar_url = UserData#user.avatar,
+        skill = proplists:get_value(skill,UserData#user.tokens,0),
+        score = proplists:get_value(score,UserData#user.tokens,0),
+        surname = UserData#user.surnames};
 
 
 user_info(UserId) ->

+ 16 - 47
apps/web/priv/static/app/js/bootloader.js

@@ -9,14 +9,16 @@ var color = ['#DE3F26','#606060','#48AF5E','#FFC800'];
 function parseUInt(x) { return x < 0 ?
     (x > -128 ? x & 255 >>> 0 : (x > -32768 ? x & 65535 >>> 0 : x >>> 0)) : x; }
 
-function statsRow(start_x,start_y,i,games) {
+function statsRow(start_x,start_y,i,games,iter) {
     var name = template_engine(
         '<tspan xmlns="http://www.w3.org/2000/svg" x="{this.x}" y="{this.y}">{this.body}</tspan>',{
             x: start_x,
-            y: start_y+25*i,
-            body: games[i].value[0][0] + " — " + parseUInt(games[i].value[0][1])});
+            y: start_y+25*iter,
+            body: i18n(games[i].value[0][0].value) + " — " + parseUInt(games[i].value[0][1])});
     var element1 = svg(name);
-    document.getElementById('Stat-Right').appendChild(element1);
+    if (locale.tr[games[i].value[0][0].value]) {
+        document.getElementById('Stat-Right').appendChild(element1); 
+        return iter+1; } else return iter;
 }
 
 function gameresultRow(start_x,start_y,i,results) {
@@ -29,7 +31,7 @@ function gameresultRow(start_x,start_y,i,results) {
      '<tspan xmlns="http://www.w3.org/2000/svg" x="{this.x}" y="{this.y}">{this.body}</tspan>',{
             x: start_x,
             y: start_y+30*i,
-            body: utf8decode(name) + "  " + round + "/" + total}); 
+            body: utf8decode(name) + "  " + round + "/" + total}); 
     var element1 = svg(name);
     document.getElementById('Overlay-Results').appendChild(element1);
 }
@@ -98,7 +100,9 @@ function PatchSVG()
             document.getElementById(x).style.cursor = "pointer";
             document.getElementById(x).onclick = showOnlineList; });
 
-    [ "Flag-tr", "Flag-en" ].map(function(x) { document.getElementById(x).onclick = translateScene; });
+    [ "Flag-tr", "Flag-en" ].map(function(x) {
+        document.getElementById(x).onclick = function() {
+            switchLanguage(); translateScene(); } });
 
     var rulesOnClick = [
         "Rules",
@@ -120,7 +124,8 @@ function PatchSVG()
     Core(DeckScope);
     Core(RosterScope);
 
-    $("#Flag-en").hide();
+    if (currentLanguage() != "en") $("#Flag-en").hide();
+
     translateScene();
 
     initDiscards();
@@ -144,43 +149,6 @@ function PatchSVG()
     $svg.attr({preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%"});
 }
 
-function translateScene(e)
-{
-    if (currentLocale == "tr")
-    {
-        $("#Flag-tr").hide();
-        $("#Flag-en").show();
-        currentLocale = "en";
-    } else {
-        $("#Flag-en").hide();
-        $("#Flag-tr").show();
-        currentLocale = "tr";
-    }
-
-    document.getElementById("Users-Online-Message").firstElementChild.textContent = i18n("Online");
-    try {
-    document.getElementById("OnlineChatEditor").firstElementChild.textContent = i18n("EditMessage");
-    document.getElementById("GameChatEditor").firstElementChild.textContent = i18n("EditMessage");
-    } catch (e) { console.log("Please add foreignObjects to schene from SVG.txt"); }
-    $("#Point-Table").find("text")[0].lastElementChild.textContent = i18n("Statistics");
-    $("#Rules").find("text")[0].lastElementChild.textContent = i18n("Rules");
-    $("#Login-Text")[0].lastElementChild.textContent = i18n("Login");
-    $("#Kakush")[0].lastElementChild.textContent = i18n("Kakush") + ": " + 0;
-
-    $("#Gabrielo-Discard-Shape").hide();
-    $("#Center-Card-Selection").hide();
-    $("#You-Discard-Shape").hide();
-
-    $('#Facebook-Login').on('click',function(x) { fb_login(); });
-    $('#Facebook-Login').attr({cursor:'pointer'});
-    $('#Login-Text')[0].style.cursor = 'pointer';
-
-//    $("#Okey").hide();
-    $("#Okey").on("click", sendSawOkey);
-//    $("#Have-8-Tashes").hide();
-
-}
-
 function sendSawOkey()
 {
     ws.send(enc(tuple(atom('client'),tuple(atom('game_action'),scope.gameId,
@@ -227,6 +195,7 @@ function showRules()
             rules.setAttribute('transform', 'translate(210,86)');
             rules.setAttribute('onclick', 'onRulesClose(evt)');
         }
+        translateScene();
         rules.style.display = 'block';
     });
 }
@@ -318,7 +287,7 @@ function initPauseOverlay() {
         '<rect x="216" y="91" stroke-width="0" stroke="red" width="641" height="367" rx="6" fill="skyblue" opacity="0.9"></rect>'+
         '<g>'+
         '<text id="Overlay-Results" fill="white" font-family="Exo 2" font-size="20pt"></text>'+
-        '<text id="Overlay-Text" fill="white" font-family="Exo 2" y="280" x="-116" text-anchor="middle" dx="641" font-size="30pt"> Someone paused the game</text></g>'+
+        '<text id="Overlay-Text" fill="white" font-family="Exo 2" y="280" x="-116" text-anchor="middle" dx="641" font-size="30pt"> Someone '+i18n("Paused")+'</text></g>'+
         '</g>';
     var page = document.getElementById("Kakaranet-Scene");
     var kakush = document.getElementById("Kakush");
@@ -352,7 +321,7 @@ function hideOverlay()
 function denyWrongReveal() {
     $overlay.show();
     $("#RevealDeck").empty();
-    $("#Overlay-Text").text("Wrong reveal. Try next time.");
+    $("#Overlay-Text").text(i18n("WrongReveal"));
 }
 
 function showRevealHand(o) {
@@ -388,7 +357,7 @@ function showRevealHand(o) {
     });
 
     $overlay.show();
-    $("#Overlay-Text").text(utf8decode(player) + " revealed ");
+    $("#Overlay-Text").text(utf8decode(player) + " " + i18n("Revealed"));
 
 }
 

+ 1 - 1
apps/web/priv/static/app/js/okey/okey.js

@@ -298,7 +298,7 @@ function PostLoad()
         $("#RevealDeckRoot").hide();
         for (var player in scope.playersMap) scope.playersMap[player].timer.pause();
         var player = scope.playersMap[e.who];
-        $("#Overlay-Text").text(player.name + " paused");
+        $("#Overlay-Text").text(player.name + " " + i18n("Paused"));
     }
 
     scope.apiProvider.on("game_paused", function(x) {

+ 4 - 3
apps/web/priv/static/app/js/roster.js

@@ -93,9 +93,10 @@ function RosterHandlers(scope) {
             score    = dec(e.raw).value[0][5];
         removeChilds(document.getElementById('Stat-Left'));
         removeChilds(document.getElementById('Stat-Right'));
-//            for (var i=0;i<games.length;i++) { statsRow(4, 160, i,games); }
-        for (var i=0;i<protocol.length;i++) { statsRow(4,160,i,protocol); }
-        for (var i=0;i<reveals.length;i++) { statsRow(320,160,i,reveals); }
+     // for (var i=0,iter=0;i<games.length;   i++,iter=statsRow(4,  160,i,games,iter));
+        for (var i=0,iter=0;i<protocol.length;iter=statsRow(4,  160,i,protocol,iter),i++);
+//        for (var i=0,iter=0;i<reveals.length; i++,iter=statsRow(320,160,i,reveals,iter));
+        translateScene();
         $("#Score").text(i18n("Score") + ": " + score).attr({y: 40});
       });
     });

+ 1 - 1
apps/web/priv/static/app/js/selector.js

@@ -15,7 +15,7 @@ var scope = {
     MALE_SKINS: [ "Gabrielo", "Mustafa" ],
     FEMALE_SKINS: [ "Alina" ],
     paused: false,
-    version: 2106201401
+    version: 2206201401
 };
 
 var $ = function(_undefind)

+ 76 - 17
apps/web/priv/static/app/js/translations.js

@@ -5,27 +5,28 @@ locale = { en: {}, tr: {} };
 locale.tr.Score       = "Puan";
 locale.tr.Online      = "Oynayanlar";
 locale.tr.Games       = "Oyunlar";
+locale.tr.Reveals     = "Bitirdi";
 locale.tr.Rules       = "Kurallar";
 locale.tr.Quota       = "Kota";
 locale.tr.Kakush      = "Kakuş";
-locale.tr.Login       = "Üye Ol";
+locale.tr.Login       = "İle bağlan";
 locale.tr.Statistics  = "İstatistikler";
 
 // Chats
 
 locale.en.EditMessage = "Write some text here";
-locale.tr.EditMessage = "Burada bazı metin yazmak";
+locale.tr.EditMessage = "Chat için buraya yazabilirsiniz";
 locale.en.GameChat    = "This is In-Game chat";
-locale.tr.GameChat    = "Oyun sohbet";
-locale.en.PrivateChat = "is waiting for chat with you";
-locale.tr.PrivateChat = "seninle sohbet için bekliyor";
+locale.tr.GameChat    = "Oyun içi sohbet";
+locale.en.PrivateChat = " is waiting for chat with you";
+locale.tr.PrivateChat = " seninle sohbet için bekliyor";
 
 // Messages
 
 locale.tr.Paused      = "ara istiyor";
 locale.en.Paused      = "paused";
 locale.tr.Revealed    = "bitirdi";
-locale.en.Paused      = "revealed";
+locale.en.Revealed    = "revealed";
 locale.en.WrongReveal = "Wrong Reveal. Try next time.";
 locale.tr.WrongReveal = "Bu el yanlış. Bitirde gel";
 
@@ -40,13 +41,6 @@ locale.en.OkeyRules   = "Okey Rules";
 locale.tr.Run         = "Sıralı";
 locale.tr.Set         = "Asker";
 locale.tr.Pair        = "Çift";
-locale.en.RulesDetails = "Make 3x3+1x5, 2x3+2x4 or 2x5+1x4 Runs/Sets or 7 Pairs."+
-                        " Use Okey Joker (which is +1 same color as central Gosterme card)"+
-                        " or Fake Joker to substitute any needed card in your combination.";
-locale.tr.RulesDetails = "Diğer alternatifler; (2X3’lü+2X4’lü), (2X5‘li sıralı+1X4‘lü)."+
-                        " (“Okey” göstermenin +1 üstüdür. Joker gibi kullanılır."+
-                        " “Sahte okey” ise okey taşının yerinde kullanılır)."+
-                        " 3 ve 4 lüler sıralı ve veya asker olabilir.";
 
 // Protocol
 
@@ -57,9 +51,74 @@ locale.tr.okey_turn_timeout   = "Zamanında oynamama";
 locale.tr.wrong_reveal        = "Yanlış açma";
 locale.tr.okey_game_started   = "Oynadığı oyun";
 
-currentLocale = "en";
-
-function i18n(word) {
-    var translation = locale[currentLocale][word];
+function i18n(word)
+{
+    var translation = locale[currentLanguage()][word];
     return (translation == null) ? word : translation;
 }
+
+function currentLanguage()
+{
+    var currentLocale = localStorage.getItem("locale");
+    return currentLocale == null ? "en" : currentLocale;
+}
+
+function switchLanguage()
+{
+    if (localStorage.getItem("locale") == "tr")
+    {
+        $("#Flag-tr").hide();
+        $("#Flag-en").show();
+        localStorage.setItem("locale","en");
+    } else {
+        $("#Flag-en").hide();
+        $("#Flag-tr").show();
+        localStorage.setItem("locale","tr");
+    }
+}
+
+function translateScene(e)
+{
+    if (document.getElementById("Okey-Rules") != null) {
+        $("#Okey-Rules-Text")[0].lastElementChild.textContent = i18n("OkeyRules");
+        $("#Pair")[0].lastElementChild.textContent = i18n("Pair");
+        $("#Set")[0].lastElementChild.textContent = i18n("Set");
+        $("#Run")[0].lastElementChild.textContent = i18n("Run");
+        $("#Winning-Deck")[0].lastElementChild.textContent = i18n("WinningDeck");
+    if (currentLanguage() == "en") { $("#Turkish-Rules").hide(); $("#English-Rules").show(); } 
+                              else { $("#Turkish-Rules").show(); $("#English-Rules").hide(); }
+    }
+
+    if (document.getElementById("Player-Statistics") != null) {
+        $("#Games-Text")[0].lastElementChild.textContent = i18n("Games");
+        $("#Reveals-Text")[0].lastElementChild.textContent = i18n("Reveals");
+    if (currentLanguage() == "en") { $("#Turkish-StatNotes").hide(); $("#English-StatNotes").show(); } 
+                              else { $("#Turkish-StatNotes").show(); $("#English-StatNotes").hide(); }
+    }
+
+    try {
+    document.getElementById("GameChatEditor").firstElementChild.textContent = i18n("EditMessage");
+    document.getElementById("OnlineChatEditor").firstElementChild.textContent = i18n("EditMessage");
+    } catch (e) { console.log("Please add foreignObjects to schene from SVG.txt"); }
+
+
+
+    $("#Users-Online-Message")[0].firstElementChild.textContent = i18n("Online");
+    $("#Point-Table").find("text")[0].lastElementChild.textContent = i18n("Statistics");
+    $("#Rules").find("text")[0].lastElementChild.textContent = i18n("Rules");
+    $("#Kakush")[0].lastElementChild.textContent = i18n("Kakush") + ": " + 0;
+    $("#Gabrielo-Discard-Shape").hide();
+    $("#Center-Card-Selection").hide();
+    $("#You-Discard-Shape").hide();
+
+    $('#Facebook-Login').on('click',function(x) { fb_login(); });
+    $('#Facebook-Login').attr({cursor:'pointer'});
+    $('#Login-Text')[0].style.cursor = 'pointer';
+//    $("#Login-Text")[0].lastElementChild.textContent = i18n("Login");
+    $("#Login-Text").text(i18n("Login")).attr({x:16,y:23});
+
+//    $("#Okey").hide();
+    $("#Okey").on("click", sendSawOkey);
+//    $("#Have-8-Tashes").hide();
+
+}

+ 24 - 16
apps/web/priv/static/app/svg/Okey-Rules.svg

@@ -13,15 +13,23 @@
                 <rect id="Rectangle-54" stroke="#48AF5E" stroke-width="10" x="0" y="0" width="643" height="515" rx="30"></rect>
             </g>
             <g id="Notes" transform="translate(22.000000, 420.000000)" font-size="20" font-family="Exo 2" fill="#4A4A4A" sketch:type="MSTextLayer" font-weight="normal">
-                <text id="Make-3x3+1x5,-2x3+2x">
+                <text id="Turkish-Rules">
+                    <tspan x="0" y="20.5">Diğer alternatifler; (2x3'lü+2x4'lü), (2x5'li sıralı+1x4'lü). ('Okey' </tspan>
+                    <tspan x="0" y="44.5">göstermenin +1 üstüdür. Joker gibi kullanılır. 'Sahte okey' ise okey </tspan>
+                    <tspan x="0" y="68.5">taşının yerinde kullanılır). 3 ve 4 lüler sıralı ve veya asker olabilir.</tspan>
+                </text>
+                <text id="English-Rules">
                     <tspan x="0" y="20.5">Make 3x3+1x5, 2x3+2x4 or 2x5+1x4 Runs/Sets or 7 Pairs. Use Okey </tspan>
                     <tspan x="0" y="44.5">Joker (which is +1 same color as central Gosterme card) or Fake </tspan>
                     <tspan x="0" y="68.5">Joker to substitute any needed card in your combination.</tspan>
                 </text>
             </g>
-            <g id="Winning-Deck-3x3+1x5" transform="translate(270.000000, 83.000000)" font-size="29.3024001" font-family="Exo 2" fill="#3B5998" sketch:type="MSTextLayer" font-weight="normal">
-                <text>
-                    <tspan x="0" y="29">Winning Deck 3x3+1x5</tspan>
+            <g id="Winning-Deck-3x3+1x5" transform="translate(250.000000, 83.000000)" font-size="29.3024001" font-family="Exo 2" fill="#3B5998" sketch:type="MSTextLayer" font-weight="normal">
+                <text id="3x3+1x5">
+                    <tspan x="199" y="29">3x3+1x5</tspan>
+                </text>
+                <text id="Winning-Deck">
+                    <tspan x="0" y="29">Winning Deck</tspan>
                 </text>
             </g>
             <g id="Small-Deck" transform="translate(121.000000, 132.000000)">
@@ -144,7 +152,7 @@
                     </g>
                 </g>
             </g>
-            <g id="Run" transform="translate(41.000000, 242.000000)">
+            <g id="Run-Group" transform="translate(41.000000, 242.000000)">
                 <g id="Slot-1,1-10" transform="translate(33.000000, 0.000000)">
                     <rect id="Shape" fill="#FFFFFF" sketch:type="MSShapeGroup" x="0" y="0" width="32" height="46" rx="8"></rect>
                     <path d="M16.1794872,38.6551724 C19.1250058,38.6551724 21.5128205,36.3471231 21.5128205,33.5 C21.5128205,30.6528769 19.1250058,28.3448276 16.1794872,28.3448276 C13.2339685,28.3448276 10.8461538,30.6528769 10.8461538,33.5 C10.8461538,36.3471231 13.2339685,38.6551724 16.1794872,38.6551724 L16.1794872,38.6551724 Z" id="Oval-23" fill="#CE290F" sketch:type="MSShapeGroup"></path>
@@ -173,11 +181,11 @@
                         <tspan x="10" y="20">9</tspan>
                     </text>
                 </g>
-                <text sketch:type="MSTextLayer" font-family="Exo 2" font-size="26" font-weight="normal" fill="#3B5998">
+                <text id="Run" sketch:type="MSTextLayer" font-family="Exo 2" font-size="26" font-weight="normal" fill="#3B5998">
                     <tspan x="146" y="32">Run</tspan>
                 </text>
             </g>
-            <g id="Set" transform="translate(74.000000, 302.000000)">
+            <g id="Set-Group" transform="translate(74.000000, 302.000000)">
                 <g id="Slot-1,1-10">
                     <rect id="Shape" fill="#FFFFFF" sketch:type="MSShapeGroup" x="0" y="0" width="32" height="46" rx="8"></rect>
                     <path d="M15.1794872,39.6551724 C18.1250058,39.6551724 20.5128205,37.3471231 20.5128205,34.5 C20.5128205,31.6528769 18.1250058,29.3448276 15.1794872,29.3448276 C12.2339685,29.3448276 9.8461538,31.6528769 9.8461538,34.5 C9.8461538,37.3471231 12.2339685,39.6551724 15.1794872,39.6551724 L15.1794872,39.6551724 Z" id="Oval-23" fill="#CE290F" sketch:type="MSShapeGroup"></path>
@@ -199,11 +207,11 @@
                         <tspan x="10.6648888" y="20.7657996">7</tspan>
                     </text>
                 </g>
-                <text sketch:type="MSTextLayer" font-family="Exo 2" font-size="26" font-weight="normal" fill="#3B5998">
+                <text id="Set" sketch:type="MSTextLayer" font-family="Exo 2" font-size="26" font-weight="normal" fill="#3B5998">
                     <tspan x="113" y="31">Set</tspan>
                 </text>
             </g>
-            <g id="Pair" transform="translate(107.000000, 362.000000)">
+            <g id="Pair-Group" transform="translate(107.000000, 362.000000)">
                 <g id="Slot-1,1-8">
                     <rect id="Shape" fill="#FFFFFF" sketch:type="MSShapeGroup" x="0" y="0" width="32" height="46" rx="8"></rect>
                     <path d="M15.1794872,39.6551724 C18.1250058,39.6551724 20.5128205,37.3471231 20.5128205,34.5 C20.5128205,31.6528769 18.1250058,29.3448276 15.1794872,29.3448276 C12.2339685,29.3448276 9.8461538,31.6528769 9.8461538,34.5 C9.8461538,37.3471231 12.2339685,39.6551724 15.1794872,39.6551724 L15.1794872,39.6551724 Z" id="Oval-23" fill="#517ECE" sketch:type="MSShapeGroup"></path>
@@ -218,11 +226,11 @@
                         <tspan x="11.6648888" y="19.7657996">1</tspan>
                     </text>
                 </g>
-                <text sketch:type="MSTextLayer" font-family="Exo 2" font-size="26" font-weight="normal" fill="#3B5998">
+                <text id="Pair" sketch:type="MSTextLayer" font-family="Exo 2" font-size="26" font-weight="normal" fill="#3B5998">
                     <tspan x="80" y="31">Pair</tspan>
                 </text>
             </g>
-            <g id="Fake-Jocker" transform="translate(298.000000, 363.000000)">
+            <g id="Fake-Jocker-Group" transform="translate(298.000000, 363.000000)">
                 <g id="Slot-1,1-9">
                     <rect id="Shape" fill="#FFFFFF" sketch:type="MSShapeGroup" x="0" y="0" width="32" height="46" rx="8"></rect>
                     <text id="❦" sketch:type="MSTextLayer" font-family="Zapf Dingbats" font-size="26" font-weight="normal" fill="#517ECE">
@@ -233,7 +241,7 @@
                     <tspan x="47" y="31">Fake Joker</tspan>
                 </text>
             </g>
-            <g id="Gosterme" transform="translate(297.000000, 242.000000)">
+            <g id="Gosterme-Group" transform="translate(297.000000, 242.000000)">
                 <g id="Slot-1,1-11">
                     <rect id="Shape" fill="#FFFFFF" sketch:type="MSShapeGroup" x="0" y="0" width="32" height="46" rx="8"></rect>
                     <text id="9" sketch:type="MSTextLayer" font-family="Exo 2" font-size="16.0113717" font-weight="bold" fill="#D0011B">
@@ -241,11 +249,11 @@
                     </text>
                     <path d="M16.1794872,39.6551724 C19.1250058,39.6551724 21.5128205,37.3471231 21.5128205,34.5 C21.5128205,31.6528769 19.1250058,29.3448276 16.1794872,29.3448276 C13.2339685,29.3448276 10.8461539,31.6528769 10.8461539,34.5 C10.8461539,37.3471231 13.2339685,39.6551724 16.1794872,39.6551724 L16.1794872,39.6551724 Z" id="Oval-23" fill="#CE290F" sketch:type="MSShapeGroup"></path>
                 </g>
-                <text sketch:type="MSTextLayer" font-family="Exo 2" font-size="26" font-weight="normal" fill="#3B5998">
+                <text id="Gosterme" sketch:type="MSTextLayer" font-family="Exo 2" font-size="26" font-weight="normal" fill="#3B5998">
                     <tspan x="46" y="32">Gosterme</tspan>
                 </text>
             </g>
-            <g id="Okey-Joker" transform="translate(298.000000, 303.000000)">
+            <g id="Okey-Joker-Group" transform="translate(298.000000, 303.000000)">
                 <g id="Slot-1,1-12">
                     <rect id="Shape" fill="#FFFFFF" sketch:type="MSShapeGroup" x="0" y="0" width="32" height="46" rx="8"></rect>
                     <path d="M15.1794872,39.6551724 C18.1250058,39.6551724 20.5128205,37.3471231 20.5128205,34.5 C20.5128205,31.6528769 18.1250058,29.3448276 15.1794872,29.3448276 C12.2339685,29.3448276 9.8461538,31.6528769 9.8461538,34.5 C9.8461538,37.3471231 12.2339685,39.6551724 15.1794872,39.6551724 L15.1794872,39.6551724 Z" id="Oval-23" fill="#CE290F" sketch:type="MSShapeGroup"></path>
@@ -253,8 +261,8 @@
                         <tspan x="6.74003405" y="20.1361222">10</tspan>
                     </text>
                 </g>
-                <text sketch:type="MSTextLayer" font-family="Exo 2" font-size="26" font-weight="normal" fill="#3B5998">
-                    <tspan x="45" y="31">Okey Joker</tspan>
+                <text id="Okey-Joker-Text" sketch:type="MSTextLayer" font-family="Exo 2" font-size="26" font-weight="normal" fill="#3B5998">
+                    <tspan x="45" y="31">Okey</tspan>
                 </text>
             </g>
             <text id="Okey-Rules-Text" sketch:type="MSTextLayer" font-family="Exo 2" font-size="35" font-weight="bold" fill="#FFFFFF">

+ 11 - 8
apps/web/priv/static/app/svg/Player-Statistics.svg

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg width="929px" height="660px" viewBox="0 0 929 660" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
+<svg width="933px" height="660px" viewBox="0 0 933 660" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
     <!-- Generator: Sketch 3.0.3 (7892) - http://www.bohemiancoding.com/sketch -->
     <title>Player-Statistics</title>
     <desc>Created with Sketch.</desc>
@@ -13,10 +13,13 @@
                 <rect id="Rectangle-54" stroke="#48AF5E" stroke-width="10" x="0" y="0" width="643" height="515" rx="30"></rect>
             </g>
             <g id="Group" transform="translate(19.000000, 13.000000)" font-family="Exo 2" sketch:type="MSTextLayer">
-                <text id="Notes" font-size="20" font-weight="normal" fill="#4A4A4A">
+                <text id="English-StatNotes" font-size="20" font-weight="normal" fill="#4A4A4A">
                     <tspan x="0" y="441.5">How good is Player (win/lose) per each game type, and how </tspan>
                     <tspan x="0" y="465.5">player usualy reveals the games.</tspan>
                 </text>
+                <text id="Turkish-StatNotes" font-size="20" font-weight="normal" fill="#4A4A4A">
+                    <tspan x="0" y="441.5">OK</tspan>
+                </text>
                 <text id="Stat-Left" font-size="23.586" font-weight="normal" fill="#517ECE">
                     <tspan x="0" y="171">Lucky</tspan>
                     <tspan x="0" y="200">Std Color                       124/23</tspan>
@@ -26,14 +29,14 @@
                     <tspan x="0" y="316">Tour Even/Odd 64    44/23</tspan>
                 </text>
                 <text id="Stat-Right" font-size="23.586" font-weight="normal" fill="#517ECE">
-                    <tspan x="317.5" y="170.971549">Have 8 Tashes         40</tspan>
-                    <tspan x="317.5" y="199.971549">Normal                      124</tspan>
-                    <tspan x="317.5" y="228.971549">Okey                           234</tspan>
+                    <tspan x="336.5" y="170.971549">Have 8 Tashes         40</tspan>
+                    <tspan x="336.5" y="199.971549">Normal                      124</tspan>
+                    <tspan x="336.5" y="228.971549">Okey                           234</tspan>
                 </text>
-                <text id="Reveals" font-size="35.1627907" font-weight="normal" fill="#3B5998">
-                    <tspan x="317.5" y="121">Reveals</tspan>
+                <text id="Reveals-Text" font-size="35.1627907" font-weight="normal" fill="#3B5998">
+                    <tspan x="336.5" y="121">Reveals</tspan>
                 </text>
-                <text id="Games" font-size="35.1627907" font-weight="normal" fill="#3B5998">
+                <text id="Games-Text" font-size="35.1627907" font-weight="normal" fill="#3B5998">
                     <tspan x="0" y="122.014225">Games</tspan>
                 </text>
                 <text id="Score" font-size="35.1627907" font-weight="bold" fill="#FFFFFF">

BIN
apps/web/priv/static/doc/Kakaranet-Scene.sketch/Data


+ 1 - 1
apps/web/priv/static/doc/Kakaranet-Scene.sketch/metadata

@@ -16,7 +16,7 @@
 		<string>ZapfDingbatsITC</string>
 	</array>
 	<key>length</key>
-	<integer>3015284</integer>
+	<integer>3019779</integer>
 	<key>version</key>
 	<integer>37</integer>
 </dict>

+ 2 - 1
apps/web/src/okey.erl

@@ -16,10 +16,11 @@ game_form() ->
 
 new_user() ->
     Imagionary = anonymous:imagionary_users(),
-    {Id,Name,Surname} = lists:nth(crypto:rand_uniform(1,length(Imagionary)),Imagionary),
+    {Id,Name,Surname,Sex} = lists:nth(crypto:rand_uniform(1,length(Imagionary)),Imagionary),
     FakeId = anonymous:fake_id(Id),
     X = #user{
         id = FakeId,
+        sex = Sex,
         tokens=[{n2o,get(session_id)}],
         names = Name,
         surnames = Surname},