mappy

flexdc

20 posts in this topic

flexdc

cZyg6s.jpg

Are you an NMDC hub owner? Give your users a flash web interface!

It's quite easy to set up; all instructions are contained in one small easy download.

Get v1.1 from here or get the latest version from my google code page.

Edited by mappy

Share this post


Link to post
Share on other sites

probably the only one ever done in any sort of Javascript dialect.

Not really, I made a chat-only DC client in pure HTML, JS, PHP and MySQL some years ago. However, it got some performance issues loading the userlist in larger hubs.

Share this post


Link to post
Share on other sites

Not really, I made a chat-only DC client in pure HTML, JS, PHP and MySQL some years ago. However, it got some performance issues loading the userlist in larger hubs.

Ah, cool to hear it, i'm not too worried about that claim. Most of my hub stuff is for small-time chat with people i know in real life, so i don't have the opportunity to test it with anything much bigger than the campus hub.

For the record, though, did you have PHP or JS doing the protocol work?

Share this post


Link to post
Share on other sites

PHP was doing protocol work, JS was there to bring neccessary updates to the GUI. Ajax was used to do that.

Share this post


Link to post
Share on other sites

PHP was doing protocol work, JS was there to bring neccessary updates to the GUI. Ajax was used to do that.

So, like my dcwebui, but using PHP+MySQL for the backend instead of a C++ daemon.. that's a pretty cool project. Can i ask how you managed a persistent connection to the hub, then?

This flexdc implements all the protocol work in JS, so maybe my claim holds after all smile.gif

Share this post


Link to post
Share on other sites

Persistent connection was made by using a PHP script "client.php" in an infinite loop - it communicated with the hub and replied to that communication. It inserted records into MySQL database for each needed protocol request (for example, when a chat message arrived).

The record were taken from the database by a PHP script "whatsnew.php" called using Ajax periodically.

If interested, the client named "MekDC" is available for download on my web page.

Share this post


Link to post
Share on other sites

Nice project, well chosen name too ;)

Works like a charm, even noticed a FlexHub bug: hub was sending MyINFO's instead of NickList, will fix that.

Share this post


Link to post
Share on other sites

Nice project, well chosen name too ;)

Works like a charm, even noticed a FlexHub bug: hub was sending MyINFO's instead of NickList, will fix that.

I'm glad you like it : ) It's still kinda primitive, though, there are a few things i'd like to add (fixed PM support, multiple hubs/tabs, fully brandable) but for now it suits my private hub well enough.

EDIT: There are $Supports flags to determine things like whether the client prefers MyINFOs instead of NickList, and things like that. It could equally be a bug at my end, this is really only tested with PtokaX, although i'm glad to hear it works with FlexHub : )

Share this post


Link to post
Share on other sites

Yep, there's no 'NoHello' in the flexdc $Supports so hub needs to send $NickList instead of MyINFO's. Is fixed now.

Noticed a flexdc bug: there's a doubling of nicks in the userlist if a nick is in both the $NickList and the $OpList

Share this post


Link to post
Share on other sites

Another bug, when trying to login as registered user it sends an empty $MyPass to the hub, doesn't ask for pass in browser:

Share this post


Link to post
Share on other sites

Thanks for the reports! I've fixed the duplicate-operators bug and added password support. I've also included all my changes since the last release, including PM support and an updated swfok daemon.

Share this post


Link to post
Share on other sites

That's quick! Works great and nice that pm's are supported now.

About the source files, I'm not familiar with Adobe Flex, can you explain how to setup the project so it can be compiled to swf?

Share this post


Link to post
Share on other sites

There's still a bug with calculating the $Key:

[11:03:31] <FlexBot> IP: ***.***.***.*** <nick unknown> was disconnected because: Wrong key received after lock: $Key 4ÑÀ° A ѱ±ÀÀ01‘ ÑÑqÑ!‘Ñ‘ ѱ±ÀÀ01p 0

[11:03:31] <FlexBot> Lock was: EXTENDEDPROTOCOL_FLEXHUB_MULTIPROTOCOL_VQSP

