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); }
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); }
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); }
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); }