Skip to content

Commit

Permalink
Merge remote-tracking branch 'koil/master'
Browse files Browse the repository at this point in the history
Conflicts:
	code/controllers/managers/chanman.dm
  • Loading branch information
Stephen001 committed Jul 3, 2013
2 parents 320a1d1 + 505daf9 commit 66f7f23
Show file tree
Hide file tree
Showing 27 changed files with 909 additions and 397 deletions.
2 changes: 1 addition & 1 deletion code/client.dm
Expand Up @@ -24,4 +24,4 @@ client
call(mob, v:name)(params)
success=1
if(!success && ChatMan.istelnet(src.key)) call(mob, "Say")(command)
..(command)
..(command)
2 changes: 1 addition & 1 deletion code/controllers/managers/Server.dm
Expand Up @@ -5,4 +5,4 @@ Server
addr
host
list/chatters = new()
list/developers =new()
list/developers =new()
3 changes: 1 addition & 2 deletions code/controllers/managers/chanman.dm
Expand Up @@ -120,7 +120,6 @@ ChannelManager
Home.banned = new
for(var/i in banList)
Home.banned += ckey(i)

if(opList && opList.len)
Home.operators = new
for(var/Name in opList)
Expand All @@ -138,4 +137,4 @@ ChannelManager
if (length(Chan.banned))
for (var/i in Chan.banned)
if (!Home.banned.Find(ckey(i)))
Home.banned += ckey(i)
Home.banned += ckey(i)
2 changes: 1 addition & 1 deletion code/controllers/managers/errman.dm
Expand Up @@ -13,4 +13,4 @@ ErrorManager // Handles all error reporting

if("200") ErrMsg = "Unable to open port: [Info]"

CRASH("[ErrCode] : [ErrMsg]")
CRASH("[ErrCode] : [ErrMsg]")
2 changes: 1 addition & 1 deletion code/controllers/managers/eventman.dm
Expand Up @@ -43,4 +43,4 @@ EventManager
var/params = copytext(event, text, endtext)
for(var/v in C.verbs)
if(ckey(cmd) == ckey(v:name))
call(C, v:name)(params)
call(C, v:name)(params)
2 changes: 1 addition & 1 deletion code/controllers/managers/listman.dm
Expand Up @@ -69,4 +69,4 @@ ListManager
if(ckey(A1.name) > ckey(A2.name))
L.Swap(j, j+1)
Close(L)
return L
return L
2 changes: 1 addition & 1 deletion code/controllers/managers/msgman.dm
Expand Up @@ -43,4 +43,4 @@ MessageManager
isIgnoredResult = null
world.Export("[ChanMan.server.chatters[Name]]?dest=msgman&action=isIgnored&name=[Name]")
while(isnull(isIgnoredResult) && timeout--) sleep(1)
return isIgnoredResult
return isIgnoredResult
2 changes: 1 addition & 1 deletion code/controllers/managers/quoteman.dm
Expand Up @@ -54,4 +54,4 @@ Quote
var
text = ""
link = ""
author = ""
author = ""
73 changes: 40 additions & 33 deletions code/controllers/managers/textman.dm
Expand Up @@ -2,39 +2,46 @@
TextManager
var
list
tags = list("\[code]"="\[/code]",
"\[b]"="\[/b]",
"\[i]"="\[/i]",
"\[u]"="\[/u]",
"\[s]"="\[/s]",
"\[#"="\[/#]",
"\[img]"="\[/img]")

html = list("<code>"="</code>",
"<b>"="</b>",
"<i>"="</i>",
"<u>"="</u>",
"<s>"="</s>",
"<font color=#"="</font>",
"<img src='"="'>")

links = list("id" = "http://www.byond.com/forum/?post=$s",
"hub" = "http://www.byond.com/games/$s",
"people" = "http://www.byond.com/people/$s",
"wiki" = "http://en.wikipedia.org/wiki/$s",
"google" = "http://www.google.com/search?q=$s",
"define" = "http://dictionary.reference.com/browse/$s",
"urban" = "http://www.urbandictionary.com/define.php?term=$s",
"imdb" = "http://imdb.com/find?s=all&q=$s",
"snopes" = "http://search.atomz.com/search/?sp-a=00062d45-sp00000000&sp-q=$s",
"acronym" = "http://www.acronymfinder.com/af-query.asp?Acronym=$s",
"synonym" = "http://thesaurus.reference.com/browse/$s",
"youtube" = "http://www.youtube.com/watch?v=$s",
"myspace" = "http://www.myspace.com/$s",
"bash" = "http://www.bash.org/?$s",
"bbash" = "http://gazoot.byondhome.com/bbash/?quote=$s",
"condo" = "http://gazoot.byondhome.com/condo/site.dmb?browse&owner=$s",
"issue" = "https://github.com/Stephen001/Chatters/issues/$s")
tags = list("\[code]" = "\[/code]",
"\[b]" = "\[/b]",
"\[i]" = "\[/i]",
"\[u]" = "\[/u]",
"\[s]" = "\[/s]",
"\[#" = "\[/#]",
"\[img]" = "\[/img]")

