當前位置: 首頁>>代碼示例>>Java>>正文


Java PrivateMessageRequest類代碼示例

本文整理匯總了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);
}
 
開發者ID:macalimlim,項目名稱:kryonet-common,代碼行數:30,代碼來源:KryonetUtility.java

示例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);
}
 
開發者ID:macalimlim,項目名稱:kryonet-client,代碼行數:7,代碼來源:KryonetClient.java


注:本文中的net.dlogic.kryonet.common.request.PrivateMessageRequest類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。