Beispiel #1
0
        public void interactWithDice(int itemID, uint sessionID, bool spinDice)
        {
            floorItem pItem = this.getFloorItem(itemID);
            if (pItem != null && pItem.Definition.Behaviour.isDice) // Valid item
            {
                roomUser pUser = this.getRoomUser(sessionID);
                if (pUser == null || !tilesTouch(pItem.X, pItem.Y, pUser.X, pUser.Y))
                    return; // Invalid position of room user and dice item
                pUser = null;

                serverMessage Message = new serverMessage(90); // "AZ"
                Message.Append(itemID);
                itemID *= 38;

                int randomNumber = 0;
                if (spinDice) // New spin
                {
                    this.sendMessage(Message); // Start spin animation for clients

                    // Generate random number
                    randomNumber = new Random(DateTime.Now.Millisecond).Next(1, 7); // 1-6
                    itemID += randomNumber;
                }

                Message.Append(" " + itemID.ToString()); // Append 'new' item ID
                if (spinDice) // New spin, send delayed message
                    this.sendMessage(Message.ToString(), 1000);
                else // Send message immediately
                    this.sendMessage(Message);

                pItem.customData = randomNumber.ToString(); // Set custom data
                pItem.requiresUpdate = true; // Request update of dice customdata
            }
        }
Beispiel #2
0
        /// <summary>
        /// Broacoasts the placement of a wall item to all room users.
        /// </summary>
        /// <param name="pItem">The wallItem instance of the wall item that is placed.</param>
        private void broadcoastWallItemPlacement(wallItem pItem)
        {
            serverMessage Message = new serverMessage(83); // "AS"

            Message.Append(pItem.ToString());
            this.sendMessage(Message);
        }
Beispiel #3
0
 /// <summary>
 /// 199 - "CG"
 /// </summary>
 public void MESSAGETOCALLER()
 {
     string[] args = Request.getMixedParameters();
     if (Session.User.hasFuseRight("fuse_receive_calls_for_help"))
     {
         Database Database = new Database(false, false);
         Database.addParameterWithValue("id", args[0]);
         Database.addParameterWithValue("msg", args[1]);
         Database.Open();
         if (Database.Ready)
         {
             DataRow dRow = Database.getRow("SELECT * FROM callforhelp WHERE id = @id");
             if (dRow != null)
             {
                 Session S = Engine.Game.Users.getUserSession(Convert.ToInt32(dRow["uid"]));
                 if (S == null)
                 {
                     return;
                 }
                 serverMessage Message = new serverMessage();
                 Message.Initialize(274);
                 Message.Append(args[1]);
                 Message.appendChar(2);
                 S.gameConnection.sendMessage(Message);
                 Database.runQuery("INSERT INTO callforhelp_msg VALUES ('', @id, @msg, '" + Session.User.ID + "', '" + Session.ipAddress + "', '" + DateTime.Now.ToString() + "')");
             }
         }
     }
 }
Beispiel #4
0
        /// <summary>
        /// Broadcoasts the removal of a floor item to all room users.
        /// </summary>
        /// <param name="itemID">The database ID of the floor item that is removed.</param>
        private void broadcoastFloorItemRemoval(int itemID)
        {
            serverMessage Message = new serverMessage(94); // "A^"

            Message.Append(itemID);
            this.sendMessage(Message);
        }
Beispiel #5
0
        /// <summary>
        /// Broadcoasts the state update of a given wall item to all active room users.
        /// </summary>
        /// <param name="pItem">The wallItem instance of the wall item that is updated.</param>
        private void broadcoastWallItemStateUpdate(wallItem pItem)
        {
            serverMessage Message = new serverMessage(85); // "AU"

            Message.Append(pItem.ToString());
            this.sendMessage(Message);
        }
