Пример #1
0
        private void roomUserManager_OnUserSays(object sender, UserSaysArgs e, out bool messageHandled)
        {
            RoomUser userSaying = e.user;
            string   message    = e.message;

            if ((!isOwnerOnly && canBeTriggered(message)) || (isOwnerOnly && userSaying.IsOwner() && canBeTriggered(message)))
            {
                // Send whisper to self
                ServerMessage servermsg = new ServerMessage();
                servermsg.Init(Outgoing.Whisp);
                servermsg.AppendInt32(userSaying.VirtualID);
                servermsg.AppendString(message);
                servermsg.AppendInt32(0);
                servermsg.AppendInt32(0);
                servermsg.AppendInt32(-1);

                userSaying.GetClient().SendMessage(servermsg);

                handler.RequestStackHandle(item.Coordinate, null, userSaying, Games.Team.none);
                handler.OnEvent(item.Id);

                messageHandled = true;
            }
            else
            {
                messageHandled = false;
            }
        }
Пример #2
0
 private void roomUserManager_OnBotTakeUser(object sender, EventArgs e)
 {
     RoomUser[] userArray = (RoomUser[])sender;
     if (userArray[0] != null && userArray[0].GetUsername().ToLower() == botname.ToLower())
     {
         handler.RequestStackHandle(item, null, userArray[1], userArray[1].team);
     }
 }
Пример #3
0
 private void gameManager_OnScoreChanged(object sender, TeamScoreChangedArgs e)
 {
     if (e.Points >= scoreLevel && !used)
     {
         used = true;
         handler.RequestStackHandle(item, null, e.user, e.Team);
     }
 }
Пример #4
0
        private void roomUserManager_OnBotTakeItem(object sender, EventArgs e)
        {
            var user = (RoomUser)sender;

            if (user != null && user.GetUsername().ToLower() == botname.ToLower())
            {
                handler.RequestStackHandle(item, null, null, Team.none);
            }
        }
Пример #5
0
        private void roomUserManager_OnUserEnter(object sender, EventArgs e)
        {
            var user = (RoomUser)sender;

            if ((!user.IsBot && isOneUser && !string.IsNullOrEmpty(userName) && user.GetUsername() == userName) || !isOneUser)
            {
                InteractorGenericSwitch.DoAnimation(item);
                handler.RequestStackHandle(item, null, user, user.team);
            }
        }
Пример #6
0
        private void roomUserManager_OnUserEnter(object sender, EventArgs e)
        {
            RoomUser user = (RoomUser)sender;

            if ((!user.IsBot && isOneUser && !string.IsNullOrEmpty(userName) && user.GetUsername() == userName) || !isOneUser)
            {
                handler.OnEvent(item.Id);
                handler.RequestStackHandle(item.Coordinate, null, user, Team.none);
            }
        }
Пример #7
0
        public bool OnCycle()
        {
            cycleCount++;

            if (cycleCount > ((cyclesRequired * 10) - 0.5))
            {
                handler.RequestStackHandle(item, null, null, Team.none);
                //InteractorGenericSwitch.DoAnimation(item);
                cycleCount = 0;
            }
            return(true);
        }
Пример #8
0
        public bool OnCycle()
        {
            cycleCount++;

            if (cycleCount > cyclesRequired)
            {
                handler.RequestStackHandle(item.Coordinate, null, null, Games.Team.none);
                handler.OnEvent(item.Id);
                cycleCount = 0;
            }
            return(true);
        }
Пример #9
0
        public bool OnCycle()
        {
            if (item.wiredEventUser.Count > 0)
            {
                for (int i = 0; i < item.wiredEventUser.Count; i++)
                {
                    handler.RequestStackHandle(item, null, item.wiredEventUser[i], Team.none);
                }

                item.wiredEventUser.Clear();
            }

            return(true);
        }
Пример #10
0
 public bool OnCycle()
 {
     if (requiredCycles > currentCycle)
     {
         handler.RequestStackHandle(item.Coordinate, null, null, Team.none);
         handler.OnEvent(item.Id);
         resetTimer();
         return(false);
     }
     else
     {
         currentCycle++;
         return(true);
     }
 }
