Esempio n. 1
0
        public static ChatResponse createFriendLoggedOutResponse(chat.model.User user)
        {
            proto.User userDTO = new proto.User {
                Id = user.Id
            };
            ChatResponse response = new ChatResponse {
                Type = ChatResponse.Types.Type.FriendLoggedOut, User = userDTO
            };

            return(response);
        }
Esempio n. 2
0
        public static ChatRequest createLogoutRequest(chat.model.User user)
        {
            proto.User userDTO = new proto.User {
                Id = user.Id
            };
            ChatRequest request = new ChatRequest {
                Type = ChatRequest.Types.Type.Logout, User = userDTO
            };

            return(request);
        }
Esempio n. 3
0
        public static ChatRequest createLoginRequest(chat.model.User user)
        {
            //new proto.User {Id = user.Id, Passwd = user.Password};
            proto.User userDTO = new proto.User {
                Id = user.Id, Passwd = user.Password
            };
            ChatRequest request = new ChatRequest {
                Type = ChatRequest.Types.Type.Login, User = userDTO
            };

            return(request);
        }
Esempio n. 4
0
        public static ChatResponse createLoggedFriendsResponse(chat.model.User[] users)
        {
            ChatResponse response = new ChatResponse {
                Type = ChatResponse.Types.Type.GetLoggedFriends
            };

            foreach (chat.model.User user in users)
            {
                proto.User userDTO = new proto.User {
                    Id = user.Id
                };

                response.Friends.Add(userDTO);
            }

            return(response);
        }