Beispiel #6
0
        /// <summary>
        /// 105 - "Ai"
        /// </summary>
        public void BUY_TICKETS()
        {
            int bundleID         = Request.getNextWiredParameter();
            int ticketsPurchased = (bundleID == 1) ? 2 : 20;

            Users.userInformation recipient =
                Engine.Game.Users.getUserInfo(Request.Content.Substring(3), true);

            if (recipient != null)
            {
                Sessions.Session session = Engine.Game.Users.getUserSession(recipient.ID);
                if (session != null)
                {
                    session.User.Tickets += ticketsPurchased;
                    session.refreshTickets();
                    if (session != this.Session)
                    {
                        serverMessage alert = new serverMessage(139); // "BK"
                        alert.Append($"{this.Session.User.Username} has sent you {ticketsPurchased} tickets.");
                        session.gameConnection.sendMessage(alert);
                    }
                    else
                    {
                        Response.Initialize(139); // "BK"
                        Response.Append("Tickets purchased.");
                        sendResponse();
                    }
                }
                else
                {
                    recipient.Tickets += ticketsPurchased;
                    recipient.updateValueables();
                }
            }
        }
Beispiel #7
0
        /// <summary>
        /// Makes a room unit (so a room user, a pet, or a bot) visible to all users in the room.
        /// </summary>
        /// <param name="szDetails"></param>
        private void castRoomUnit(string szDetails)
        {
            serverMessage Cast = new serverMessage(28); // "@\"

            Cast.Append(szDetails);
            this.sendMessage(Cast);
        }
Beispiel #8
0
        /// <summary>
        /// 66 - "AB"
        /// </summary>
        public void FLATPROPBYITEM()
        {
            if (Session.roomInstance.sessionHasRights(Session.ID)) // Permission
            {
                int       itemID = int.Parse(Request.Content.Split('/')[1]);
                stripItem pItem  = Session.itemStripHandler.getHandItem(itemID);
                if (pItem != null && pItem.Definition.Behaviour.isDecoration)
                {
                    Session.itemStripHandler.removeHandItem(itemID, true);

                    int decorationValue = int.Parse(pItem.customData);
                    if (pItem.Definition.Sprite == "wallpaper")
                    {
                        Session.roomInstance.Information.Wallpaper = decorationValue;
                    }
                    else // Floor
                    {
                        Session.roomInstance.Information.Floor = decorationValue;
                    }

                    serverMessage msgUpdate = new serverMessage(46); // "@n"
                    msgUpdate.Append(pItem.Definition.Sprite);
                    msgUpdate.Append("/");
                    msgUpdate.Append(decorationValue);
                    Session.roomInstance.sendMessage(msgUpdate);

                    Session.roomInstance.Information.updateFlatProperties();
                }
            }
        }
Beispiel #9
0
        /// <summary>
        /// Accepts a buddy request and notifies the sender (if online) and the receiver.
        /// </summary>
        /// <param name="Session">The Woodpecker.Sessions.Session object of the user that accepts the request.</param>
        /// <param name="senderID">The database ID of the user that sent the request.</param>
        public void acceptBuddyRequest(ref Session Session, int senderID)
        {
            Database Database = new Database(false, false);

            Database.addParameterWithValue("userid", Session.User.ID);
            Database.addParameterWithValue("senderid", senderID);
            Database.Open();

            if (Database.findsResult("SELECT userid FROM messenger_buddylist WHERE userid = @senderid AND buddyid = @userid AND accepted = '0' LIMIT 1"))
            {
                Database.runQuery("UPDATE messenger_buddylist SET accepted = '1' WHERE userid = @senderid AND buddyid = @userid LIMIT 1");
                Database.Close();

                serverMessage Message = new serverMessage();
                if (ObjectTree.Game.Users.userIsLoggedIn(senderID)) // Sender is online!
                {
                    Message.Initialize(137);                        // "BI"
                    Message.Append(getBuddy(Session.User.ID).ToString());
                    ObjectTree.Game.Users.trySendGameMessage(senderID, Message);
                }

                Message.Initialize(137); // "BI"
                Message.Append(getBuddy(senderID).ToString());
                Session.gameConnection.sendMessage(Message);
            }
            else
            {
                Database.Close();
            }
        }
