Files
2026-06-19 22:57:43 +02:00

175 lines
6.2 KiB
HTML

<!DOCTYPE html>
<html id="htmlId">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Coverage Report > IGameServer</title>
<style type="text/css">
@import "../../css/coverage.css";
@import "../../css/idea.min.css";
</style>
<script type="text/javascript" src="../../js/highlight.min.js"></script>
<script type="text/javascript" src="../../js/highlightjs-line-numbers.min.js"></script>
</head>
<body>
<div class="content">
<div class="breadCrumbs">
Current scope: <a href="../../index.html">all classes</a>
<span class="separator">|</span>
<a href="../index.html">it.polimi.ingsw.gc14.Network.RMI.Common</a>
</div>
<h1>Coverage Summary for Class: IGameServer (it.polimi.ingsw.gc14.Network.RMI.Common)</h1>
<table class="coverageStats">
<tr>
<th class="name">Class</th>
</tr>
<tr>
<td class="name">IGameServer</td>
</tr>
</table>
<br/>
<br/>
<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package it.polimi.ingsw.gc14.Network.RMI.Common;
&nbsp;
&nbsp;import it.polimi.ingsw.gc14.ErrorType;
&nbsp;
&nbsp;import java.rmi.*;
&nbsp;
&nbsp;/**
&nbsp; * Remote interface used by RMI clients to interact with the game server.
&nbsp; */
&nbsp;public interface IGameServer extends Remote {
&nbsp;
&nbsp; /**
&nbsp; * Adds a player to the game and registers the callback used by the server
&nbsp; * to notify the corresponding RMI client.
&nbsp; *
&nbsp; * @param username the username chosen by the player.
&nbsp; * @param preferredInt the desired number of players proposed by this client.
&nbsp; * @param callback the remote callback associated with the client.
&nbsp; * @return {@code null} if the player joins successfully;
&nbsp; * an {@link it.polimi.ingsw.gc14.ErrorType} value describing the rejection otherwise.
&nbsp; * @throws RemoteException if an RMI communication error occurs.
&nbsp; */
&nbsp; ErrorType joinGame(String username, int preferredInt, IClientCallback callback) throws RemoteException;
&nbsp;
&nbsp; /**
&nbsp; * Requests to draw a tribe card from the upper tribe card list.
&nbsp; *
&nbsp; * @param playerUsername the username of the player performing the action.
&nbsp; * @param pos the position of the selected card.
&nbsp; * @throws RemoteException if an RMI communication error occurs.
&nbsp; */
&nbsp; void drawUpperTribeCard(String playerUsername, int pos) throws RemoteException;
&nbsp;
&nbsp; /**
&nbsp; * Requests to draw a tribe card from the lower tribe card list.
&nbsp; *
&nbsp; * @param playerUsername the username of the player performing the action.
&nbsp; * @param pos the position of the selected card.
&nbsp; * @throws RemoteException if an RMI communication error occurs.
&nbsp; */
&nbsp; void drawLowerTribeCard(String playerUsername, int pos) throws RemoteException;
&nbsp;
&nbsp; /**
&nbsp; * Requests to draw a building card from the upper building card list.
&nbsp; *
&nbsp; * @param playerUsername the username of the player performing the action.
&nbsp; * @param pos the position of the selected card.
&nbsp; * @throws RemoteException if an RMI communication error occurs.
&nbsp; */
&nbsp; void drawUpperBuildingCard(String playerUsername, int pos) throws RemoteException;
&nbsp;
&nbsp; /**
&nbsp; * Requests to draw a building card from the lower building card list.
&nbsp; *
&nbsp; * @param playerUsername the username of the player performing the action.
&nbsp; * @param pos the position of the selected card.
&nbsp; * @throws RemoteException if an RMI communication error occurs.
&nbsp; */
&nbsp; void drawLowerBuildingCard(String playerUsername, int pos) throws RemoteException;
&nbsp;
&nbsp; /**
&nbsp; * Requests to skip the current player&#39;s optional action.
&nbsp; *
&nbsp; * @param playerUsername the username of the player skipping the action.
&nbsp; * @throws RemoteException if an RMI communication error occurs.
&nbsp; */
&nbsp; void skipTurn(String playerUsername) throws RemoteException;
&nbsp;
&nbsp; /**
&nbsp; * Requests to assign the specified player to a slot.
&nbsp; *
&nbsp; * @param playerUsername the username of the player making the slot choice.
&nbsp; * @param pos the position of the selected slot.
&nbsp; * @throws RemoteException if an RMI communication error occurs.
&nbsp; */
&nbsp; void slotChoice(String playerUsername, int pos) throws RemoteException;
&nbsp;
&nbsp; /**
&nbsp; * Requests to assign the selected totem to the specified player.
&nbsp; *
&nbsp; * @param playerUsername the username of the player making the totem choice.
&nbsp; * @param totems the name of the selected totem.
&nbsp; * @throws RemoteException if an RMI communication error occurs.
&nbsp; */
&nbsp; void totemChoice(String playerUsername, String totems) throws RemoteException;
&nbsp;
&nbsp; /**
&nbsp; * Heartbeat method called periodically by the client to signal
&nbsp; * that it is still connected.
&nbsp; *
&nbsp; * &lt;p&gt;This method mirrors the PING/PONG mechanism used in the TCP
&nbsp; * heartbeat channel.
&nbsp; *
&nbsp; * @param username the username of the client sending the heartbeat ping.
&nbsp; * @throws RemoteException if an RMI communication error occurs.
&nbsp; */
&nbsp; void ping(String username) throws RemoteException;
&nbsp;
&nbsp; /**
&nbsp; * Notifies the server of a voluntary disconnection for the specified player.
&nbsp; *
&nbsp; * @param username the username of the player disconnecting.
&nbsp; * @throws RemoteException if an RMI communication error occurs.
&nbsp; */
&nbsp; void disconnectPlayer(String username) throws RemoteException;
&nbsp;}
</code>
</pre>
</div>
<script type="text/javascript">
(function() {
var msie = false, msie9 = false;
/*@cc_on
msie = true;
@if (@_jscript_version >= 9)
msie9 = true;
@end
@*/
if (!msie || msie && msie9) {
hljs.highlightAll()
hljs.initLineNumbersOnLoad();
}
})();
</script>
<div class="footer">
<div style="float:right;">generated on 2026-06-19 22:53</div>
</div>
</body>
</html>