Beispiel #1
0
        public void broadcastState(C2S_SubmitState c2s)
        {
            S2C_BroadcastState.BroadcastStateData s2c = new S2C_BroadcastState.BroadcastStateData();
            s2c.UserId   = c2s.UserId;
            s2c.action   = c2s.action;
            s2c.pos_x    = c2s.pos_x;
            s2c.pos_y    = c2s.pos_y;
            s2c.pos_z    = c2s.pos_z;
            s2c.rotate_y = c2s.rotate_y;

            RoomUserInfo roomUserInfo = getUser(c2s.UserId);

            if (roomUserInfo != null)
            {
                roomUserInfo.cmd = s2c;
            }
        }
Beispiel #2
0
        public void getUserState(ClientInfo clientInfo, C2S_GetUserState c2s)
        {
            S2C_GetUserState s2c = new S2C_GetUserState();

            s2c.Tag  = CSParam.NetTag.GetUserState.ToString();
            s2c.Code = (int)CSParam.CodeType.Ok;

            List <S2C_BroadcastState.BroadcastStateData> cmdList = new List <S2C_BroadcastState.BroadcastStateData>();

            for (int i = 0; i < c2s.userId_list.Count; i++)
            {
                RoomUserInfo roomUserInfo = getUser(c2s.userId_list[i]);
                if (roomUserInfo != null && roomUserInfo.cmd != null)
                {
                    cmdList.Add(roomUserInfo.cmd);
                }
            }
            s2c.list = cmdList;

            if (cmdList.Count > 0)
            {
                Socket_S.getInstance().Send(clientInfo, s2c);
            }
        }