invertika_game.Game.Character.disconnected C# (CSharp) Method

disconnected() public method

public disconnected ( ) : void
return void
        public void disconnected()
        {
            //for (Listeners::iterator i = mListeners.begin(),
            //     i_end = mListeners.end(); i != i_end;)
            //{
            //    const EventListener &l = **i;
            //    ++i; // In case the listener removes itself from the list on the fly.
            //    if (l.dispatch.disconnected)
            //        l.dispatch.disconnected(&l, this);
            //}
        }

Usage Example

Example #1
0
        static void warp(Character ptr, MapComposite map, int x, int y)
        {
            //TODO DEBUG555 entfernen
            int debug=555;

            remove(ptr);
            ptr.setMap(map);
            ptr.setPosition(new Point(x, y));
            ptr.clearDestination();
            /* Force update of persistent data on map change, so that
               characters can respawn at the start of the map after a death or
               a disconnection. */
            Program.accountHandler.sendCharacterData(ptr);

            if(map.isActive())
            {
                if(!insert(ptr))
                {
                    ptr.disconnected();
                    Program.gameHandler.kill(ptr);
                }
            }
            else
            {
                MessageOut msg=new MessageOut(Protocol.GAMSG_REDIRECT);
                msg.writeInt32(ptr.getDatabaseID());
                Program.accountHandler.send(msg);
                Program.gameHandler.prepareServerChange(ptr);
            }
        }