Commit 32bea2767597a5086cac3b3894c4ca45bdaccdca

Authored by dg
1 parent 87545876

fix


git-svn-id: http://svn.net-core.org/repos/t-engine4@2901 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -327,10 +327,11 @@ end
327 327 -- Events from the profile thread
328 328 -----------------------------------------------------------------------
329 329
330   -function _M:waitEvent(name, cb)
  330 +function _M:waitEvent(name, cb, wait_max)
331 331 -- Wait anwser, this blocks thegame but cant really be avoided :/
332 332 local stop = false
333 333 local first = true
  334 + local tries = 0
334 335 while not stop do
335 336 if not first then
336 337 core.display.forceRedraw()
... ... @@ -349,6 +350,8 @@ function _M:waitEvent(name, cb)
349 350 evt = core.profile.popEvent()
350 351 end
351 352 first = false
  353 + tries = tries + 1
  354 + if wait_max and tries * 50 > wait_max then break end
352 355 end
353 356 end
354 357
... ...
... ... @@ -101,11 +101,9 @@ function _M:event(e)
101 101 self.channels[e.channel].users[user.login] = {
102 102 login=user.login,
103 103 name=user.name,
104   - cur_char=user.cur_char and user.cur_char.title or "unknown",
105   - module=user.cur_char and user.cur_char.module or "unknown",
106   - valid=user.cur_char and user.cur_char.valid and "validate" or "not validated",
107   - char_link=user.cur_char and user.char_link,
108   - profile=user.cur_char and user.profile,
  104 + current_char=user.current_char and user.current_char.title or "unknown",
  105 + module=user.current_char and user.current_char.module or "unknown",
  106 + valid=user.current_char and user.current_char.valid and "validate" or "not validated",
109 107 }
110 108 end
111 109 self.channels_changed = true
... ... @@ -170,7 +168,7 @@ function _M:showUserInfo(login)
170 168
171 169 core.profile.pushOrder(string.format("o='ChatUserInfo' login=%q", login))
172 170 local data = nil
173   - profile:waitEvent("UserInfo", function(e) data=e.data end)
  171 + profile:waitEvent("UserInfo", function(e) data=e.data end, 5000)
174 172 game:unregisterDialog(popup)
175 173
176 174 if not data then
... ...
... ... @@ -34,7 +34,7 @@ function _M:init(data)
34 34 if data.char_link then
35 35 str:add({"font","italic"},{"color","LIGHT_BLUE"},data.current_char.title or "unknown",{"font","normal"},{"color","LAST"},true)
36 36 else
37   - str:add(data.current_char or "unknown",true)
  37 + str:add(data.current_char.title or "unknown",true)
38 38 end
39 39 str:add({"color","ANTIQUE_WHITE"}, "Game: ", {"color", "LAST"}, data.current_char.module or "unknown", true)
40 40 str:add({"color","ANTIQUE_WHITE"}, "Validation: ", {"color", "LAST"}, data.current_char.valid and "Game has been validated by the server" or "Game is not validated by the server", true)
... ...
... ... @@ -1156,10 +1156,7 @@ function _M:setupMouse(reset)
1156 1156 -- Chat tooltips
1157 1157 profile.chat:onMouse(function(user, button, event)
1158 1158 local str = tstring{{"color","GOLD"}, {"font","bold"}, user.name, {"color","LAST"}, {"font","normal"}, true}
1159   - str:add({"color","ANTIQUE_WHITE"}, "Playing: ", {"color", "LAST"}, user.current_char,true)
1160   - if user.char_link then
1161   - str:add({"font","italic"},{"color","LIGHT_BLUE"},user.char_link,{"font","normal"},{"color","LAST"},true)
1162   - end
  1159 + str:add({"color","ANTIQUE_WHITE"}, "Playing: ", {"color", "LAST"}, user.current_char, true)
1163 1160 str:add({"color","ANTIQUE_WHITE"}, "Game: ", {"color", "LAST"}, user.module, "(", user.valid, ")",true)
1164 1161 self.tooltip:displayAtMap(nil, nil, self.w, self.h, str)
1165 1162
... ...
... ... @@ -35,7 +35,7 @@ int push_order(lua_State *L)
35 35 {
36 36 size_t len;
37 37 const char *code = luaL_checklstring(L, 1, &len);
38   - printf("[profile order] %s\n", code);
  38 +// printf("[profile order] %s\n", code);
39 39
40 40 profile_queue *q = malloc(sizeof(profile_queue));
41 41 char *d = calloc(len, sizeof(char));
... ... @@ -67,7 +67,6 @@ int pop_order(lua_State *L)
67 67
68 68 if (q)
69 69 {
70   -// printf("[profile event] POP %s\n", q->payload);
71 70 lua_pushlstring(L, q->payload, q->payload_len);
72 71 free(q->payload);
73 72 free(q);
... ... @@ -82,7 +81,7 @@ int push_event(lua_State *L)
82 81 {
83 82 size_t len;
84 83 const char *code = luaL_checklstring(L, 1, &len);
85   - printf("[profile event] %s\n", code);
  84 +// printf("[profile event] %s\n", code);
86 85
87 86 profile_queue *q = malloc(sizeof(profile_queue));
88 87 char *d = calloc(len, sizeof(char));
... ... @@ -114,6 +113,7 @@ int pop_event(lua_State *L)
114 113
115 114 if (q)
116 115 {
  116 +// printf("[profile event] POP %s\n", q->payload);
117 117 lua_pushlstring(L, q->payload, q->payload_len);
118 118 free(q->payload);
119 119 free(q);
... ...