~ubuntu-branches/ubuntu/natty/obby/natty

« back to all changes in this revision

Viewing changes to inc/host_buffer.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Philipp Kern
  • Date: 2007-04-29 13:07:09 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070429130709-lvzff5q3hff5iapv
Tags: 0.4.4-1
* New upstream release
* Dropped Debian-specific patches
* Tightened the net6 build-dependency
* Include the ChangeLog in the package

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
         */
84
84
        virtual void send_message(const std::string& message);
85
85
 
 
86
        /** Sends a message to the given user.
 
87
         */
 
88
        virtual void send_message(const std::string& message, const user& to);
 
89
 
86
90
        /** @brief Executes a command.
87
91
         */
88
92
        virtual void send_command(const command_query& query);
241
245
 
242
246
template<typename Document, typename Selector>
243
247
void basic_host_buffer<Document, Selector>::
 
248
        send_message(const std::string& message, const user& to)
 
249
{
 
250
        if(m_self == NULL)
 
251
        {
 
252
                throw std::logic_error(
 
253
                        "obby::host_buffer::send_message:\n"
 
254
                        "Local user is not available. This probably means "
 
255
                        "that the server has never been opened"
 
256
                );
 
257
        }
 
258
 
 
259
        // Send message from local user instead of server
 
260
        basic_server_buffer<Document, Selector>::send_message_impl(
 
261
                message,
 
262
                m_self,
 
263
                to
 
264
        );
 
265
}
 
266
 
 
267
template<typename Document, typename Selector>
 
268
void basic_host_buffer<Document, Selector>::
244
269
        send_command(const command_query& query)
245
270
{
246
271
        if(m_self == NULL)
384
409
typename basic_host_buffer<Document, Selector>::base_net_type*
385
410
basic_host_buffer<Document, Selector>::new_net()
386
411
{
387
 
        return new net_type(m_username, IPV6_ENABLED);
 
412
        return new net_type(m_username);
388
413
}
389
414
 
390
415
template<typename Document, typename Selector>