mud.server.corba
Class ServerImpl
java.lang.Object
org.omg.PortableServer.Servant
mud.common.idl.servers.ServerPOA
mud.server.corba.ServerImpl
- All Implemented Interfaces:
- ServerOperations, org.omg.CORBA.portable.InvokeHandler
public class ServerImpl
- extends ServerPOA
Implements the server, which maintains all administration of all game rooms
and users. Generated session ids are always lower than 1000.
- Author:
- Pieter van Ede, Tamar Christina
Field Summary |
static java.util.Random |
random
|
Constructor Summary |
ServerImpl(org.omg.CORBA.ORB orb,
int maxthreads)
|
Method Summary |
boolean |
action(int id,
int object_id,
int action_index)
|
boolean |
attack(int id)
|
void |
executeAndSend(Room room,
Event event)
|
ClientConnection[] |
getAllConnections()
|
ClientConnection[] |
getConnectionsByRoom(int roomId)
|
Room |
getRoomByUser(int userId)
|
User |
getUser(int userId)
|
char[][] |
getUsers(int id)
|
boolean |
isLoggedIn(int id)
|
int |
login(char[] uname,
char[] passw,
Client client)
|
void |
logout(int id)
|
static void |
main(java.lang.String[] args)
|
boolean |
move(int id,
int x,
int y)
|
void |
sendMessage(int id,
char[] message)
|
void |
sendMessage(int id,
java.lang.String format,
java.lang.Object... args)
|
void |
setPlayerRoom(Player player,
int roomId)
|
void |
setPlayerRoom(Player player,
int roomId,
int tx,
int ty,
Direction dir)
|
boolean |
useItem(int id,
int item_id)
|
Methods inherited from class org.omg.PortableServer.Servant |
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
random
public static java.util.Random random
ServerImpl
public ServerImpl(org.omg.CORBA.ORB orb,
int maxthreads)
throws java.lang.InstantiationException
- Throws:
java.lang.InstantiationException
main
public static void main(java.lang.String[] args)
throws java.io.IOException
- Throws:
java.io.IOException
login
public int login(char[] uname,
char[] passw,
Client client)
logout
public void logout(int id)
throws InvalidSecurityToken
- Throws:
InvalidSecurityToken
setPlayerRoom
public void setPlayerRoom(Player player,
int roomId)
setPlayerRoom
public void setPlayerRoom(Player player,
int roomId,
int tx,
int ty,
Direction dir)
sendMessage
public void sendMessage(int id,
char[] message)
sendMessage
public void sendMessage(int id,
java.lang.String format,
java.lang.Object... args)
executeAndSend
public void executeAndSend(Room room,
Event event)
move
public boolean move(int id,
int x,
int y)
throws InvalidSecurityToken
- Throws:
InvalidSecurityToken
action
public boolean action(int id,
int object_id,
int action_index)
throws InvalidSecurityToken
- Throws:
InvalidSecurityToken
attack
public boolean attack(int id)
throws InvalidSecurityToken
- Throws:
InvalidSecurityToken
useItem
public boolean useItem(int id,
int item_id)
throws InvalidSecurityToken
- Throws:
InvalidSecurityToken
isLoggedIn
public boolean isLoggedIn(int id)
getUser
public User getUser(int userId)
getRoomByUser
public Room getRoomByUser(int userId)
getAllConnections
public ClientConnection[] getAllConnections()
getConnectionsByRoom
public ClientConnection[] getConnectionsByRoom(int roomId)
getUsers
public char[][] getUsers(int id)
throws InvalidSecurityToken
- Throws:
InvalidSecurityToken