本文整理匯總了Java中net.dlogic.kryonet.common.request.PrivateMessageRequest類的典型用法代碼示例。如果您正苦於以下問題:Java PrivateMessageRequest類的具體用法?Java PrivateMessageRequest怎麽用?Java PrivateMessageRequest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PrivateMessageRequest類屬於net.dlogic.kryonet.common.request包,在下文中一共展示了PrivateMessageRequest類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: registerClasses
import net.dlogic.kryonet.common.request.PrivateMessageRequest; //導入依賴的package包/類
public static void registerClasses(EndPoint endpoint) {
Log.debug("KryonetUtility.registerClasses()");
//JDK classes
endpoint.getKryo().register(HashMap.class);
//Entity classes
endpoint.getKryo().register(User.class);
endpoint.getKryo().register(Room.class);
endpoint.getKryo().register(Room[].class);
endpoint.getKryo().register(RoomGroup.class);
//Request classes
endpoint.getKryo().register(GetRoomsRequest.class);
endpoint.getKryo().register(JoinRoomRequest.class);
endpoint.getKryo().register(LeaveRoomRequest.class);
endpoint.getKryo().register(LoginRequest.class);
endpoint.getKryo().register(LogoutRequest.class);
endpoint.getKryo().register(PrivateMessageRequest.class);
endpoint.getKryo().register(PublicMessageRequest.class);
//Response classes
endpoint.getKryo().register(ErrorResponse.class);
endpoint.getKryo().register(GetRoomsResponse.class);
endpoint.getKryo().register(JoinRoomFailureResponse.class);
endpoint.getKryo().register(JoinRoomSuccessResponse.class);
endpoint.getKryo().register(LeaveRoomResponse.class);
endpoint.getKryo().register(LoginFailureResponse.class);
endpoint.getKryo().register(LoginSuccessResponse.class);
endpoint.getKryo().register(LogoutResponse.class);
endpoint.getKryo().register(PrivateMessageResponse.class);
endpoint.getKryo().register(PublicMessageResponse.class);
}
示例2: sendPrivateMessageRequest
import net.dlogic.kryonet.common.request.PrivateMessageRequest; //導入依賴的package包/類
public void sendPrivateMessageRequest(User targetUser, String message) {
PrivateMessageRequest request = new PrivateMessageRequest();
request.targetUserId = targetUser.id;
request.message = message;
endpoint.sendTCP(request);
}