Beispiel #10
0
        public void broadcoastHeightmap()
        {
            serverMessage Message = new serverMessage(31); // "@_"

            Message.Append(this.getClientFloorMap());
            this.sendMessage(Message);
        }
Beispiel #11
0
        /// <summary>
        /// Sends the key of an error, whose description value is inside the external_texts of the client.
        /// </summary>
        /// <param name="localizedKey">The external_texts key of the error description.</param>
        public void sendLocalizedError(string localizedKey)
        {
            serverMessage Message = new serverMessage(33); // "@a"

            Message.Append(localizedKey);
            this.sendMessage(Message);
        }
Beispiel #12
0
        /// <summary>
        /// Gets the transactions (credit log) of a user on given user session and sends it to the session's game connection.
        /// </summary>
        /// <param name="Session">The Woodpecker.Sessions.Session object to get the transaction for and to send the message to.</param>
        public void sendTransactions(ref Session Session)
        {
            if (Session.User == null)
            {
                return;
            }

            serverMessage Message  = new serverMessage(209); // "CQ"
            Database      Database = new Database(false, true);

            Database.addParameterWithValue("userid", Session.User.ID);

            Database.Open();
            if (Database.Ready)
            {
                DataTable creditLogData = Database.getTable("SELECT moment,type,activity FROM users_creditlog WHERE userid = @userid LIMIT 50");
                foreach (DataRow dRow in creditLogData.Rows)
                {
                    DateTime Moment = (DateTime)dRow["moment"];
                    Message.appendTabbedValue(Moment.ToString("dd/MM/yyyy"));
                    Message.appendTabbedValue(Moment.ToString("hh:mm"));
                    Message.appendTabbedValue(dRow["activity"].ToString());
                    Message.appendTabbedValue("0");
                    Message.appendTabbedValue("");
                    Message.Append(dRow["type"].ToString());
                    Message.appendChar(13);
                }
            }

            Session.gameConnection.sendMessage(Message);
        }
Beispiel #13
0
        /// <summary>
        /// Broadcoasts the removal of a wall item to all room users.
        /// </summary>
        /// <param name="itemID">The database ID of the wall item that is removed.</param>
        private void broadcoastWallItemRemoval(int itemID)
        {
            serverMessage Message = new serverMessage(84); // "AT"

            Message.Append(itemID);
            this.sendMessage(Message);
        }
Beispiel #14
0
        /// <summary>
        /// 56 - "@x"
        /// </summary>
        public void WHISPER()
        {
            roomUser Me = Session.roomInstance.getRoomUser(Session.ID);

            if (!Me.isMuted)
            {
                string whisperBody  = Request.getParameter(0);
                string receiverName = whisperBody.Substring(0, whisperBody.IndexOf(' '));
                string Text         = whisperBody.Substring(receiverName.Length + 1);
                stringFunctions.filterVulnerableStuff(ref Text, true);

                serverMessage Whisper = new serverMessage(25); // "@Y"
                Whisper.appendWired(Me.ID);
                Whisper.appendClosedValue(Text);

                Session.gameConnection.sendMessage(Whisper);
                if (receiverName.Length > 0 && receiverName != Session.User.Username)
                {
                    roomUser Receiver = Session.roomInstance.getRoomUser(receiverName);
                    if (Receiver != null)
                    {
                        Receiver.Session.gameConnection.sendMessage(Whisper);
                    }
                    ObjectTree.Game.Moderation.addChatMessageToLogStack(Session.ID, Session.User.ID, Session.roomID, Receiver.Session.User.ID, chatType.whisper, ref Text);
                }
            }
        }
Beispiel #15
0
 /// <summary>
 /// Tries to send a game message (serverMessage object) to a user, catching & dumping any exceptions that occur.
 /// </summary>
 /// <param name="userID">The database ID of the user to send the message to.</param>
 /// <param name="Message">The message to send to the user as serverMessage object.</param>
 public void trySendGameMessage(int userID, serverMessage Message)
 {
     try
     {
         _userSessions[userID].gameConnection.sendMessage(Message);
     }
     catch { }
 }
Beispiel #16
0
        public void broadcastHotelAlert(string Text)
        {
            serverMessage hhCast = genericMessageFactory.createMessageBoxCast("Message from Hotel Management:<br>" + Text);

            this.broadcastMessage(hhCast);

            Logging.Log("Hotel Alert ('" + Text + "') sent to all online users.");
        }
Beispiel #17
0
        /// <summary>
        /// Broadcoasts the custom data update of a floor item to all room users.
        /// </summary>
        /// <param name="pItem">The floorItem instance of the updated floor item.</param>
        private void broadcoastFloorItemCustomDataUpdate(floorItem pItem)
        {
            serverMessage Message = new serverMessage(88); // "AX"

            Message.appendClosedValue(pItem.ID.ToString());
            Message.appendClosedValue(pItem.customData);
            Message.appendClosedValue(null); // TODO: pet interaction with toy/goodie
            this.sendMessage(Message);
        }
Beispiel #18
0
        /// <summary>
        /// Notifies all room users that a given room unit has left the room and releases the map spot for the room user.
        /// </summary>
        /// <param name="roomUnitID">The room unit ID of the room unit that has left the room.</param>
        /// <param name="mapX">The current X position of the room unit on the map.</param>
        /// <param name="mapY">The current Y position of the room unit on the map.</param>
        private void releaseRoomUnit(int roomUnitID, byte mapX, byte mapY)
        {
            serverMessage Message = new serverMessage(29); // "@]"

            Message.Append(roomUnitID);
            this.sendMessage(Message);

            this.gridUnit[mapX, mapY] = false;
        }
Beispiel #19
0
        public void sendShout(int sourceID, byte sourceX, byte sourceY, string Text)
        {
            serverMessage Message = new serverMessage(26); // "@Z"

            Message.appendWired(sourceID);
            Message.appendClosedValue(Text);

            sendMessage(Message);
            // TODO: head rotation
        }
Beispiel #20
0
        /// <summary>
        /// Refreshes the session user's game ticket amount. (message 124: A|)
        /// </summary>
        public void refreshTickets()
        {
            if (this.isHoldingUser)
            {
                serverMessage Message = new serverMessage(124); // "A|"
                Message.Append(this.User.Credits);

                this.gameConnection.sendMessage(Message);
            }
        }
Beispiel #21
0
        /// <summary>
        /// Retrieves the FUSE rights for the user on this session and sends it to the client.
        /// </summary>
        public void refreshFuseRights()
        {
            if (this.isHoldingUser)
            {
                serverMessage Message = new serverMessage(2); // "@B"
                Message.Append(Engine.Game.Roles.getRightsForRole(this.User.Role, this.User.hasClub));

                this.gameConnection.sendMessage(Message);
            }
        }
Beispiel #22
0
        /// <summary>
        /// Refreshes the session user's film amount for the camera. (message 4: @D)
        /// </summary>
        public void refreshFilm()
        {
            if (this.isHoldingUser)
            {
                serverMessage Message = new serverMessage(4); // "@D"
                Message.Append(this.User.Film);

                this.gameConnection.sendMessage(Message);
            }
        }
Beispiel #23
0
        /// <summary>
        /// Only works if the session user is in a room. If so, then a whisper with a given message is sent to the user only.
        /// </summary>
        /// <param name="Message">The text message to whisper to the user.</param>
        public void castWhisper(string sMessage)
        {
            if (this.inRoom)
            {
                serverMessage Message = new serverMessage(25); // "@Y"
                Message.appendWired(this.roomInstance.getSessionRoomUnitID(this.ID));
                Message.appendClosedValue(sMessage);

                this.gameConnection.sendMessage(Message);
            }
        }
