FlashPioneer Video Chat Installation Documentation
Copyright (C) 2001-2006 SourceTec Software Co., LTD.
All Rights Reserved

----------------------------------------------------------------
Table of Contents
      
    * Install Chat's database (.NET)
    * .NET Interface description

----------------------------------------------------------------

Install Chat's database (.NET)

    There two ways to keep the data. One is using the file format which is the 
    same as the former version, there is no need for users to setup to use, 
    Users' information and chat history are stored under the Chat server path 
    with an encryption; the other is integrating with the present database by 
    ASP.NET interface through which the users' information and chat history 
    store in the database. 

    1) First please make sure that your web server supports ASP.net and SQL 
       SERVER

    2) Build SQL SERVER database

        Operating sql statement of database.sql and build two new datatable: 
        users and log
        "users" table is for saving the users' information, the structure is as 
        following

        "users" table is for saving the users' information, the structure is as 
        following:
            uid            Primary KEY, autoincrease 
            username       User's name 
            password       Password 
            level          The user's level, the default value is 0, if it is 1 
                           then it is the administrator 
            signDate       Register time 
            lastLogin      The last login time  

        "log" table is for chatting history, the structure as is as following:
            lid            Primary KEY, autoincrease 
            target         Massage receiving one 
            ip             The user's IP address
            username       Massage sending one 
            message        Message content 
            date           Message sending time 

        After running sql statement, insert two users in users table:
            username    password    level
            admin       admin       1
            user        user        0

    3) Install Fluorine program

        Unzip aspService.zip, go into the Fluorine file after unzipping, use 
        Notepad or other text editor tools to open "Web.config", and modify the 
        code.

        Find the two lines of code as following: 

==================================================================
<add key="ConnStr" value="uid=sa;password=password;database=flashchat;server=localhost" />
==================================================================

        Modify the database server address, database uid and password, database 
        name in sql server as your configuration respectively.

    4) Configure Flashchat

        After finishing install chat program, log in chat as administrator, and 
        then go to the administrator panel.

        In the Setting panel, choose "remote database" in the red pane in the 
        picture. In "Remoting gateway URL" text field, fill the absolute url 
        of gateway.aspx. And then fill the class path of server object in 
        "Remoting class path" text field, save the setting. 


----------------------------------------------------------------

.NET Interface description

    There is ASP.net reserved interface. Through this, you can save the chat 
    users' information and chat history into your database on the website. And 
    you also can check the user's identity through the interface.
    Flash Remoting technology which is based on open source library Fluorine is 
    used for ASP.net interface. The following is the usage description:

    1) Server Environment

        ASP.net + sql server
        Remoting gateway interface program: Fluorine 2.0.7.824 for Windows 

    2) Server-side program

        Remoting program file exists as Class file, and it is placed in 
        "App_code" folder of Fluorine directory.

        When Flash client invoke the method of the program object on the 
        server, the class path must be appointed completely.

        The path is related with the namespace of the class. For example, the 
        namespace of class HelloWorld is defined as "test", its class path 
        changes to test HelloWorld

    3) Server program format

        The class files must include by the following 3 methods, the name of 
        method and parameter style must be the same as the following 
        description, or the program can't work properly.

==================================================================
/*
* used for login and identifying
*
* @ param username: User's name login
* @ param pass: password, if login as a guest, don't fill in the blank
* @ param isRegister: whether the user is new, if he/she is, it is true, or it is a
* blank or false
*/
public string doLogin(string username, string pass, bool isRegistrt){
    /*
        Please put your code here to database connection processing 
    */
    return Null/"guest"/"member"/"admin"
}
==================================================================

        doLogin Function must have return value for Red5/FMS to receive, there 
        are four kinds of return value:
        (1) Null: Null, login failed 
        (2) "guest": String, login succeed and login as a guest 
        (3) "member": String, login succeed and login as a register user 
        (4) "admin": String, login succeed and login as an administrator who 
            has the highest purview. 

        Explanation: doLogin function is the most important, if it is wrong 
        then nobody can login. So please check it very carefully before you 
        modify.


==================================================================
/*
* change the password, only for the register users
*
* @ param username: User's login name
* @ param oldPass: old pass word
* @ param newPass: new pass word
*/
public bool modifyPassword(string username, string oldPass, string newPass){
    /*
        Please put your code for checking your old password and setting your 
        new password here
    */
    return true/false;
}
==================================================================

        "modifyPassword" function must have return value and it is true of 
        false which is for showing whether the action is completed. 


==================================================================
/*
* save the chat history
*
* @ param target: Receiving massage one's name, if the one is in the 
* chatting room then it is the room's name. If it is a private chat, it is the 
* user's name.
* @ param ip: The user's IP address
* @ param username: Sending message user's name
* @ param message: Massage content
*/
public void saveChatLog(string target,string ip,string username,string message){
    /*
        Please put the code for saving the chat record into the database.
    */
}
==================================================================

        The function doesn't need the return value.

        Explanation: only the administrator enables the function of saving 
        chatting history in the control panel at the background, the function 
        works.



END
