设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 101|回复: 0

[制作教程] In-game IRC Chat (MMORPG tool)

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    慵懒
    3 天前
  • 签到天数: 207 天

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    21262
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    25800

    灌水之王

    发表于 前天 13:36 | 显示全部楼层 |阅读模式

    In-Game IRC Chat



             



    Introduction


            This tutorial is to explain a concept, rather than providing all of the coding for you. It is aimed at experienced users who have knowledge of Javascript and IRC chat and wish to know how to implement the latter within their game.


             



    What is it?


            IRC, Internet Relay Chat, is the standard protocol for Internet chat rooms.


    Why would I want it?


            If you are building an MMORPG or other online game you may wish to consider adding some form of chat interface. By integrating IRC you embed a standardised tool, and one which you can use an external client to connect to, so that your player moderators have a much better interface to work with and don't even have to be in the game.


    Requirements


            You need a server that will allow you to host IRC bots.


            You need to be running in a web browser.


            You need a chat server to connect to; there are thousands across the web and that's outside the remit of this tutorial. They must however have webirc set up on their end.


    Step One: Set up your frames


            You need an iFrame, positioned above the game window, where you want the chat box to be. You can use Javascript to manipulate this iFrame later so don't worry about it being a fixed blob.


            You can use my tutorial on DOM elements here:




    Step Two: Set up KiwiIRC


            KiwiIRC is a javascript based client, which is what we need. More importantly it is open source. It needs to be set up on a web server, so make sure your web host allows IRC bots, otherwise you will end up in a heap of kobold.


            Here is the guide I used:


    https://github.com/KeiroD/furryavalon/wiki/Quickly-set-up-KiwiIRC


    Step Three: Test KiwiIRC


            Your IRC client should now work at http://your-website:7778


    Step Four: Skin your IRC client


            You will want to edit the theme files within kiwiIRC, to remove much of the content.


            Here's a basic set up:


    #kiwi .toolbar {
      display: none; !important;
    }

    #kiwi .right_bar {
      display: none; !important;
    }

    #kiwi .nick {
      display: none; !important;
    }

    #kiwi .memberlists_resize_handle {
      display: none; !important;
    }

    #kiwi .input_wrap {
      display: none; !important;
    }

    #kiwi .input_wrap {
      left: 7px; !important;
    }

    #kiwi .panels {
      top: 0px !important;
      right: 0px !important;
    }


            Basically what we are doing is hiding anything which lets us change channel, anything that is unnecessary, because we only have a small space to work with. We whittle it down until we just have a chat box and an input box.


    Step Four: add this plugin (to KiwiiRC)


            The following plugin merely takes you straight into chat instead of loading the server selection screen.


    <script>$('.server_details button').click();</script>.


    Step Five: Set up your iFrame


            You will want to change the src of the iFrame using Javascript from inside your game once you know the player's name.


            You will want to set the src to: http://your-website:7778?nick=%%%%


            Where %%%% is their name.


    Step Six: Set up your channel


            Register for channel services and generally set up your channel as you like it.


    Step Seven: Continue to restyle your chat box until it fits your game


            As it stands I am left with this.







            As a proof of concept for this tutorial, that's fine. It works and all.


            But with a bit of work it can quite easily be made to look like this:







            I just need to do the, er, bit of work. But that's styling, which is up to you and unique to your game.


    Step Eight: credit and link to KiwiIRC


            As I removed the toolbar which contains the link to KiwiIRC, it would be nice to properly credit them and add a link to their website, and then to donate to their funds.


    Considerations


            IRC nicknames are changeable, so you will want a server with NickServ services enabled.


            You could get players to authenticate themselves, or you could do it for them, but you would need their password in plain text for that, which is a no no.


            If your player disconnects dirtily they will still be ghosted on the server so will have to pick a new nickname.


            Always have permission of the IRC network to open a channel there, and always make sure your web host is happy running an IRC bot.


    本贴来自国际rpgmaker官方论坛作者:Ellie Jane处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/in-game-irc-chat-mmorpg-tool.62844/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-10 03:03 , Processed in 0.144343 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表