Пример #1
0
        public void Handle(NetworkManager nm, Bot core)
        {
            if (!core.Entities.ContainsKey(PlayerId) && PlayerId != -1) {
                core.RaiseErrorMessage("Protocol Warning: Teleported non-existant player");
                return;
            }

            if (PlayerId != -1) {
                core.Entities[PlayerId].UpdateLocation(X, Y, Z);
                core.Entities[PlayerId].UpdateLook(Yaw, Pitch);
                core.RaisePlayerMoved(core.Entities[PlayerId]);
                return;
            }

            core.Location.X = X;
            core.Location.Y = Y;
            core.Location.Z = Z;
            core.Position[0] = Yaw;
            core.Position[1] = Pitch;
            core.RaiseYouMoved();
            core.raiseDebugMessage("Set location via Teleport.");
        }
Пример #2
0
        public void Handle(NetworkManager nm, Bot core)
        {
            if (!core.Entities.ContainsKey(PlayerId)) {
                core.RaiseErrorMessage("Protocol Warning: Updated position of non-existant player");
                return;
            }

            var myEntity = core.Entities[PlayerId];

            if (PlayerId != -1) {
                myEntity.UpdateLocation((short)(myEntity.Location.X + ChangeX), (short)(myEntity.Location.Y + ChangeY), (short)(myEntity.Location.Z + ChangeZ));
                core.RaisePlayerMoved(myEntity);
            }

            core.Location.X += ChangeX;
            core.Location.Y += ChangeY;
            core.Location.Z += ChangeZ;
            core.RaiseYouMoved();
        }
Пример #3
0
        public void Handle(NetworkManager nm, Bot core)
        {
            if (!core.Entities.ContainsKey(PlayerId)) {
                core.RaiseErrorMessage("Protocol Warning: Updated orientation of non-existant player");
                return;
            }

            var myEntity = core.Entities[PlayerId];

            if (PlayerId != -1) {
                myEntity.UpdateLook(Yaw, Pitch);
                core.RaisePlayerMoved(myEntity);
                return;

            }

            core.Position[0] = Yaw;
            core.Position[1] = Pitch;
            core.RaiseYouMoved();
        }