Beispiel #1
0
    internal static void Execute(object msg, NetConnection conn, NetworkSystem networkSystem)
    {
        Msg_RC_DebugSpaceInfo targetmsg = msg as Msg_RC_DebugSpaceInfo;

        if (null == targetmsg)
        {
            return;
        }
    }
 private void TickDebugSpaceInfo()
 {
     if (GlobalVariables.Instance.IsDebug)
     {
         bool needDebug = false;
         foreach (User user in m_Room.RoomUsers)
         {
             if (user.IsDebug)
             {
                 needDebug = true;
                 break;
             }
         }
         if (needDebug)
         {
             Msg_RC_DebugSpaceInfo builder = new Msg_RC_DebugSpaceInfo();
             for (LinkedListNode <UserInfo> linkNode = UserManager.Users.FirstValue; null != linkNode; linkNode = linkNode.Next)
             {
                 UserInfo info = linkNode.Value;
                 Msg_RC_DebugSpaceInfo.DebugSpaceInfo infoBuilder = new Msg_RC_DebugSpaceInfo.DebugSpaceInfo();
                 infoBuilder.obj_id    = info.GetId();
                 infoBuilder.is_player = true;
                 infoBuilder.pos_x     = (float)info.GetMovementStateInfo().GetPosition3D().X;
                 infoBuilder.pos_z     = (float)info.GetMovementStateInfo().GetPosition3D().Z;
                 infoBuilder.face_dir  = (float)info.GetMovementStateInfo().GetFaceDir();
                 builder.space_infos.Add(infoBuilder);
             }
             for (LinkedListNode <NpcInfo> linkNode = NpcManager.Npcs.FirstValue; null != linkNode; linkNode = linkNode.Next)
             {
                 NpcInfo info = linkNode.Value;
                 Msg_RC_DebugSpaceInfo.DebugSpaceInfo infoBuilder = new Msg_RC_DebugSpaceInfo.DebugSpaceInfo();
                 infoBuilder.obj_id    = info.GetId();
                 infoBuilder.is_player = false;
                 infoBuilder.pos_x     = (float)info.GetMovementStateInfo().GetPosition3D().X;
                 infoBuilder.pos_z     = (float)info.GetMovementStateInfo().GetPosition3D().Z;
                 infoBuilder.face_dir  = (float)info.GetMovementStateInfo().GetFaceDir();
                 builder.space_infos.Add(infoBuilder);
             }
             foreach (User user in m_Room.RoomUsers)
             {
                 if (user.IsDebug)
                 {
                     user.SendMessage(builder);
                 }
             }
         }
     }
 }
Beispiel #3
0
    internal static void Execute(object msg, NetConnection conn)
    {
        Msg_RC_DebugSpaceInfo targetmsg = msg as Msg_RC_DebugSpaceInfo;

        if (null == targetmsg)
        {
            return;
        }

        EntityViewModelManager.Instance.MarkSpaceInfoViews();
        if (GlobalVariables.Instance.IsDebug)
        {
            for (int i = 0; i < targetmsg.space_infos.Count; i++)
            {
                Msg_RC_DebugSpaceInfo.DebugSpaceInfo info = targetmsg.space_infos[i];
                EntityViewModelManager.Instance.UpdateSpaceInfoView(info.obj_id, info.is_player, info.pos_x, 0, info.pos_z, info.face_dir);
            }
        }
        EntityViewModelManager.Instance.DestroyUnusedSpaceInfoViews();
    }