Magic World game server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

113 lines
2.7 KiB

#pragma once
#include <Ice/BuiltinSequences.ice>
#include <Glacier2/Session.ice>
#include <MW.ice>
module MW
{
/**
*
* The MWRoomCallback interface is the interface that clients implement
* as their callback object.
*
* The server calls operations of this interface to communicate
* with connected clients.
*
**/
interface MWMapCallback
{
/**
*
* The server invokes this operation when the client sets the callback
* for a session. This provides the client with the initial list of users
* currently in the MW room.
*
* @param users The names of users currently in the MW room.
*
**/
void init(Ice::StringSeq users);
/**
*
* The server invokes this operation to deliver a message
* that was sent to the MW room.
*
* @param name The name of the user that send the message.
*
* @param message The contents of the message.
*
* @param timestamp The time at which the message was sent.
*
**/
void send(long timestamp, string name, string message);
/**
*
* The server invokes this operation when a user joins
* the MW room.
*
* @param name The name of the user that joined the MW room.
*
* @param timestamp The time at which the user joined the MW room.
*
**/
void join(long timestamp, string name);
/**
*
* The servers invokes this operation when a user leaves
* the MW room.
*
* @param name The name of the user that left the MW room.
*
* @param timestamp The time at which the user left the MW room.
*
**/
void leave(long timestamp, string name);
}
/**
*
* A MWSession is a custom Glacier2::Session for clients that use
* Glacier2 and support callbacks (such as C++, C# and clients).
*
* @see Glacier2::Session
*
**/
interface MWSession extends Glacier2::Session
{
/**
*
* The setCallback operation is called by clients to set the
* callback used to receive notification of activity in the
* room. Clients receive notifications as soon as they call this
* operation (before setCallback returns).
*
* The first callback made by the server is a call to
* MWRoomCallback::init, which delivers the current list of
* users to the client.
*
* @param cb The callback the server uses to deliver notifications.
*
* @see MWRoomCallback
*
**/
void setCallback(MWMapCallback* cb);
/**
*
* Send a message to the MW room.
*
* @param message The message to be sent.
*
* @return The time at which the message is sent.
*
* @throws InvalidMessageException should the message be invalid.
*
**/
long send(string message) throws InvalidMessageException;
}
}