📄 sessionservicermiimpl.java
字号:
/*
* SessionServiceRMIImpl.java
*
* Created on 17 pa焏ziernik 2005, 21:48
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
package net.sf.jawp.gf.server.rmi;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.Collection;
import net.sf.jawp.gf.api.domain.GameOptions;
import net.sf.jawp.gf.api.domain.GameWorld;
import net.sf.jawp.gf.api.domain.Player;
import net.sf.jawp.gf.api.domain.User;
import net.sf.jawp.gf.api.services.SessionService;
import net.sf.jawp.gf.api.services.rmi.SessionServiceRMI;
/**
*
* @author jarek
* @version $Revision: 1.5 $
*
* @param <GAMESERVICE> native game service
*/
public final class SessionServiceRMIImpl<GAMESERVICE> extends UnicastRemoteObject
implements SessionServiceRMI<GAMESERVICE>
{
/**
*
*/
private static final long serialVersionUID = 1L;
private final SessionService<GAMESERVICE> service;
/** Creates a new instance of SessionServiceRMIImpl */
public SessionServiceRMIImpl(final SessionService<GAMESERVICE> srv) throws RemoteException
{
this.service = srv;
}
public User getLoggedUser() throws RemoteException
{
return this.service.getLoggedUser();
}
public GameWorld createGame(final String name, final GameOptions options) throws RemoteException
{
return this.service.createGame( name, options);
}
public Collection<GameWorld> getGames() throws RemoteException
{
return this.service.getGames();
}
public Player joinGame(final long gameKey) throws RemoteException
{
return this.service.joinGame( gameKey);
}
public void quitGame(final long gameKey, final long playerKey) throws RemoteException
{
this.service.quitGame( gameKey, playerKey);
}
public Collection<Player> getUserPlayersForGame(final long gameKey) throws RemoteException
{
return this.service.getUserPlayersForGame( gameKey);
}
public Remote getGameServiceRemote(final long gameKey, final long playerKey) throws RemoteException
{
return this.service.getGameServiceRemote( gameKey, playerKey);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -