Exemple #1
0
 private void NotifyClientSetStuffChange(int itemId, string data)
 {
     ClientMessage mMessage = new ClientMessage();
     mMessage.Init(88); //AX
     mMessage.appendString(itemId.ToString());
     mMessage.appendChar(2);
     mMessage.appendString(data);
     mMessage.appendChar(2);
     mRoomInstance.RoomBroadcast(mMessage);
 }
Exemple #2
0
 private void NotifyClientSetStuffTempOpen(int itemId)
 {
     ClientMessage mMessage = new ClientMessage();
     mMessage.Init(88); //AX
     mMessage.appendString(itemId.ToString());
     mMessage.appendChar(2);
     mMessage.appendString("TRUE");
     mMessage.appendChar(2);
     mRoomInstance.RoomBroadcast(mMessage);
     mMessage.Init(88); //AX
     mMessage.appendString(itemId.ToString());
     mMessage.appendChar(2);
     mMessage.appendString("FALSE");
     mMessage.appendChar(2);
     new RoomInstance.RoomDelayBroadcastDelegate(mRoomInstance.RoomDelayBroadcast).BeginInvoke(mMessage, 1000, null, null);
 }
Exemple #3
0
        public void RequestOpenPresent(int userId, int presentId, Users.UserInfo userInfo, long sessionId)
        {
            if (ContainsItem(presentId))
            {
                FurniInfo furni = GetFurniObject(presentId);

                if (furni != null)
                {
                    if (furni.Flags.Gift)
                    {

                        GiftInfo gift = InstanceManager.Game.Furni.GetGift(presentId);
                        int newId = 0;
                        InstanceManager.Game.Catalogue.BuyItem("0", gift.PurchaseCode, gift.Payload, ref userInfo, true, ref newId);
                        InstanceManager.Game.Furni.DeleteGift(presentId);

                        InstanceManager.Game.Furni.DeleteFurni(presentId);
                        mFloorFurni = InstanceManager.Game.Furni.GetRoomFloorFurni(mRoomInstance.RoomInfo.RoomID);
                        FurniInfo info = InstanceManager.Game.Furni.GetFurni(newId);

                        ClientMessage mMessage = new ClientMessage();
                        mMessage.Init(129); //BA
                        mMessage.appendString(info.FurniSprite);
                        mMessage.appendChar(13);
                        mMessage.appendString(info.FurniSprite);

                        if (info.Flags.WallItem)
                        {
                            mMessage.appendString(" ");
                            mMessage.appendString(info.Col);
                            mMessage.appendChar(13);
                        }
                        else
                        {
                            mMessage.appendChar(13);
                            mMessage.appendInt(info.L);

                            mMessage.appendChar(13);
                            mMessage.appendInt(info.W);

                            mMessage.appendChar(13);
                            mMessage.appendString(info.Col);
                        }

                        mRoomInstance.SendMessage(mMessage, sessionId);

                        mMessage.Init(94); // A^
                        mMessage.appendInt(presentId);
                        mRoomInstance.RoomBroadcast(mMessage);

                        GenerateMaps();

                        mMessage.Init(31); //@_
                        mMessage.appendString(ClientMap);
                        mRoomInstance.RoomBroadcast(mMessage);

                    }
                }
            }
        }