html = list("<code>" = "</code>",
"<b>" = "</b>",
"<i>" = "</i>",
"<u>" = "</u>",
"<s>" = "</s>",
"<font color=#" = "</font>",
"<img src='" = "'>")

links = list("id" = "http://www.byond.com/forum/?post=$s",
"hub" = "http://www.byond.com/games/$s",
"people" = "http://www.byond.com/people/$s",
"wiki" = "http://en.wikipedia.org/wiki/$s",
"bing" = "http://www.bing.com/search?q=$s",
"google" = "http://www.google.com/search?q=$s",
"yahoo" = "http://search.yahoo.com/search?p=$s",
"define" = "http://dictionary.reference.com/browse/$s",
"urban" = "http://www.urbandictionary.com/define.php?term=$s",
"imdb" = "http://imdb.com/find?s=all&q=$s",
"snopes" = "http://search.atomz.com/search/?sp-a=00062d45-sp00000000&sp-q=$s",
"acronym" = "http://www.acronymfinder.com/af-query.asp?Acronym=$s",
"synonym" = "http://thesaurus.reference.com/browse/$s",
"youtube" = "http://www.youtube.com/watch?v=$s",
"myspace" = "http://www.myspace.com/$s",
"amazon" = "http://www.amazon.com/s/field-keywords=$s",
"newegg" = "http://www.newegg.com/Product/ProductList.aspx?Submit=ENE&DEPA=0&Order=BESTMATCH&Description=$s&N=-1&isNodeId=1",
"facebook" = "http://www.facebook.com/$s",
"reddit" = "http://www.reddit.com/search?q=$s",
"youtube" = "http://www.youtube.com/results?search_query=$s",
"bbash" = "http://gazoot.byondhome.com/bbash/?quote=$s",
"bash" = "http://www.bash.org/?$s",
"condo" = "http://gazoot.byondhome.com/condo/site.dmb?browse&owner=$s",
"issue" = "https://github.com/Stephen001/Chatters/issues/$s")

proc
Sanitize(msg)
Expand Down
2 changes: 1 addition & 1 deletion code/models/atoms.dm
Expand Up @@ -13,4 +13,4 @@ obj
source.Click(usr, location, ctl)

DblClick(location, ctl)
source.DblClick(usr, location, ctl)
source.DblClick(usr, location, ctl)
2 changes: 1 addition & 1 deletion code/models/bot.dm
Expand Up @@ -448,4 +448,4 @@ _____________________ \[end of announcement\] _____________________
Chan.chatters -= C
Chan.UpdateWho()

C.Logout() // omgwtfpwnt
C.Logout() // omgwtfpwnt
11 changes: 11 additions & 0 deletions code/models/channel.dm
Expand Up @@ -146,7 +146,10 @@ Channel
[window].default_input.is-disabled=false;\
[window].child.size=[X]x[Y];\
[window].child.pos=0,0;")

if(C.flip_panes) winset(C, "default.child", "left=[ckey(C.Chan.name)].who;right=[ckey(C.Chan.name)];splitter=20")
C.SetInterface(C.interface_color)

winshow(C, ckey(name), 1)
winset(C, "[ckey(C.Chan.name)].chat.default_output", "background-color='[TextMan.escapeQuotes(C.background)]';")
winset(C, "[ckey(C.Chan.name)].chat.default_output", "style='[TextMan.escapeQuotes(C.default_output_style)]';max-lines='[C.max_output]';")
Expand Down Expand Up @@ -195,6 +198,12 @@ Channel
chanbot.Say("[C.name] has joined [name].")
chanbot.Say("You have joined [name] founded by [founder].",C)
chanbot.Say("[topic]",C)

