summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-07 23:42:25 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-07 23:42:25 +0800
commitd6256b3ead722675ea0eb5e67c2bc384f0ff14f9 (patch)
treedf5859d7d8b1d37d3f65e62e9daeda11a827852a /mbbsd
parent54bf456b8d060abdd5b56185ed3ffc52f94e48fd (diff)
downloadpttbbs-d6256b3ead722675ea0eb5e67c2bc384f0ff14f9.tar
pttbbs-d6256b3ead722675ea0eb5e67c2bc384f0ff14f9.tar.gz
pttbbs-d6256b3ead722675ea0eb5e67c2bc384f0ff14f9.tar.bz2
pttbbs-d6256b3ead722675ea0eb5e67c2bc384f0ff14f9.tar.lz
pttbbs-d6256b3ead722675ea0eb5e67c2bc384f0ff14f9.tar.xz
pttbbs-d6256b3ead722675ea0eb5e67c2bc384f0ff14f9.tar.zst
pttbbs-d6256b3ead722675ea0eb5e67c2bc384f0ff14f9.zip
- term: add doupdate() to force refresh even if input queue is not empty
- menu: disable talk/chat for non-reg-ok user - bbslua: change bbs.refresh() to doupdate() git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3804 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/bbslua.c13
-rw-r--r--mbbsd/menu.c7
-rw-r--r--mbbsd/pfterm.c12
-rw-r--r--mbbsd/screen.c11
4 files changed, 26 insertions, 17 deletions
diff --git a/mbbsd/bbslua.c b/mbbsd/bbslua.c
index f993faaf..04349e1a 100644
--- a/mbbsd/bbslua.c
+++ b/mbbsd/bbslua.c
@@ -167,14 +167,10 @@ bl_clrtobot(lua_State* L)
BLAPI_PROTO
bl_refresh(lua_State* L)
{
- refresh();
- return 0;
-}
-
-BLAPI_PROTO
-bl_redrawwin(lua_State* L)
-{
- redrawwin();
+ // refresh();
+ // Seems like that most people don't understand the relationship
+ // between refresh() and input queue, so let's force update here.
+ doupdate();
return 0;
}
@@ -472,7 +468,6 @@ static const struct luaL_reg lib_bbslua [] = {
{ "clrtoeol", bl_clrtoeol },
{ "clrtobot", bl_clrtobot },
{ "refresh", bl_refresh },
- { "redrawwin", bl_redrawwin },
{ "addstr", bl_addstr },
{ "outs", bl_addstr },
{ "print", bl_print },
diff --git a/mbbsd/menu.c b/mbbsd/menu.c
index f57b622d..e9ee4dfe 100644
--- a/mbbsd/menu.c
+++ b/mbbsd/menu.c
@@ -418,8 +418,11 @@ static const commands_t talklist[] = {
{t_idle, 0, "IIdle 發呆"},
{t_query, 0, "QQuery 查詢網友"},
{t_qchicken, 0, "WWatch Pet 查詢寵物"},
- {t_talk, PERM_PAGE, "TTalk 找人聊聊"},
- {t_chat, PERM_CHAT, "CChat 找家茶坊喫茶去"},
+ // PERM_PAGE - 水球都要 PERM_LOGIN 了
+ // 沒道理可以 talk 不能水球。
+ {t_talk, PERM_LOGINOK, "TTalk 找人聊聊"},
+ // PERM_CHAT 非 login 也有,會有人用此吵別人。
+ {t_chat, PERM_LOGINOK, "CChat 找家茶坊喫茶去"},
#ifdef PLAY_ANGEL
{t_changeangel, PERM_LOGINOK, "UAChange Angel 更換小天使"},
{t_angelmsg, PERM_ANGEL, "LLeave message 留言給小主人"},
diff --git a/mbbsd/pfterm.c b/mbbsd/pfterm.c
index df0ecb29..8d5184e5 100644
--- a/mbbsd/pfterm.c
+++ b/mbbsd/pfterm.c
@@ -316,6 +316,7 @@ void clrregion (int r1, int r2); // clear [r1,r2], bi-directional.
// flushing
void refresh (void); // optimized refresh
+void doupdate (void); // optimized refresh, ignore input queue
void redrawwin (void); // invalidate whole screen
// scrolling
@@ -656,12 +657,17 @@ redrawwin(void)
void
refresh(void)
{
- int y, x;
- char touched = 0;
-
// prevent passive update
if(fterm_inbuf())
return;
+ doupdate();
+}
+
+void
+doupdate(void)
+{
+ int y, x;
+ char touched = 0;
if (!ft.dirty)
{
diff --git a/mbbsd/screen.c b/mbbsd/screen.c
index ffd5029b..08fae0b4 100644
--- a/mbbsd/screen.c
+++ b/mbbsd/screen.c
@@ -208,13 +208,18 @@ redrawwin(void)
void
refresh(void)
{
+ if (num_in_buf())
+ return;
+ doupdate();
+}
+
+void
+doupdate(void)
+{
/* TODO remove unnecessary refresh() call, to save CPU time */
register screenline_t *bp = big_picture;
register int i, j;
int len;
- if (num_in_buf())
- return;
-
if ((docls) || (abs(scrollcnt) >= (scr_lns - 3))) {
redrawwin();
return;