Exemple #4
0
        public void RequestChangeStickyData(int itemId, string newMessage, int newItemType, long sessionId)
        {
            if (ContainsItem(itemId))
            {
                FurniInfo info = GetFurniObject(itemId);

                if (info != null)
                {
                    if (info.Flags.StickyNote)
                    {
                        if (newItemType > 0) InstanceManager.Game.Furni.SetItemType(itemId, newItemType);

                        if (newMessage.Length > 685) newMessage = newMessage.Substring(0, 685);
                        newMessage = SpecialFiltering.FilterChars("2,9,47", newMessage);

                        InstanceManager.Game.Furni.SetStuffDataFloorItem(itemId, newMessage);

                        mWallFurni = InstanceManager.Game.Furni.GetRoomWallFurni(mRoomInstance.RoomInfo.RoomID);
                        info = GetFurniObject(itemId);

                        ClientMessage message = new ClientMessage();
                        message.Init(85); //AU
                        message.appendInt(itemId);
                        message.appendChar(9);
                        message.appendString(info.FurniSprite);
                        message.appendChar(9);
                        message.appendString(" ");
                        message.appendString(info.WallLocation);
                        message.appendChar(9);
                        message.appendString(info.Col);
                        mRoomInstance.RoomBroadcast(message);
                    }
                }
            }
        }
 private void WhisperResponse(string response, long sessionid)
 {
     if (sessionid > 0)
     {
         int roomId = InstanceManager.Sessions.GetSession(sessionid).mRoomID;
         if (roomId > 0)
         {
             int roomUser = InstanceManager.Game.Rooms.GetRoomInstance(roomId).GetUser(sessionid).RoomUserID;
             ClientMessage mMessage = new ClientMessage();
             mMessage.Init(25); //@Y
             mMessage.appendString(ArgumentEncoding.encodeInt(roomUser));
             mMessage.appendString(response);
             mMessage.appendChar(2);
             InstanceManager.Game.Rooms.GetRoomInstance(roomId).SendMessage(mMessage, sessionid);
         }
     }
 }
Exemple #6
0
        private void UpdateRollerUser(RoomUser user, int newX, int newY, float newZ, bool isLastRoller, int rollerId)
        {
            user.NextX = newX;
            user.NextY = newY;
            user.NextZ = newZ;

            ClientMessage mMessage = new ClientMessage();
            mMessage.Init(230); // Cf
            mMessage.appendArgumentInt(user.CurrentX);
            mMessage.appendArgumentInt(user.CurrentY);

            mMessage.appendArgumentInt(user.NextX);
            mMessage.appendArgumentInt(user.NextY);

            mMessage.appendArgumentInt(0);

            mMessage.appendArgumentInt(rollerId);

            mMessage.appendString("J");

            mMessage.appendArgumentInt(user.RoomUserID);

            mMessage.appendString(user.CurrentZ.ToString().Replace(',', '.'));
            mMessage.appendChar(2);
            mMessage.appendString(user.NextZ.ToString().Replace(',', '.'));
            mMessage.appendChar(2);

            mRollerBroadcast.Append(mMessage.ToString());

            mPlayerMap[user.CurrentX, user.CurrentY] = false;
            user.CurrentX = user.NextX;
            user.CurrentY = user.NextY;
            user.CurrentZ = user.NextZ;
            user.MustUpdate = true;
            mPlayerMap[user.CurrentX, user.CurrentY] = true;

            if (isLastRoller)
            {
                CalculateTileStatusForUser(user.CurrentX, user.CurrentY, user, true);
            }
        }
Exemple #7
0
        private void UpdateRollerFurni(FurniInfo info, int nextX, int nextY, float nextZ, bool isLastRoller, int rollerId)
        {
            ClientMessage mMessage = new ClientMessage();
            mMessage.Init(230); // Cf
            mMessage.appendArgumentInt(info.PosX);
            mMessage.appendArgumentInt(info.PosY);

            mMessage.appendArgumentInt(nextX);
            mMessage.appendArgumentInt(nextY);

            mMessage.appendArgumentInt(1);

            mMessage.appendArgumentInt(info.FurniID);

            mMessage.appendString(info.PosZ.ToString().Replace(',', '.'));
            mMessage.appendChar(2);
            mMessage.appendString(nextZ.ToString().Replace(',', '.'));
            mMessage.appendChar(2);

            mMessage.appendArgumentInt(rollerId);

            mRollerBroadcast.Append(mMessage.ToString());

            info.PosX = nextX;
            info.PosY = nextY;
            info.PosZ = nextZ;
            InstanceManager.Game.Furni.MoveFloorItem(info.FurniID, info.PosX, info.PosY, info.PosZ, info.PosRotation, mRoomInstance.RoomInfo);
        }