Beispiel #24
0
 /// <summary>
 /// Sends a game message to a session. Tries to find the session for a given session ID. If the session is found and the session is ready, then the message is sent.
 /// </summary>
 /// <param name="sessionID">The ID of the session to send the message to.</param>
 /// <param name="Message">The Woodpecker.Net.Game.Messages.gameMessage to send.</param>
 public void sendGameMessage(uint sessionID, serverMessage Message)
 {
     if (mSessions.ContainsKey(sessionID))
     {
         Session Session = mSessions[sessionID];
         if (Session.isReady)
         {
             Session.gameConnection.sendMessage(Message);
         }
     }
 }
Beispiel #25
0
        /// <summary>
        /// Refreshes the session user's credit amount. (message 6: @F)
        /// </summary>
        public void refreshCredits()
        {
            if (this.isHoldingUser)
            {
                serverMessage Message = new serverMessage(6); // "@F"
                Message.Append(this.User.Credits);
                Message.Append(".0");

                this.gameConnection.sendMessage(Message);
            }
        }
Beispiel #26
0
        /// <summary>
        /// Refreshes the session user's game ticket amount. (message 124: A|)
        /// </summary>
        public void refreshTickets()
        {
            if (this.isHoldingUser)
            {
                this.User.updateValueables();

                serverMessage Message = new serverMessage(124); // "A|"
                Message.Append(this.User.Tickets);

                this.gameConnection.sendMessage(Message);
            }
        }
Beispiel #27
0
        /// <summary>
        /// 86 - "AV"
        /// </summary>
        public void CRYFORHELP()
        {
            string[] args     = Request.getMixedParameters();
            Database Database = new Database(false, false);

            Database.addParameterWithValue("userid", Session.User.ID);
            Database.addParameterWithValue("senderip", Session.ipAddress);
            Database.addParameterWithValue("msg", args[0]);
            Database.addParameterWithValue("roomid", Session.roomID);
            Database.addParameterWithValue("ip", Session.ipAddress);
            Database.addParameterWithValue("sended", DateTime.Now.ToString());
            Database.Open();
            string row  = "";
            string room = "";

            if (Database.Ready)
            {
                Database.runQuery("INSERT INTO callforhelp (id, sended, uid, rid, date, message, send_ip, pickedup, pickedup_person, pickedup_ip, pickedup_date) VALUES ('', @sended, @userid, @roomid, @msg, '" + DateTime.Now.ToString() + "', @senderip, '0', '', '', '')");
                row  = Database.getString("SELECT id FROM `callforhelp` ORDER BY `callforhelp`.`id` DESC LIMIT 1");
                room = Database.getString("SELECT roomname FROM `rooms` WHERE `id` = '" + Session.roomID + "' LIMIT 1");
                Database.Close();
            }

            ArrayList list = Engine.Game.Users.UserFuses("fuse_receive_calls_for_help");

            foreach (int x in list)
            {
                Session S = Engine.Game.Users.getUserSession(x);
                if (S == null)
                {
                    return;
                }
                serverMessage Message = new serverMessage();
                Message.Initialize(148);
                Message.Append(row);
                Message.appendChar(2);
                Message.Append("ISent: ");
                Message.Append(DateTime.Now.ToString());
                Message.appendChar(2);
                Message.Append(Session.User.Username);
                Message.appendChar(2);
                Message.Append(args[0]);
                Message.appendChar(2);
                Message.Append(Specialized.Encoding.wireEncoding.Encode(Session.roomID));
                Message.appendChar(2);
                Message.Append("Room: " + room);
                Message.appendChar(2);
                Message.Append("I");
                Message.appendChar(2);
                Message.Append(Specialized.Encoding.wireEncoding.Encode(Session.roomID));
                S.gameConnection.sendMessage(Message);
            }
        }