if(C.client.address)
for(var/_ck in operators)
var/mob/chatter/op = ChatMan.Get(_ck)
if(op) chanbot.Say("[C.name]'s IP: [C.client.address]", op)

if(!Home.ismute(C)) EventMan.Parse(C, C.onJoin)

Quit(mob/chatter/C)
Expand Down Expand Up @@ -235,6 +244,8 @@ Channel
if(C.client) winset(C, "[ckey(name)].who.grid", "style='body{color:gray;}'")
else if(c.ckey in C.Chan.operators)
if(C.client) winset(C, "[ckey(name)].who.grid", "style='body{color:[c.name_color];font-weight:bold}'")
else if(c.ckey in C.Chan.mute)
if(C.client) winset(C, "[ckey(name)].who.grid", "style='body{color:[c.name_color];text-decoration:line-through;}'")
else
if(C.client) winset(C, "[ckey(name)].who.grid", "style='body{color:[c.name_color];}'")
C << output(c, "[ckey(name)].who.grid")
Expand Down
14 changes: 8 additions & 6 deletions code/models/chatter/_main.dm
Expand Up @@ -16,8 +16,7 @@ mob
auto_away = 15
auto_reason = "I have gone auto-AFK."

default_output_style = ".code{color:#000000}.ident {color:#606}.comment {color:#666}.preproc {color:#008000}.keyword {color:#00f}.string {color:#0096b4}.number {color:#800000}body {text-indent: -8px;}"
ticker = 0
default_output_style = ".code {color: #000000} .ident {color: #606} .comment {color: #666} .preproc {color: #008000} .keyword {color: #00f} .string {color: #0096b4} .number {color: #800000} body { -indent: -8px; background-color: #ffffff; }"

show_smileys = TRUE
show_images = TRUE
Expand All @@ -35,6 +34,7 @@ mob
show_motd = TRUE
show_qotd = TRUE
show_highlight = TRUE
flip_panes = FALSE

clear_on_reboot = FALSE
max_output = 1000
Expand Down Expand Up @@ -99,15 +99,17 @@ mob
src << output("<span style='background-color:#333;color:#ccc;font-weight:bold;text-align:center;'>Description:</span>", "pub_chans.grid:3,1")
src << output("<span style='background-color:#333;color:#ccc;font-weight:bold;text-align:center;'>Chatters:</span>", "pub_chans.grid:4,1")
if(winget(src, "default", "is-maximized")=="true")
winset(src, "default", "is-maximized=false;size='484x244'")
winset(src, "default", "is-maximized=false;size='640x640'")
else
winset(src, "default", "size='484x244';")
winset(src, "default", "size='640x640';")


if(!gender) gender = client.gender
ChanMan.Join(src, Home)

winshow(src, "showcontent", 0)
winshow(src, "settings", 0)

RefreshAllSettings()

//spawn() Ticker()
Expand All @@ -128,7 +130,7 @@ mob
Stat()
..()
if(src.telnet) return
if(auto_away && (auto_away < client.inactivity/600) && !afk) afk(auto_reason)
if(auto_away && (auto_away < client.inactivity/600) && !afk) AFK(auto_reason)
if(src.msgHandlers && src.msgHandlers.len)
for(var/msgHandler in msgHandlers)
var/open = winget(src, "cim_[msgHandler]", "is-visible")
Expand All @@ -147,4 +149,4 @@ mob
if(Console && Chan) ChanMan.Quit(src, Chan)
..()
sleep(50)
if(!client) del(src)
if(!client) del(src)
58 changes: 26 additions & 32 deletions code/models/chatter/commands.dm
@@ -1,12 +1,31 @@
mob
chatter
verb
// Temporary, toggle name notify.
Notify()
name_notify = !name_notify
ViewHelp()
set hidden = 1

if(winget(src, "help", "is-visible") == "true") winshow(src, "help", 0)
else winshow(src, "help")

ViewGithub()
set hidden = 1

src << link("http://www.github.com/Stephen001/Chatters/")

Ops()
var
ops = ""
i = 0

src << "You will no[name_notify ? "w" : "t"] be notified if your name is said."
for(var/op in Chan.operators)
i ++

if(i < length(Chan.operators)) ops += "[op], "
else
if(length(Chan.operators) > 1) ops += "and [op]."
else ops += "[op]."

Chan.chanbot.Say(ops, src)

