A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Need some help reading code

  1. #1
    Junior Member
    Join Date
    Apr 2015
    Posts
    12

    Lightbulb Need some help reading code

    Hello, I need some help to understand some actionscript code of a chatbox... So I could use some functions to make custom messages etc, change the color etc... I'm not expierenced with flash so I only understand the code half, I've been reading it a few times and I mainly wonder what the "_" parameter does which you can find in the code?
    The *, ! and !! parameters have been disabled so those aren't for use anymore... I would mainly really like to know how I can customize the messages I can post in the box, and which parameters I have to use for that... Could anyone help me understand it?

    Code:
    package 
    {
        import fl.controls.*;
        import flash.display.*;
        import flash.events.*;
        import flash.net.*;
        import flash.text.*;
        import flash.utils.*;
        import it.gotoandplay.smartfoxserver.util.*;
    
        public class Chat extends Object
        {
            private var mChatBuffer:String;
            private var mScrollMarqueeCB:Function;
            private var mFilterSpectators:Boolean;
            private var mFocusCB:Function;
            private var mIsFriendCB:Function;
            private var mIsPlayerCB:Function;
            private var mFocusTimer:Timer;
            private var mIsBlockedCB:Function;
            private var mLinkCB:Function;
            private var mFilterPlayers:Boolean;
            private var mChatWindow:MovieClip;
            private var mFilterGameMessages:Boolean;
            private var mFilterRoomNotices:Boolean;
            private var mIsMouseToFocus:Boolean;
            private var mFilterBlockedUsers:Boolean;
            private var mBeforeMessagePosition:int;
            private var mNet:LiveNet;
            private var mInputCB:Function;
            private static const kFontColors:Array = [16711680, 30464, 11154431, 255, 0, 11615759, 16742178, 26487, 11206913, 65963];
    
            public function Chat(param1:MovieClip, param2:LiveNet)
            {
                this.mIsMouseToFocus = false;
                this.mFocusTimer = new Timer(200);
                this.mFocusTimer.addEventListener(TimerEvent.TIMER, this.OnFocusTime);
                this.SetAsset(param1, true);
                this.mNet = param2;
                this.mNet.SetPublicMessageCB(this.OnMessage);
                this.mNet.SetChatBufferCB(this.SetChatBuffer);
                return;
            }// end function
    
            private function OnFocusEvent(event:FocusEvent) : void
            {
                if (event.type == FocusEvent.FOCUS_IN)
                {
                    this.mChatWindow.stage.focus = this.mChatWindow.chatInput_txt;
                    if (this.mFocusCB != null)
                    {
                        this.mFocusCB(event);
                    }
                }
                return;
            }// end function
    
            private function OnMessage(param1:int, param2:String, param3:String, param4:Boolean = false) : void
            {
                var _loc_5:* = null;
                var _loc_6:* = null;
                var _loc_7:* = 0;
                var _loc_8:* = null;
                var _loc_9:* = null;
                var _loc_11:* = 0;
                var _loc_12:* = null;
                var _loc_13:* = 0;
                var _loc_14:* = 0;
                var _loc_15:* = null;
                var _loc_16:* = null;
                _loc_5 = new TextFormat();
                _loc_5.url = "";
                _loc_5.underline = false;
                _loc_6 = new TextFormat();
                _loc_6.url = "";
                _loc_6.underline = false;
                if (param1 == NetBase.kDevToUserMessageId)
                {
                    _loc_5.color = kFontColors[3];
                    _loc_5.underline = true;
                    _loc_6.color = kFontColors[4];
                    _loc_6.underline = false;
                }
                else if (param1 == NetBase.kSystemMessageId)
                {
                    _loc_5.color = kFontColors[1];
                    _loc_6.color = kFontColors[1];
                    if (this.mFilterRoomNotices && (param3.indexOf("entered") != -1 || param3.indexOf("left") != -1))
                    {
                        return;
                    }
                    if (this.mFilterGameMessages && param3.indexOf("KO\'d") != -1)
                    {
                        return;
                    }
                }
                else if (param1 == NetBase.kSupportMessageId)
                {
                    _loc_5.color = kFontColors[5];
                    _loc_6.color = kFontColors[6];
                }
                else if (param1 == NetBase.kCriticalSupportMessageId)
                {
                    _loc_5.color = kFontColors[5];
                    _loc_6.color = kFontColors[0];
                }
                else
                {
                    if (this.mFilterSpectators && this.mIsPlayerCB != null && !this.mIsPlayerCB(param1))
                    {
                        return;
                    }
                    if (this.mFilterPlayers && (this.mIsPlayerCB == null || this.mIsPlayerCB(param1)))
                    {
                        return;
                    }
                    _loc_7 = param3.indexOf("_");
                    if (_loc_7 != -1)
                    {
                        _loc_9 = param3;
                        _loc_8 = _loc_9.slice(0, _loc_7);
                        param3 = _loc_9.slice((_loc_7 + 1), _loc_9.length);
                    }
                    if (_loc_8 != null && this.mFilterBlockedUsers && this.mIsBlockedCB != null && this.mIsBlockedCB(_loc_8))
                    {
                        return;
                    }
                    if (param2 == this.mNet.GetUserName())
                    {
                        _loc_5.color = kFontColors[2];
                        _loc_6.color = kFontColors[4];
                    }
                    else
                    {
                        _loc_5.color = kFontColors[3];
                        _loc_5.underline = false;
                        if (this.mIsFriendCB(_loc_8))
                        {
                            _loc_6.color = kFontColors[7];
                            _loc_6.underline = false;
                        }
                        else
                        {
                            _loc_6.color = kFontColors[4];
                            _loc_6.underline = false;
                        }
                    }
                    if (this.mNet.GetGame().GetLiveScript())
                    {
                        _loc_11 = this.mNet.GetGame().GetLiveScript().GetTeamIdByNetId(param1);
                        if (_loc_11 == 0)
                        {
                            _loc_5.color = kFontColors[9];
                            _loc_6.color = kFontColors[9];
                            _loc_6.underline = false;
                        }
                        else if (_loc_11 == 1)
                        {
                            _loc_5.color = kFontColors[8];
                            _loc_6.color = kFontColors[8];
                            _loc_6.underline = false;
                        }
                    }
                }
                if (this.mChatWindow.name != "chatInGame_mc" && param2 == "Tetris Support")
                {
                    this.mScrollMarqueeCB(param3, param4);
                    return;
                }
                if (param2 == this.mNet.GetUserName() || Math.max(1, this.mChatWindow.chat_txt.numLines - 17) == this.mChatWindow.chat_txt.scrollV)
                {
                    this.mBeforeMessagePosition = -1;
                }
                else
                {
                    this.mBeforeMessagePosition = this.mChatWindow.chat_txt.scrollV;
                }
                if (_loc_5.underline)
                {
                    this.mChatWindow.chat_txt.htmlText = this.mChatWindow.chat_txt.htmlText + ("<a href=\'event:" + param2 + "\'>" + param2 + "</a>");
                }
                else
                {
                    this.mChatWindow.chat_txt.appendText(param2);
                    this.mChatWindow.chat_txt.setTextFormat(_loc_5, this.mChatWindow.chat_txt.text.length - param2.length - 1, this.mChatWindow.chat_txt.length);
                }
                this.mChatWindow.chat_txt.selectable = false;
                var _loc_10:* = _loc_9.indexOf("<a href");
                if (_loc_5.underline || (_loc_10 == -1 || param1 != NetBase.kSupportMessageId && param1 != NetBase.kCriticalSupportMessageId))
                {
                    this.mChatWindow.chat_txt.appendText(": " + param3 + "\n");
                    this.mChatWindow.chat_txt.setTextFormat(_loc_6, this.mChatWindow.chat_txt.text.length - _loc_9.length - 1, this.mChatWindow.chat_txt.length);
                }
                else
                {
                    this.mChatWindow.chat_txt.appendText(": ");
                    _loc_12 = _loc_9.substr(0, _loc_10);
                    _loc_13 = _loc_9.indexOf("</a>", _loc_10);
                    _loc_14 = this.mChatWindow.chat_txt.length;
                    if (_loc_13 != -1)
                    {
                        _loc_13 = _loc_13 + 4;
                        _loc_15 = _loc_9.substr(_loc_13, _loc_9.length - _loc_13);
                        if (_loc_12 != "")
                        {
                            this.mChatWindow.chat_txt.appendText(_loc_12);
                            this.mChatWindow.chat_txt.setTextFormat(_loc_6, _loc_14, _loc_14 + _loc_10);
                        }
                        _loc_16 = _loc_9.substr(_loc_10, _loc_13 - _loc_10);
                        _loc_13 = this.mChatWindow.chat_txt.length;
                        if (_loc_16 != "")
                        {
                            this.mChatWindow.chat_txt.htmlText = this.mChatWindow.chat_txt.htmlText + _loc_16;
                        }
                        if (_loc_15 != "")
                        {
                            _loc_13 = this.mChatWindow.chat_txt.length;
                            this.mChatWindow.chat_txt.appendText(_loc_15);
                            this.mChatWindow.chat_txt.setTextFormat(_loc_6, _loc_13, this.mChatWindow.chat_txt.length);
                        }
                        this.mChatWindow.chat_txt.appendText("\n");
                    }
                }
                this.UpdateScroll();
                return;
            }// end function
    
            public function IsFilterRoomNotices() : Boolean
            {
                return this.mFilterRoomNotices;
            }// end function
    
            private function OnFocusTime(event:TimerEvent) : void
            {
                this.mFocusTimer.stop();
                this.mChatWindow.stage.focus = this.mChatWindow.chatInput_txt;
                return;
            }// end function
    
            public function SetInputCB(param1:Function) : void
            {
                this.mInputCB = param1;
                return;
            }// end function
    
            public function SetScrollMarqueeCB(param1:Function) : void
            {
                this.mScrollMarqueeCB = param1;
                return;
            }// end function
    
            public function SetFocusCB(param1:Function) : void
            {
                this.mFocusCB = param1;
                return;
            }// end function
    
            public function WriteChatToCookie() : void
            {
                var cookie:SharedObject;
                var str:String;
                cookie = SharedObject.getLocal("ChatToReport", "/");
                if (cookie)
                {
                    try
                    {
                        str = this.mChatWindow.chat_txt.text;
                        cookie.clear();
                        cookie.data.chat = encodeURIComponent(str.substring(str.length - 10000 >= 0 ? (0) : (str.length - 10000), str.length));
                        cookie.flush();
                    }
                    catch (error:Error)
                    {
                        trace("Cookie Write Error : Error while writing data variables");
                    }
                }
                return;
            }// end function
    
            public function SetIsBlockedCB(param1:Function) : void
            {
                this.mIsBlockedCB = param1;
                return;
            }// end function
    
            public function SetChatBuffer(param1:String) : void
            {
                this.mChatBuffer = null;
                this.mChatBuffer = param1;
                this.Clear();
                return;
            }// end function
    
            private function UpdateScroll() : void
            {
                if (this.mChatWindow.chat_txt.textHeight > UIScrollBar(this.mChatWindow.chat_sb).height)
                {
                    this.mChatWindow.chat_sb.visible = true;
                    this.mChatWindow.chat_sb.update();
                }
                else
                {
                    this.mChatWindow.chat_sb.visible = false;
                }
                if (this.mBeforeMessagePosition == -1)
                {
                    this.mChatWindow.chat_txt.scrollV = Math.max(0, this.mChatWindow.chat_txt.numLines - 12);
                }
                else
                {
                    this.mChatWindow.chat_txt.scrollV = this.mBeforeMessagePosition;
                }
                return;
            }// end function
    
            public function SetIsFriendCB(param1:Function) : void
            {
                this.mIsFriendCB = param1;
                return;
            }// end function
    
            public function SetIsPlayerCB(param1:Function) : void
            {
                this.mIsPlayerCB = param1;
                return;
            }// end function
    thanks

  2. #2
    Junior Member
    Join Date
    Apr 2015
    Posts
    12
    Code:
            public function Clear() : void
            {
                var _loc_1:* = null;
                var _loc_2:* = 0;
                var _loc_3:* = null;
                var _loc_4:* = null;
                var _loc_5:* = null;
                if (this.mChatWindow)
                {
                    this.mChatWindow.chat_txt.text = "";
                    this.mChatWindow.chatInput_txt.text = "";
                    this.mChatWindow.chatInput_txt.setSelection(0, 0);
                    this.UpdateScroll();
                    if (this.mChatBuffer != null && this.mChatBuffer.length > 0)
                    {
                        _loc_1 = this.mChatBuffer.slice(0, (this.mChatBuffer.length - 1)).split("|");
                        _loc_2 = 0;
                        for each (_loc_3 in _loc_1)
                        {
                            
                            _loc_4 = _loc_3.split("~");
                            _loc_5 = _loc_4[0];
                            if (_loc_5.indexOf("TetrisSupport") != -1 || _loc_5.indexOf("Tetris Support") != -1)
                            {
                                if (_loc_5.charAt(0) == 1)
                                {
                                    _loc_2 = NetBase.kCriticalSupportMessageId;
                                }
                                else
                                {
                                    _loc_2 = NetBase.kSupportMessageId;
                                }
                                _loc_5 = "Tetris Support";
                            }
                            else
                            {
                                _loc_2 = 0;
                            }
                            this.OnMessage(_loc_2, _loc_5, Entities.decodeEntities(String(_loc_4[1]).replace("&", "&")));
                        }
                    }
                }
                return;
            }// end function
    
            private function OnMouseDown(event:MouseEvent) : void
            {
                this.mFocusTimer.reset();
                this.mFocusTimer.start();
                this.mIsMouseToFocus = true;
                return;
            }// end function
    
      public function WriteFilters() : void
            {
                var so:SharedObject;
                so = SharedObject.getLocal(this.mNet.GetUserName() + "chatfilters");
                try
                {
                    so.data.block = this.mFilterBlockedUsers;
                    so.data.gm = this.mFilterGameMessages;
                    so.data.player = this.mFilterPlayers;
                    so.data.rn = this.mFilterRoomNotices;
                    so.data.spec = this.mFilterSpectators;
                    so.flush();
                }
                catch (e:Error)
                {
                }
                return;
            }// end function
    
            public function SendMessage(param1:String) : void
            {
                var _loc_2:* = null;
                var _loc_3:* = 0;
                var _loc_6:* = false;
                var _loc_7:* = false;
                var _loc_8:* = false;
                var _loc_9:* = null;
                var _loc_4:* = /~/g;
                var _loc_5:* = /\|/g;
                param1 = param1.replace(_loc_4, "").replace(_loc_5, "");
                if (param1.charAt(0) == "!" && OWUser.GetUser().GetIsDeveloper())
                {
                    _loc_2 = param1;
                    _loc_6 = false;
                    _loc_7 = false;
                    _loc_8 = false;
                    _loc_3 = _loc_2.indexOf("!!");
                    if (_loc_3 == 0)
                    {
                        _loc_2 = _loc_2.slice(2, _loc_2.length);
                        _loc_6 = true;
                    }
                    else
                    {
                        _loc_2 = _loc_2.slice(1, _loc_2.length);
                    }
                    if (_loc_2.charAt(0) == "*")
                    {
                        _loc_7 = true;
                        _loc_2 = _loc_2.slice(1, _loc_2.length);
                    }
                    this.mNet.SendModeratorMessage(_loc_2 + "\n", _loc_6, _loc_7, _loc_8);
                }
                else if (param1.charAt(0) == "[" && param1.charAt(1) != "]" && OWUser.GetUser().GetIsDeveloper())
                {
                    _loc_2 = param1;
                    _loc_3 = _loc_2.indexOf("]");
                    if (_loc_3 != -1)
                    {
                        _loc_9 = _loc_2.slice(1, _loc_3);
                        _loc_2 = _loc_2.slice((_loc_3 + 1), _loc_2.length);
                        this.mNet.SendModeratorMessage(_loc_2 + "\n", false, false, _loc_8, _loc_9);
                    }
                }
                else
                {
                    this.mNet.SendPublicChat(param1);
                }
                return;
            }// end function
    
            public function SetAsset(param1:MovieClip, param2:Boolean = false) : void
            {
                if (param1)
                {
                    this.mChatWindow = param1;
                    this.mChatWindow.chat_txt.addEventListener(TextEvent.LINK, this.OnTextLink);
                    this.mChatWindow.chatInput_txt.maxChars = OWUser.GetUser().GetIsDeveloper() ? (null) : (120);
                    this.mChatWindow.chatInput_txt.text = "";
                    if (!OWUser.GetUser().GetIsEmailVerified())
                    {
                        this.mChatWindow.chatInput_txt.type = TextFieldType.DYNAMIC;
                    }
                    this.mChatWindow.chatInput_txt.addEventListener(TextEvent.TEXT_INPUT, this.OnTextInput);
                    this.mChatWindow.chatInput_txt.restrict = " -~";
                    this.mChatWindow.addEventListener(FocusEvent.FOCUS_IN, this.OnFocusEvent, false, 0, true);
                    this.mChatWindow.addEventListener(MouseEvent.MOUSE_DOWN, this.OnMouseDown, false, 0, true);
                    if (param2)
                    {
                        this.Clear();
                    }
                    if (param2)
                    {
                        this.mFilterBlockedUsers = false;
                        this.mFilterGameMessages = false;
                        this.mFilterPlayers = false;
                        this.mFilterRoomNotices = false;
                        this.mFilterSpectators = false;
                        this.mIsBlockedCB = null;
                        this.mIsPlayerCB = null;
                        this.mLinkCB = null;
                        this.mIsFriendCB = null;
                        this.mFocusTimer.stop();
                    }
                }
                else
                {
                    this.mFocusTimer.stop();
                    this.mChatWindow.chat_txt.removeEventListener(TextEvent.LINK, this.OnTextLink);
                    this.mChatWindow.removeEventListener(FocusEvent.FOCUS_IN, this.OnFocusEvent);
                    this.mChatWindow.chat_txt.removeEventListener(MouseEvent.MOUSE_DOWN, this.OnMouseDown);
                    this.mChatWindow.chatInput_txt.removeEventListener(TextEvent.TEXT_INPUT, this.OnTextInput);
                    this.mChatWindow = null;
                }
                return;
            }// end function
    
            public function SetLinkCB(param1:Function) : void
            {
                this.mLinkCB = param1;
                return;
            }// end function
    
            public function GetIsMouseToFocus() : Boolean
            {
                return this.mIsMouseToFocus;
            }// end function
    
            public function SetFilters(param1:Boolean, param2:Boolean, param3:Boolean, param4:Boolean, param5:Boolean) : void
            {
                this.mFilterRoomNotices = param1;
                this.mFilterGameMessages = param2;
                this.mFilterBlockedUsers = param3;
                this.mFilterPlayers = param5;
                this.mFilterSpectators = param4;
                this.WriteFilters();
                return;
            }// end function
    
            public function Fini() : void
            {
                if (this.mFocusTimer)
                {
                    this.mFocusTimer.stop();
                    this.mFocusTimer.removeEventListener(TimerEvent.TIMER, this.OnFocusTime);
                    this.mFocusTimer = null;
                }
                this.mChatWindow.removeEventListener(FocusEvent.FOCUS_IN, this.OnFocusEvent);
                this.mChatWindow.chat_txt.removeEventListener(MouseEvent.MOUSE_DOWN, this.OnMouseDown);
                this.mChatWindow.chatInput_txt.removeEventListener(TextEvent.TEXT_INPUT, this.OnTextInput);
                this.mChatWindow = null;
                this.mNet = null;
                this.mFocusCB = null;
                return;
            }// end function
    
            public function ReadFilters() : void
            {
                var _loc_1:* = null;
                _loc_1 = SharedObject.getLocal(this.mNet.GetUserName() + "chatfilters");
                if (_loc_1 && _loc_1.data && _loc_1.data.block)
                {
                    this.mFilterBlockedUsers = _loc_1.data.block;
                    this.mFilterGameMessages = _loc_1.data.gm;
                    this.mFilterPlayers = _loc_1.data.player;
                    this.mFilterRoomNotices = _loc_1.data.rn;
                    this.mFilterSpectators = _loc_1.data.spec;
                }
                else
                {
                    this.mFilterBlockedUsers = true;
                    this.mFilterGameMessages = false;
                    this.mFilterPlayers = false;
                    this.mFilterRoomNotices = false;
                    this.mFilterSpectators = false;
                }
                return;
            }// end function
    
            public function IsFilterSpectators() : Boolean
            {
                return this.mFilterSpectators;
            }// end function
    
            public function IsFilterGameMessages() : Boolean
            {
                return this.mFilterGameMessages;
            }// end function
    
            public function GetAsset() : MovieClip
            {
                return this.mChatWindow;
            }// end function
    
            public function SetIsMouseToFocus(param1:Boolean) : void
            {
                this.mIsMouseToFocus = param1;
                return;
            }// end function
    
            private function OnTextInput(event:TextEvent) : void
            {
                var _loc_2:* = false;
                var _loc_3:* = 0;
                if (event.text == "\n")
                {
                    event.preventDefault();
                    if (this.mChatWindow.chatInput_txt.text != "")
                    {
                        _loc_2 = false;
                        _loc_3 = 0;
                        while (_loc_3 < this.mChatWindow.chatInput_txt.text.length)
                        {
                            
                            if (this.mChatWindow.chatInput_txt.text.charAt(_loc_3) != " ")
                            {
                                _loc_2 = true;
                                break;
                            }
                            _loc_3++;
                        }
                        if (_loc_2)
                        {
                            this.SendMessage(this.mChatWindow.chatInput_txt.text);
                        }
                        this.mChatWindow.chatInput_txt.text = "";
                        this.mChatWindow.chatInput_txt.setSelection(0, 0);
                    }
                    if (this.mInputCB != null)
                    {
                        this.mInputCB();
                    }
                }
                return;
            }// end function
    
            public function OnTextLink(event:TextEvent) : void
            {
                if (this.mLinkCB != null)
                {
                    this.mLinkCB(event);
                }
                return;
            }// end function
    
            public function IsFilterPlayers() : Boolean
            {
                return this.mFilterPlayers;
            }// end function
    
            public function GetInputTextField() : TextField
            {
                return this.mChatWindow.chatInput_txt;
            }// end function
    
            public function IsFilterBlockedUsers() : Boolean
            {
                return this.mFilterBlockedUsers;
            }// end function
    
        }
    }

  3. #3
    Junior Member
    Join Date
    Apr 2015
    Posts
    12
    Come on, this is a flash and help forum and now one can help read this piece of code?

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    I think you will be better off using smartfox's own forums for questions about smartfox server, I have experience with the AS2 chat server but not the AS3 one, and it is completely different.

    The documentation that you can download and/or read on their site will tell you eveything you need to know.
    It's not something you can just answer randomly here.

    The _ you refer to, from what I can see in the two lumps of code you pasted is purely for naming purposes.

    The code looks decompiled too, hence lots of "_loc1" "_loc2" "_loc3" names ( I may be wrong but that happens when code is decompiled ).

    http://www.smartfoxserver.com/forums/

  5. #5
    Junior Member
    Join Date
    Apr 2015
    Posts
    12
    Quote Originally Posted by fruitbeard View Post
    Hi,

    I think you will be better off using smartfox's own forums for questions about smartfox server, I have experience with the AS2 chat server but not the AS3 one, and it is completely different.

    The documentation that you can download and/or read on their site will tell you eveything you need to know.
    It's not something you can just answer randomly here.

    The _ you refer to, from what I can see in the two lumps of code you pasted is purely for naming purposes.

    The code looks decompiled too, hence lots of "_loc1" "_loc2" "_loc3" names ( I may be wrong but that happens when code is decompiled ).

    http://www.smartfoxserver.com/forums/
    Thanks, thats helpful, but I meant actually this code regarding to the "_" parameter, cuz this seemed like a parameter or trigger I could use in the chat:
    _loc_7 = param3.indexOf("_");
    if (_loc_7 != -1)
    {
    _loc_9 = param3;
    _loc_8 = _loc_9.slice(0, _loc_7);
    param3 = _loc_9.slice((_loc_7 + 1), _loc_9.length);
    }
    Any idea what this does or how I can use it?

  6. #6
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    As I say again, they are being used for naming things, in that case the variables are called "_loc_7", "_loc_8", "_loc_9" and so on.
    The code is checking if param3 contains the "_" string." and if so that value becomes "_loc_7" var
    i(_loc_7 != -1) meaning if it has more than none. true/false.

    if it has one or more "_" then it goes through the next part of the code inside the parenthesis.

    I think anyway.

    you haven't really made it clear what you actually want and I know you need to have the smartfox server installed to be able to do any testing and many people will not install something just to test for you, try the smartfox forum.

    The vars would not be callled _loc_7 or any of the other if the code was not decompiled, you can download the full server code and pages from smartfox so I don't understand why someone would decompile it.

  7. #7
    Junior Member
    Join Date
    Apr 2015
    Posts
    12
    Quote Originally Posted by fruitbeard View Post
    Hi,

    As I say again, they are being used for naming things, in that case the variables are called "_loc_7", "_loc_8", "_loc_9" and so on.
    The code is checking if param3 contains the "_" string." and if so that value becomes "_loc_7" var
    i(_loc_7 != -1) meaning if it has more than none. true/false.

    if it has one or more "_" then it goes through the next part of the code inside the parenthesis.

    I think anyway.

    you haven't really made it clear what you actually want and I know you need to have the smartfox server installed to be able to do any testing and many people will not install something just to test for you, try the smartfox forum.

    The vars would not be callled _loc_7 or any of the other if the code was not decompiled, you can download the full server code and pages from smartfox so I don't understand why someone would decompile it.
    Thanks, thats very interesting cuz I didn't know that was some kind of flashchatserver, I thought it was just some kind of "standalone" chat utility, But I'll have in attachment the source of this chat that I'm having, and indeed what I posted was decompiled from the main swf, I hope you can see where I can find more then
    Btw the "!" was also a paramter in this code that used to be a trigger to make differen messages... but that has been disabled now in that particular chatbox.

    Im happy i finally get some real help with this! thanks http://www.mediafire.com/download/pb...14zta/Chat.rar

  8. #8
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    The ! probably means "is not" in this code, there are plenty of other special characters that are being used in some way or another too.

    There is no need to link to your file as anybody who tries to help would need the whole chat server files to be able to do anything with it.

    Go download the files and instructions from http://www.smartfoxserver.com/

  9. #9
    Junior Member
    Join Date
    Apr 2015
    Posts
    12
    Quote Originally Posted by fruitbeard View Post
    Hi,

    The ! probably means "is not" in this code, there are plenty of other special characters that are being used in some way or another too.

    There is no need to link to your file as anybody who tries to help would need the whole chat server files to be able to do anything with it.

    Go download the files and instructions from http://www.smartfoxserver.com/
    Thanks, I read some more documentation about it but found nothing usefull yet it's frustrating, I'm starting to think what I wanna do is not possible but on the other hand I have seen people manipulate this chat recently, so something should be possible. I registered at the forum too but it needs activation. It seems to be the SFS2 for Flash. Normally if you want to use colors etc you should use html code, but that is disabled in the chatbox on my game. So I don't really know either what I could do with the sourcecode of this chat, cuz I didn't find any commands that you could do as a user or other to send different messages... I could be wrong since you are expierenced with this. I hope someone who knows could still help me with this.

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center