Beispiel #28
0
        public void broadcastMessage(serverMessage Message)
        {
            string sMessage = Message.ToString();

            lock (_userSessions)
            {
                foreach (Session lSession in _userSessions.Values)
                {
                    lSession.gameConnection.sendMessage(sMessage);
                }
            }
        }
Beispiel #29
0
        /// <summary>
        /// Modifies the hand page index with a given mode and sends the current hand page of this user.
        /// </summary>
        /// <param name="szMode">'How-to' modify the hand page index.</param>
        public void sendHandStrip(string szMode)
        {
            if (this.itemStripHandler != null)
            {
                this.itemStripHandler.changeHandStripPage(szMode); // Switch!

                serverMessage Message = new serverMessage(140);    // "BL"
                Message.Append(this.itemStripHandler.getHandItemCasts());
                Message.appendChar(13);
                Message.Append(this.itemStripHandler.handItemCount);

                this.gameConnection.sendMessage(Message);
            }
        }
Beispiel #30
0
        public void deliverItemsToSession(int userID, List <stripItem> Items, bool Refresh)
        {
            Session Receiver = ObjectTree.Game.Users.getUserSession(userID);

            if (Receiver != null) // Receiver was online
            {
                Receiver.itemStripHandler.addHandItems(Items);
                if (Refresh)
                {
                    serverMessage Message = new serverMessage(101); // "Ae"
                    Receiver.gameConnection.sendMessage(Message);
                }
            }
        }
Beispiel #31
0
        /// <summary>
        /// Refreshes the session user's club status.
        /// </summary>
        public void refreshClubStatus()
        {
            if (this.isHoldingUser)
            {
                serverMessage Message = new serverMessage(7); // "@G"
                Message.appendClosedValue("club_habbo");
                Message.appendWired(this.User.clubDaysLeft);
                Message.appendWired(this.User.clubMonthsExpired);
                Message.appendWired(this.User.clubMonthsLeft);
                Message.appendWired(true); // Hide/shows 'days left' label

                this.gameConnection.sendMessage(Message);
            }
        }
Beispiel #32
0
        public void broadcoastTeleportActivity(int itemID, string Username, bool disappearUser)
        {
            floorItem pItem = this.getFloorItem(itemID);
            if (pItem != null && pItem.Definition.Behaviour.isTeleporter)
            {
                serverMessage Message = new serverMessage();
                if (disappearUser)
                    Message.Initialize(89); // "AY"
                else
                    Message.Initialize(92); // "A\"
                Message.Append(pItem.ID);
                Message.Append("/");
                Message.Append(Username);
                Message.Append("/");
                Message.Append(pItem.Definition.Sprite);

                this.sendMessage(Message);
            }
        }
Beispiel #33
0
 /// <summary>
 /// Broadcoasts the removal of a floor item to all room users.
 /// </summary>
 /// <param name="itemID">The database ID of the floor item that is removed.</param>
 private void broadcoastFloorItemRemoval(int itemID)
 {
     serverMessage Message = new serverMessage(94); // "A^"
     Message.Append(itemID);
     this.sendMessage(Message);
 }
Beispiel #34
0
 /// <summary>
 /// Broadcoasts the removal of a wall item to all room users.
 /// </summary>
 /// <param name="itemID">The database ID of the wall item that is removed.</param>
 private void broadcoastWallItemRemoval(int itemID)
 {
     serverMessage Message = new serverMessage(84); // "AT"
     Message.Append(itemID);
     this.sendMessage(Message);
 }
Beispiel #35
0
 /// <summary>
 /// Broadcoasts the state update of a given wall item to all active room users.
 /// </summary>
 /// <param name="pItem">The wallItem instance of the wall item that is updated.</param>
 private void broadcoastWallItemStateUpdate(wallItem pItem)
 {
     serverMessage Message = new serverMessage(85); // "AU"
     Message.Append(pItem.ToString());
     this.sendMessage(Message);
 }
Beispiel #36
0
 public void broadcoastHeightmap()
 {
     serverMessage Message = new serverMessage(31); // "@_"
     Message.Append(this.getClientFloorMap());
     this.sendMessage(Message);
 }
Beispiel #37
0
 /// <summary>
 /// Broadcoasts the custom data update of a floor item to all room users.
 /// </summary>
 /// <param name="pItem">The floorItem instance of the updated floor item.</param>
 private void broadcoastFloorItemCustomDataUpdate(floorItem pItem)
 {
     serverMessage Message = new serverMessage(88); // "AX"
     Message.appendClosedValue(pItem.ID.ToString());
     Message.appendClosedValue(pItem.customData);
     Message.appendClosedValue(null); // TODO: pet interaction with toy/goodie
     this.sendMessage(Message);
 }
Beispiel #38
0
        /// <summary>
        /// Broacoasts the placement of a floor item to all room users.
        /// </summary>
        /// <param name="pItem">The floorItem instance of the wall item that is placed.</param>
        /// <param name="isPlacement">True if this item is new in the room, false otherwise.</param>
        private void broadcoastFloorItemMove(floorItem pItem, bool isPlacement)
        {
            serverMessage Message = new serverMessage();
            if (isPlacement)
                Message.Initialize(93); // "A]"
            else
                Message.Initialize(95); // "A_"
            Message.Append(pItem.ToString());

            this.sendMessage(Message);
        }
Beispiel #39
0
        private void operateTeleporter(uint sessionID, int itemID)
        {
            floorItem pItem = this.getFloorItem(itemID);
            if (pItem != null && pItem.Definition.Behaviour.isTeleporter) // Valid item
            {
                Thread.Sleep(550); // Wait for room worker thread to locate user into teleporter
                roomUser pUser = this.getRoomUser(sessionID);

                if (pUser != null && pUser.X == pItem.X && pUser.Y == pItem.Y) // In teleporter
                {
                    int roomID = ObjectTree.Game.Items.getTeleporterRoomID(pItem.teleporterID);
                    if (roomID == 0)
                        return;

                    pUser.Clamped = true;
                    this.broadcoastTeleportActivity(pItem.ID, pUser.Session.User.Username, true);
                    this.gridUnit[pItem.X, pItem.Y] = false; // Unblock teleporter

                    if (roomID == this.roomID)
                    {
                        Thread.Sleep(500);
                        floorItem pTeleporter2 = this.getFloorItem(pItem.teleporterID);
                        pUser.X = pTeleporter2.X;
                        pUser.Y = pTeleporter2.Y;
                        pUser.Z = pTeleporter2.Z;
                        pUser.rotationHead = pTeleporter2.Rotation;
                        pUser.rotationBody = pTeleporter2.Rotation;
                        this.gridUnit[pUser.X, pUser.Y] = true; // Block teleporter 2

                        this.broadcoastTeleportActivity(pTeleporter2.ID, pUser.Session.User.Username, false);
                        pUser.Clamped = false;
                        pUser.requiresUpdate = true;
                    }
                    else
                    {
                        pUser.Session.authenticatedFlat = roomID;
                        pUser.Session.authenticatedTeleporter = pItem.teleporterID;

                        serverMessage Message = new serverMessage(62); // "@~"
                        Message.appendWired(pItem.teleporterID);
                        Message.appendWired(roomID);
                        pUser.Session.gameConnection.sendMessage(Message);
                    }
                }
            }
        }
Beispiel #40
0
 /// <summary>
 /// Broacoasts the placement of a wall item to all room users.
 /// </summary>
 /// <param name="pItem">The wallItem instance of the wall item that is placed.</param>
 private void broadcoastWallItemPlacement(wallItem pItem)
 {
     serverMessage Message = new serverMessage(83); // "AS"
     Message.Append(pItem.ToString());
     this.sendMessage(Message);
 }