[11:03:31] <FlexBot> Proper key: 4ÑÀ° A ѱ±ÀÀ01‘ ÑÑqÑ!‘Ñ‘ ѱ±ÀÀ01p 0

[11:05:22] <FlexBot> IP: ***.***.***.*** <nick unknown> was disconnected because: Wrong key received after lock: $Key ãÑÀ° A ѱ±ÀÀ01‘ ÑÑqÑ!‘Ñ‘ ѱ±ÀÀ01¶§Çç

[11:05:22] <FlexBot> Lock was: EXTENDEDPROTOCOL_FLEXHUB_MULTIPROTOCOL_4N2L

[11:05:22] <FlexBot> Proper key: ãÑÀ° A ѱ±ÀÀ01‘ ÑÑqÑ!‘Ñ‘ ѱ±ÀÀ01¶§Çç

Share this post


Link to post
Share on other sites

Adobe have free and OSS versions of the Flex SDK that should be sufficient to compile the project. I was given a copy of Flash Builder 4 as part of some university promotion Adobe ran a while ago, which is a custom Eclipse setup. If you have that, you should be able to just create a new project and import the source files. With the standalone SDK, it should be easily possible although i'm not sure of the exact way of configuring it.

I just tried FlexDC 1.1 against FlexHub 1055, and it seemed to unlock fine first try (image). Can you reproduce that every time? You can right-click in the top toolbar in FlexDC to enable debug mode.

Share this post


Link to post
Share on other sites

<edited - $Key is always checked, locally as well, unless !set check_key false is used>

After some tests it seems to provide a wrong key only occasionally.

Thanks for the info, will have a look at Flash Builder 4

Share this post


Link to post
Share on other sites

The wrong $Keys as posted above were sent from a russian browser, so it's probably a charset conversion bug that sends the wrong key

Share this post


Link to post
Share on other sites

Yeah, it assumes Windows-1252 (Latin-1) when decoding the key, at least. I think i use system locale everywhere else.

I'll look into it some more (and work in some more character encoding options for the next version).

Share this post


Link to post
Share on other sites

Hi! How to run it on Linux server?

UPDATE #1:

[HOW TO] Flash policy on Linux server.

Finally I figured out how to allow FlexDC to run on Linux server.

1) Warning! You need python to be v. 2.6+ (for CentOS use epel repository because regular yum install python gives 2.4 only).

2) Download attached archive, upload files from it to any folder on a destination server where dc hub is running.

3) Istall it using # bash ./install.sh

4) Start service # service flashpolicyd start (it should be already configured to start on system boot).

5) You are done! Try to connect with hub using FlexDC.

P.S: You can edit flashpolicy.xml before installing according to your requirements.

UPDATE #2:

[HOW TO] Import source files in Flash Builder v.4.5.

I was almost broke my head when tried to add the source of FlexDC into Flash Builder. Author, it would be very cool of providing as addition entire flash builder project, cuz so much problems path structures.

Anyway, step-by-step doing next:

1) Get Flash Builder 4.5. Install it and guess you need an activation.

2) Create new project in File->New->Flex Project and call it flexdc. Leave all options by default.

3) Mark all files and res folder from flex-src and grab them by mouse in "src" in expanded tree in flash builder. You will get 2 errors about wrong structures.

4) Double click on NMDCEvent.as end in the top of code make it looks like this: package {

5) Same with NMDCHub.as

6) Press Save and Refresh. You are just got another error.

7) Go into flexdc.mxml on line 18, find end edit itemrenderer to this: itemRenderer="flexUser"

8) Press Save and Refresh. It's done, now you can do next whatever you need with this project.

Also i provided exported FlexDC's project if you are don't want to do all that. Look in attachments.

You'r welcome! :)

Python_init.7z

flexdc_project.7z

Edited by Neolo

Share this post


Link to post
Share on other sites

Here is another question. My hub (NMDC) uses windows-1251 only. How to set FlexDC in this encoding?

UPDATE #1:

Go into project editing. In file NMDChub.as line 35 change windows-1252 to windows-1251 or another one you use on your hub.

Thx for help =).

Share this post


Link to post
Share on other sites