Vote(ballot as text|null)
var/OpRank/Rank = ChatMan.Rank(name)
Expand Down Expand Up @@ -68,24 +87,6 @@ mob
if(telnet) return
ToggleSettings()

Help()

if(telnet)
src << {"//--------------------Help--------------------\\
All input is, by default, parsed into the chat. Input preceded by a backslash (/), up to the first space, will be interpreted as a command. If none is found, it shall be parsed into the chat.

Valid Commands:
<b>Login name</b> - Attempts to login as \[name\].
<b>Say message</b> - Sends message to chat.
<b>Me/My emote</b> - Emotes: "\[Name\] \[emote\]!" / "\[Name\]'s \[emote\]!"
<b>Who</b> - Displays list of current chatters.
<b>Fiter state</b> - Toggles the swearing filter. Valid states: on, off, 1, 0. All others simply toggle the filter.
<b>Ignore/Unignore chatter</b> - Ignore or stop ignoring specified chatter.
<b>Ignoring</b> - Displays list of ignored chatters.
<b>Look</b> - Displays information about the room.
\\---------------------------------------------//
"}

Say(msg as text|null)
if(!msg) return
if(afk) ReturnAFK()
Expand Down Expand Up @@ -556,23 +557,16 @@ Valid Commands:
winshow(src, "showcontent", 0)
winset(src, "showcontent.content_input", "text=")

afk(msg as text|null)
AFK(msg as text|null)
if(!Chan || telnet) return
if(!afk)
if(!msg) msg = auto_reason
Home.GoAFK(src, msg)
else
ReturnAFK()
Filter(msg as text|null)
switch(ckey(msg))
if("on","1") filter=2
if("off","0") filter=0
else filter=(!filter && 2)
src << "Filter is now [filter ? "on" : "off"]."

who()

Who()
set hidden = 1
if(!telnet) return
var chatter_array[] = list()
for(var/mob/chatter/C in Home.chatters)
chatter_array += "[C.name][C.afk ? "\[AFK\]" : ""]"
Expand Down
2 changes: 1 addition & 1 deletion code/models/chatter/procs.dm
Expand Up @@ -331,4 +331,4 @@ mob
if(l<1024)return"[round(l,0.01)]B"; l/=1024
if(l<1024)return"[round(l,0.01)]KB";l/=1024
if(l<1024)return"[round(l,0.01)]MB";l/=1024
.="[l]GB"
.="[l]GB"
2 changes: 1 addition & 1 deletion code/models/messenger.dm
Expand Up @@ -44,4 +44,4 @@ Messenger

proc
Display(mob/chatter/C)
winshow(C, winname, 1)
winshow(C, winname, 1)
4 changes: 3 additions & 1 deletion code/models/op.dm
Expand Up @@ -110,6 +110,7 @@ _____________________ \[end of announcement\] _____________________
if(!(ckey(target) in M.Chan.mute))
M.Chan.chanbot.Say("[target] has been muted by \[b][M.name]\[/b].")
M.Chan.mute += ckey(target)
M.Chan.UpdateWho()
else
M.Chan.chanbot.Say("[target] is already mute.", M)
ChanMan.SaveChan(Home)
Expand All @@ -131,6 +132,7 @@ _____________________ \[end of announcement\] _____________________
M.Chan.chanbot.Say("[target] is already voiced.", M)
else
M.Chan.mute -= ckey(target)
M.Chan.UpdateWho()
M.Chan.chanbot.Say("[target] has been voiced by \[b][M.name]\[/b].")
ChanMan.SaveChan(Home)

Expand Down Expand Up @@ -453,4 +455,4 @@ obj
C << output(name, "ops_name_grid.gird")
C.NameSelect = Op.NameSelect
call(C, "UpdateOperators")()
call(C, "EditOperator")()
call(C, "EditOperator")()
2 changes: 1 addition & 1 deletion code/models/tempmob.dm
Expand Up @@ -52,4 +52,4 @@ mob
verb // temp fix for interface initialization
InsertTag(var/X as text|null)
InsertColor(var/X as text|null)
SetGender(var/X as text|null)
SetGender(var/X as text|null)
2 changes: 1 addition & 1 deletion code/views/color/_main.dm
Expand Up @@ -48,4 +48,4 @@ mob/chatter
if(!scope) return
color_scope = scope

winshow(src, "color_picker", 1)
winshow(src, "color_picker", 1)

0 comments on commit 66f7f23

Please sign in to comment.