Пример #11
0
 public bool OnCycle()
 {
     if (currentCycle > requiredCycles)
     {
         if (requestQueue.Count > 0)
         {
             lock (requestQueue.SyncRoot)
             {
                 while (requestQueue.Count > 0)
                 {
                     UserWalksFurniValue obj = (UserWalksFurniValue)requestQueue.Dequeue();
                     handler.RequestStackHandle(item.Coordinate, obj.item, obj.user, Games.Team.none);
                 }
             }
             handler.OnEvent(item.Id);
         }
         return(false);
     }
     else
     {
         currentCycle++;
         return(true);
     }
 }
Пример #12
0
        private void roomUserManager_OnUserSays(object sender, UserSaysArgs e, out bool messageHandled)
        {
            RoomUser userSaying = e.user;
            string   message    = e.message;

            if ((!isOwnerOnly && canBeTriggered(message)) || (isOwnerOnly && userSaying.IsOwner() && canBeTriggered(message)))
            {
                handler.RequestStackHandle(item.Coordinate, null, userSaying, Games.Team.none);
                handler.OnEvent(item.Id);
                messageHandled = true;
            }
            else
            {
                messageHandled = false;
            }
        }
Пример #13
0
        public bool OnCycle()
        {
            if (currentCycle == -1)
            {
                return(true);
            }

            if (requiredCycles <= currentCycle)
            {
                currentCycle = -1;
                handler.RequestStackHandle(item, null, null, Team.none);
            }
            else
            {
                currentCycle++;
            }
            return(true);
        }
Пример #14
0
        private bool roomUserManager_OnUserSays(object sender, UserSaysArgs e)
        {
            var userSaying = e.user;
            var message    = e.message;

            if (userSaying == null || userSaying.GetClient() == null || triggerMessage.Length == 0)
            {
                return(false);
            }

            if ((!isOwnerOnly && canBeTriggered(message)) || (isOwnerOnly && userSaying.IsOwner() && canBeTriggered(message)))
            {
                if (handler.RequestStackHandle(item, null, userSaying, e.user.team))
                {
                    userSaying.WhisperComposer(message, 0);
                    return(true);
                }
            }
            return(false);
        }
Пример #15
0
        private void targetItem_OnUserWalksOnFurni(object sender, UserWalksOnArgs e)
        {
            RoomItem onItem = (RoomItem)sender;

            if (onItem.GetBaseItem().IsSeat)
            {
                if (onItem.TotalHeight - onItem.GetBaseItem().Height != e.user.Z)
                {
                    return;
                }
            }
            else
            {
                if (onItem.TotalHeight != e.user.Z)
                {
                    return;
                }
            }

            handler.RequestStackHandle(item, (RoomItem)sender, e.user, e.user.team);
            //InteractorGenericSwitch.DoAnimation(item);
        }
Пример #16
0
 private void targetItem_OnUserWalksOffFurni(object sender, UserWalksOnArgs e)
 {
     handler.RequestStackHandle(item, (RoomItem)sender, e.user, e.user.team);
     InteractorGenericSwitch.DoAnimation(item);
 }
Пример #17
0
 private void gameManager_OnGameStart(object sender, EventArgs e)
 {
     handler.RequestStackHandle(item.Coordinate, null, null, Team.none);
     handler.OnEvent(item.Id);
 }
Пример #18
0
 private void onTrigger(ItemTriggeredArgs e)
 {
     handler.RequestStackHandle(item.Coordinate, e.TriggeringItem, e.TriggeringUser, Games.Team.none);
     handler.OnEvent(item.Id);
 }
Пример #19
0
 private void gameManager_OnGameEnd(object sender, EventArgs e)
 {
     handler.RequestStackHandle(item, null, null, Team.none);
     //InteractorGenericSwitch.DoAnimation(item);
 }
Пример #20
0
 private void onTrigger(ItemTriggeredArgs e)
 {
     handler.RequestStackHandle(item, e.TriggeringItem, e.TriggeringUser, Team.none);
     //InteractorGenericSwitch.DoAnimation(item);
 }