public UInt32 Send_QueryDisconnectBattle( ) { UInt64 destID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 srcID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 conid = 0; GetSendID(ref destID, ref srcID, ref conid); if (destID == mln.ProcessUnitManager.INVALID_PUUID) { mln.Utility.MLN_TRACE_LOG("Fail : GetSendID"); return(0); } // if( srcID == ProcessUnitManager::INVALID_PUUID ) return 0; UInt32 totalSize = 0; //RPCPRINT( fprintf(stderr, "Send_QueryDisconnectBattle: start") ); // check send size // Check size OK mln.EndianStream sendEs = new mln.EndianStream(mln.EndianStream.STREAM_ENDIAN.STREAM_ENDIAN_LITTLE); // little endian mln.PACKET_HEADER sendHead; sendHead.type = (UInt32)Battle_FuncID.ID_QUERYDISCONNECTBATTLE; sendHead.dadr = (UInt64)((UInt64)0 << 32 | (UInt64)INTFID.BATTLE); sendHead.sadr = conid; sendHead.size = (UInt16)totalSize; // serialize sendHead.put(sendEs); // serialize head //RPCPRINT( "Send_QueryDisconnectBattle: size %d done", totalSize ); // send done RPCSendPUBase(sendEs, destID, srcID); // finish ClearSendID(); return(totalSize); }
/* * 受信メイン ここは自動作成 */ public override UInt32 RPC_RecvBase(mln.EndianStream es, UInt32 type, UInt32 intf, UInt16 sz, UInt64 conid) { UInt32 ret = 0; switch (intf) { case (UInt32)INTFID.BATTLE: { ret = Receive_Battle(conid, type, sz, es); } break; case (UInt32)INTFID.BATTLEPULIST: { ret = Receive_BattlePuList(conid, type, sz, es); } break; case (UInt32)INTFID.MATCHING: { ret = Receive_Matching(conid, type, sz, es); } break; default: { mln.Utility.MLN_TRACE_LOG("Error:"); } break; } return(ret); }
// get from stream static public UInt32 get(mln.EndianStream rEs, out AppointmentResult rOut) { UInt32 ret = 0; rEs.get(out ret); rOut = (AppointmentResult)ret; return(4); }
// get from stream static public UInt32 get(mln.EndianStream rEs, out BattleStatus rOut) { UInt32 ret = 0; rEs.get(out ret); rOut = (BattleStatus)ret; return(4); }
public static UInt32 set(mln.EndianStream rEs, BattleRoomInfo _rIn) { UInt32 ofs = 0; // STRUCT TYPE ofs += BattlePuInfo.set(rEs, _rIn.pu_info); // STRUCT TYPE ofs += BattleStatusInfo.set(rEs, _rIn.status_info); return(ofs); }
public UInt32 Send_UpdateRoomInfoResult(BattleRoomInfo[] room_info, UInt32 room_info_len) { UInt64 destID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 srcID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 conid = 0; GetSendID(ref destID, ref srcID, ref conid); if (destID == mln.ProcessUnitManager.INVALID_PUUID) { mln.Utility.MLN_TRACE_LOG("Fail : GetSendID"); return(0); } // if( srcID == ProcessUnitManager::INVALID_PUUID ) return 0; UInt32 totalSize = 0; //RPCPRINT( fprintf(stderr, "Send_UpdateRoomInfoResult: start") ); // check send size totalSize += 4; // array num if (room_info_len > (UInt32)BattlePuListMaxValues.SEND_UPDATEROOMINFORESULT_ROOM_INFO_LEN_MAX) { return(0); // room_info is over size } //if( room_info.Length < room_info_len ) return 0; // room_info is over size // STRUCT TYPE for (UInt32 __ind = 0; __ind < room_info_len; __ind++) { totalSize += BattleRoomInfo.length(room_info[__ind]); } //if( totalSize > left ) ERROR_RETURN(0); // Check size OK mln.EndianStream sendEs = new mln.EndianStream(mln.EndianStream.STREAM_ENDIAN.STREAM_ENDIAN_LITTLE); // little endian mln.PACKET_HEADER sendHead; sendHead.type = (UInt32)BattlePuList_FuncID.ID_UPDATEROOMINFORESULT; sendHead.dadr = (UInt64)((UInt64)0 << 32 | (UInt64)INTFID.BATTLEPULIST); sendHead.sadr = conid; sendHead.size = (UInt16)totalSize; // serialize sendHead.put(sendEs); // serialize head sendEs.put(room_info_len); // STRUCT TYPE for (UInt32 __ind = 0; __ind < room_info_len; __ind++) { BattleRoomInfo.set(sendEs, room_info[__ind]); } //RPCPRINT( "Send_UpdateRoomInfoResult: size %d done", totalSize ); // send done RPCSendPUBase(sendEs, destID, srcID); // finish ClearSendID(); return(totalSize); }
public static UInt32 get(mln.EndianStream rEs, BattleStatusInfo _rOut) { UInt32 ofs = 0; // BASIC TYPE rEs.get(out _rOut.entered_num); ofs += 1; // BASIC TYPE rEs.get(out _rOut.max_enter_num); ofs += 1; // BASIC TYPE rEs.get(out _rOut.status); ofs += 1; return(ofs); }
public static UInt32 set(mln.EndianStream rEs, BattleStatusInfo _rIn) { UInt32 ofs = 0; // BASIC TYPE rEs.put(_rIn.entered_num); ofs += 1; // BASIC TYPE rEs.put(_rIn.max_enter_num); ofs += 1; // BASIC TYPE rEs.put(_rIn.status); ofs += 1; return(ofs); }
public static UInt32 get(mln.EndianStream rEs, BattlePuInfo _rOut) { UInt32 ofs = 0; // STRING TYPE ofs += mln.cRPC_ID.GetStringFromStream(out _rOut.ip_addr, rEs, out _rOut.ip_addr_strlen); // BASIC TYPE rEs.get(out _rOut.port); ofs += 2; // BASIC TYPE rEs.get(out _rOut.room_hub_pu_uid); ofs += 8; // BASIC TYPE rEs.get(out _rOut.battle_pu_uid); ofs += 8; return(ofs); }
public static UInt32 set(mln.EndianStream rEs, BattlePuInfo _rIn) { UInt32 ofs = 0; // STRING TYPE ofs += mln.cRPC_ID.SetStringToStream(_rIn.ip_addr, rEs, _rIn.ip_addr_strlen); // BASIC TYPE rEs.put(_rIn.port); ofs += 2; // BASIC TYPE rEs.put(_rIn.room_hub_pu_uid); ofs += 8; // BASIC TYPE rEs.put(_rIn.battle_pu_uid); ofs += 8; return(ofs); }
public UInt32 Send_EnterMatchingRoom(UInt64 character_id, UInt32 matching_rule, UInt32 matching_value) { UInt64 destID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 srcID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 conid = 0; GetSendID(ref destID, ref srcID, ref conid); if (destID == mln.ProcessUnitManager.INVALID_PUUID) { mln.Utility.MLN_TRACE_LOG("Fail : GetSendID"); return(0); } // if( srcID == ProcessUnitManager::INVALID_PUUID ) return 0; UInt32 totalSize = 0; //RPCPRINT( fprintf(stderr, "Send_EnterMatchingRoom: start") ); // check send size // BASIC TYPE totalSize += (8); //if( totalSize > left ) ERROR_RETURN(0); // BASIC TYPE totalSize += (4); //if( totalSize > left ) ERROR_RETURN(0); // BASIC TYPE totalSize += (4); //if( totalSize > left ) ERROR_RETURN(0); // Check size OK mln.EndianStream sendEs = new mln.EndianStream(mln.EndianStream.STREAM_ENDIAN.STREAM_ENDIAN_LITTLE); // little endian mln.PACKET_HEADER sendHead; sendHead.type = (UInt32)Matching_FuncID.ID_ENTERMATCHINGROOM; sendHead.dadr = (UInt64)((UInt64)0 << 32 | (UInt64)INTFID.MATCHING); sendHead.sadr = conid; sendHead.size = (UInt16)totalSize; // serialize sendHead.put(sendEs); // serialize head sendEs.put(character_id); sendEs.put(matching_rule); sendEs.put(matching_value); //RPCPRINT( "Send_EnterMatchingRoom: size %d done", totalSize ); // send done RPCSendPUBase(sendEs, destID, srcID); // finish ClearSendID(); return(totalSize); }
public UInt32 Send_UpdateStatusAppointment(UInt64 battle_pu_list_pu_uid, UInt64 matching_room_id) { UInt64 destID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 srcID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 conid = 0; GetSendID(ref destID, ref srcID, ref conid); if (destID == mln.ProcessUnitManager.INVALID_PUUID) { mln.Utility.MLN_TRACE_LOG("Fail : GetSendID"); return(0); } // if( srcID == ProcessUnitManager::INVALID_PUUID ) return 0; UInt32 totalSize = 0; //RPCPRINT( fprintf(stderr, "Send_UpdateStatusAppointment: start") ); // check send size // BASIC TYPE totalSize += (8); //if( totalSize > left ) ERROR_RETURN(0); // BASIC TYPE totalSize += (8); //if( totalSize > left ) ERROR_RETURN(0); // Check size OK mln.EndianStream sendEs = new mln.EndianStream(mln.EndianStream.STREAM_ENDIAN.STREAM_ENDIAN_LITTLE); // little endian mln.PACKET_HEADER sendHead; sendHead.type = (UInt32)Battle_FuncID.ID_UPDATESTATUSAPPOINTMENT; sendHead.dadr = (UInt64)((UInt64)0 << 32 | (UInt64)INTFID.BATTLE); sendHead.sadr = conid; sendHead.size = (UInt16)totalSize; // serialize sendHead.put(sendEs); // serialize head sendEs.put(battle_pu_list_pu_uid); sendEs.put(matching_room_id); //RPCPRINT( "Send_UpdateStatusAppointment: size %d done", totalSize ); // send done RPCSendPUBase(sendEs, destID, srcID); // finish ClearSendID(); return(totalSize); }
public UInt32 Send_Chat(string str) { UInt64 destID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 srcID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 conid = 0; GetSendID(ref destID, ref srcID, ref conid); if (destID == mln.ProcessUnitManager.INVALID_PUUID) { mln.Utility.MLN_TRACE_LOG("Fail : GetSendID"); return(0); } // if( srcID == ProcessUnitManager::INVALID_PUUID ) return 0; UInt32 totalSize = 0; //RPCPRINT( fprintf(stderr, "Send_Chat: start") ); // check send size UInt32 str_length = (UInt32)System.Text.Encoding.UTF8.GetBytes(str).Length; totalSize += 4; // 4:input length totalSize += str_length; //if( totalSize > left ) ERROR_RETURN(0); // Check size OK mln.EndianStream sendEs = new mln.EndianStream(mln.EndianStream.STREAM_ENDIAN.STREAM_ENDIAN_LITTLE); // little endian mln.PACKET_HEADER sendHead; sendHead.type = (UInt32)Battle_FuncID.ID_CHAT; sendHead.dadr = (UInt64)((UInt64)0 << 32 | (UInt64)INTFID.BATTLE); sendHead.sadr = conid; sendHead.size = (UInt16)totalSize; // serialize sendHead.put(sendEs); // serialize head mln.cRPC_ID.SetStringToStream(str, sendEs, str_length); //RPCPRINT( "Send_Chat: size %d done", totalSize ); // send done RPCSendPUBase(sendEs, destID, srcID); // finish ClearSendID(); return(totalSize); }
public UInt32 Send_DeleteRoomInfoResult(UInt64 pu_uid) { UInt64 destID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 srcID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 conid = 0; GetSendID(ref destID, ref srcID, ref conid); if (destID == mln.ProcessUnitManager.INVALID_PUUID) { mln.Utility.MLN_TRACE_LOG("Fail : GetSendID"); return(0); } // if( srcID == ProcessUnitManager::INVALID_PUUID ) return 0; UInt32 totalSize = 0; //RPCPRINT( fprintf(stderr, "Send_DeleteRoomInfoResult: start") ); // check send size // BASIC TYPE totalSize += (8); //if( totalSize > left ) ERROR_RETURN(0); // Check size OK mln.EndianStream sendEs = new mln.EndianStream(mln.EndianStream.STREAM_ENDIAN.STREAM_ENDIAN_LITTLE); // little endian mln.PACKET_HEADER sendHead; sendHead.type = (UInt32)BattlePuList_FuncID.ID_DELETEROOMINFORESULT; sendHead.dadr = (UInt64)((UInt64)0 << 32 | (UInt64)INTFID.BATTLEPULIST); sendHead.sadr = conid; sendHead.size = (UInt16)totalSize; // serialize sendHead.put(sendEs); // serialize head sendEs.put(pu_uid); //RPCPRINT( "Send_DeleteRoomInfoResult: size %d done", totalSize ); // send done RPCSendPUBase(sendEs, destID, srcID); // finish ClearSendID(); return(totalSize); }
public UInt32 Send_UpdateRoomInfoResult( BattleRoomInfo[] room_info, UInt32 room_info_len ) { UInt64 destID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 srcID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 conid = 0; GetSendID(ref destID, ref srcID, ref conid); if( destID == mln.ProcessUnitManager.INVALID_PUUID ) { mln.Utility.MLN_TRACE_LOG("Fail : GetSendID"); return 0; } // if( srcID == ProcessUnitManager::INVALID_PUUID ) return 0; UInt32 totalSize = 0; //RPCPRINT( fprintf(stderr, "Send_UpdateRoomInfoResult: start") ); // check send size totalSize += 4; // array num if( room_info_len > (UInt32)BattlePuListMaxValues.SEND_UPDATEROOMINFORESULT_ROOM_INFO_LEN_MAX ) return 0; // room_info is over size //if( room_info.Length < room_info_len ) return 0; // room_info is over size // STRUCT TYPE for( UInt32 __ind = 0; __ind < room_info_len ; __ind++ ){ totalSize += BattleRoomInfo.length( room_info[__ind] ); } //if( totalSize > left ) ERROR_RETURN(0); // Check size OK mln.EndianStream sendEs = new mln.EndianStream( mln.EndianStream.STREAM_ENDIAN.STREAM_ENDIAN_LITTLE ); // little endian mln.PACKET_HEADER sendHead; sendHead.type = (UInt32)BattlePuList_FuncID.ID_UPDATEROOMINFORESULT; sendHead.dadr = (UInt64)( (UInt64)0<<32 | (UInt64)INTFID.BATTLEPULIST ); sendHead.sadr = conid; sendHead.size = (UInt16)totalSize; // serialize sendHead.put(sendEs); // serialize head sendEs.put(room_info_len); // STRUCT TYPE for( UInt32 __ind = 0; __ind < room_info_len ; __ind ++ ){ BattleRoomInfo.set( sendEs, room_info[__ind] ); } //RPCPRINT( "Send_UpdateRoomInfoResult: size %d done", totalSize ); // send done RPCSendPUBase( sendEs, destID, srcID ); // finish ClearSendID(); return totalSize; }
// return 0 if error or next public UInt32 Receive_BattlePuList(UInt64 conid, UInt32 type, UInt16 totalSize, mln.EndianStream rStream) { UInt32 ofs = 0; switch (type) { case (Int32)BattlePuList_FuncID.ID_QUERYCONNECTBATTLEPULIST: // 0 { // ARGUMENTS // ARG 0 : UInt64 any_key UInt64 any_key; // BASIC TYPE rStream.get(out any_key); ofs += (8); // RECEIVE CALL Recv_QueryConnectBattlePuList(conid, any_key ); break; } case (Int32)BattlePuList_FuncID.ID_QUERYCONNECTBATTLEPULISTRESULT: // 1 { // ARGUMENTS // ARG 0 : Byte num Byte num; // BASIC TYPE rStream.get(out num); ofs += (1); // RECEIVE CALL Recv_QueryConnectBattlePuListResult(conid, num ); break; } case (Int32)BattlePuList_FuncID.ID_QUERYHEALTHCHECKBATTLEPULIST: // 2 { // ARGUMENTS // RECEIVE CALL Recv_QueryHealthCheckBattlePuList(conid ); break; } case (Int32)BattlePuList_FuncID.ID_QUERYHEALTHCHECKBATTLEPULISTRESULT: // 3 { // ARGUMENTS // RECEIVE CALL Recv_QueryHealthCheckBattlePuListResult(conid ); break; } case (Int32)BattlePuList_FuncID.ID_GETROOMLISTRESULT: // 5 { // ARGUMENTS // ARG 0 : BattleRoomInfo room_info UInt32 room_info_len; // bin32 len rStream.get(out room_info_len); ofs += 4; BattleRoomInfo[] room_info = new BattleRoomInfo[room_info_len]; for (UInt32 __ind = 0; __ind < room_info_len; __ind++) { room_info[__ind] = new BattleRoomInfo(); } // STRUCT TYPE for (UInt32 __ind = 0; __ind < room_info_len; __ind++) { ofs += BattleRoomInfo.get(rStream, room_info[__ind]); } // RECEIVE CALL Recv_GetRoomListResult(conid, room_info, room_info_len ); break; } case (Int32)BattlePuList_FuncID.ID_UPDATEROOMINFO: // 6 { // ARGUMENTS // RECEIVE CALL Recv_UpdateRoomInfo(conid ); break; } case (Int32)BattlePuList_FuncID.ID_DELETEROOMINFO: // 8 { // ARGUMENTS // RECEIVE CALL Recv_DeleteRoomInfo(conid ); break; } case (Int32)BattlePuList_FuncID.ID_APPOINTMENTBATTLERESULT: // 11 { // ARGUMENTS // ARG 0 : UInt64 matching_room_id UInt64 matching_room_id; // BASIC TYPE rStream.get(out matching_room_id); ofs += (8); // ARG 1 : BattlePuInfo battle_pu_info BattlePuInfo battle_pu_info = new BattlePuInfo(); // STRUCT TYPE ofs += BattlePuInfo.get(rStream, battle_pu_info); // ARG 2 : UInt64 appointment_battle_pu_time UInt64 appointment_battle_pu_time; // BASIC TYPE rStream.get(out appointment_battle_pu_time); ofs += (8); // ARG 3 : Int32 result Int32 result; // BASIC TYPE rStream.get(out result); ofs += (4); // RECEIVE CALL Recv_AppointmentBattleResult(conid, matching_room_id, battle_pu_info, appointment_battle_pu_time, result ); break; } case (Int32)BattlePuList_FuncID.ID_QUERYDISCONNECTBATTLEPULIST: // 12 { // ARGUMENTS // RECEIVE CALL Recv_QueryDisconnectBattlePuList(conid ); break; } } return(ofs); }
public UInt32 Send_GetRoomList( UInt32 max ) { UInt64 destID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 srcID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 conid = 0; GetSendID(ref destID, ref srcID, ref conid); if( destID == mln.ProcessUnitManager.INVALID_PUUID ) { mln.Utility.MLN_TRACE_LOG("Fail : GetSendID"); return 0; } // if( srcID == ProcessUnitManager::INVALID_PUUID ) return 0; UInt32 totalSize = 0; //RPCPRINT( fprintf(stderr, "Send_GetRoomList: start") ); // check send size // BASIC TYPE totalSize += ( 4 ); //if( totalSize > left ) ERROR_RETURN(0); // Check size OK mln.EndianStream sendEs = new mln.EndianStream( mln.EndianStream.STREAM_ENDIAN.STREAM_ENDIAN_LITTLE ); // little endian mln.PACKET_HEADER sendHead; sendHead.type = (UInt32)BattlePuList_FuncID.ID_GETROOMLIST; sendHead.dadr = (UInt64)( (UInt64)0<<32 | (UInt64)INTFID.BATTLEPULIST ); sendHead.sadr = conid; sendHead.size = (UInt16)totalSize; // serialize sendHead.put(sendEs); // serialize head sendEs.put(max); //RPCPRINT( "Send_GetRoomList: size %d done", totalSize ); // send done RPCSendPUBase( sendEs, destID, srcID ); // finish ClearSendID(); return totalSize; }
public UInt32 Send_QueryHealthCheckBattlePuListResult( ) { UInt64 destID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 srcID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 conid = 0; GetSendID(ref destID, ref srcID, ref conid); if( destID == mln.ProcessUnitManager.INVALID_PUUID ) { mln.Utility.MLN_TRACE_LOG("Fail : GetSendID"); return 0; } // if( srcID == ProcessUnitManager::INVALID_PUUID ) return 0; UInt32 totalSize = 0; //RPCPRINT( fprintf(stderr, "Send_QueryHealthCheckBattlePuListResult: start") ); // check send size // Check size OK mln.EndianStream sendEs = new mln.EndianStream( mln.EndianStream.STREAM_ENDIAN.STREAM_ENDIAN_LITTLE ); // little endian mln.PACKET_HEADER sendHead; sendHead.type = (UInt32)BattlePuList_FuncID.ID_QUERYHEALTHCHECKBATTLEPULISTRESULT; sendHead.dadr = (UInt64)( (UInt64)0<<32 | (UInt64)INTFID.BATTLEPULIST ); sendHead.sadr = conid; sendHead.size = (UInt16)totalSize; // serialize sendHead.put(sendEs); // serialize head //RPCPRINT( "Send_QueryHealthCheckBattlePuListResult: size %d done", totalSize ); // send done RPCSendPUBase( sendEs, destID, srcID ); // finish ClearSendID(); return totalSize; }
public UInt32 Send_Chat( string str ) { UInt64 destID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 srcID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 conid = 0; GetSendID(ref destID, ref srcID, ref conid); if( destID == mln.ProcessUnitManager.INVALID_PUUID ) { mln.Utility.MLN_TRACE_LOG("Fail : GetSendID"); return 0; } // if( srcID == ProcessUnitManager::INVALID_PUUID ) return 0; UInt32 totalSize = 0; //RPCPRINT( fprintf(stderr, "Send_Chat: start") ); // check send size UInt32 str_length = (UInt32)System.Text.Encoding.UTF8.GetBytes(str).Length; totalSize += 4; // 4:input length totalSize += str_length; //if( totalSize > left ) ERROR_RETURN(0); // Check size OK mln.EndianStream sendEs = new mln.EndianStream( mln.EndianStream.STREAM_ENDIAN.STREAM_ENDIAN_LITTLE ); // little endian mln.PACKET_HEADER sendHead; sendHead.type = (UInt32)Battle_FuncID.ID_CHAT; sendHead.dadr = (UInt64)( (UInt64)0<<32 | (UInt64)INTFID.BATTLE ); sendHead.sadr = conid; sendHead.size = (UInt16)totalSize; // serialize sendHead.put(sendEs); // serialize head mln.cRPC_ID.SetStringToStream( str, sendEs, str_length ); //RPCPRINT( "Send_Chat: size %d done", totalSize ); // send done RPCSendPUBase( sendEs, destID, srcID ); // finish ClearSendID(); return totalSize; }
public UInt32 Send_UpdateStatusAppointment( UInt64 battle_pu_list_pu_uid, UInt64 matching_room_id ) { UInt64 destID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 srcID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 conid = 0; GetSendID(ref destID, ref srcID, ref conid); if( destID == mln.ProcessUnitManager.INVALID_PUUID ) { mln.Utility.MLN_TRACE_LOG("Fail : GetSendID"); return 0; } // if( srcID == ProcessUnitManager::INVALID_PUUID ) return 0; UInt32 totalSize = 0; //RPCPRINT( fprintf(stderr, "Send_UpdateStatusAppointment: start") ); // check send size // BASIC TYPE totalSize += ( 8 ); //if( totalSize > left ) ERROR_RETURN(0); // BASIC TYPE totalSize += ( 8 ); //if( totalSize > left ) ERROR_RETURN(0); // Check size OK mln.EndianStream sendEs = new mln.EndianStream( mln.EndianStream.STREAM_ENDIAN.STREAM_ENDIAN_LITTLE ); // little endian mln.PACKET_HEADER sendHead; sendHead.type = (UInt32)Battle_FuncID.ID_UPDATESTATUSAPPOINTMENT; sendHead.dadr = (UInt64)( (UInt64)0<<32 | (UInt64)INTFID.BATTLE ); sendHead.sadr = conid; sendHead.size = (UInt16)totalSize; // serialize sendHead.put(sendEs); // serialize head sendEs.put(battle_pu_list_pu_uid); sendEs.put(matching_room_id); //RPCPRINT( "Send_UpdateStatusAppointment: size %d done", totalSize ); // send done RPCSendPUBase( sendEs, destID, srcID ); // finish ClearSendID(); return totalSize; }
// set in stream static public UInt32 set(mln.EndianStream rEs, BattleStatus rIn) { rEs.put((UInt32)rIn); return(4); }
// return 0 if error or next public UInt32 Receive_Matching(UInt64 conid, UInt32 type, UInt16 totalSize, mln.EndianStream rStream) { UInt32 ofs = 0; switch (type) { case (Int32)Matching_FuncID.ID_QUERYCONNECTMATCHING: // 0 { // ARGUMENTS // ARG 0 : UInt64 any_key UInt64 any_key; // BASIC TYPE rStream.get(out any_key); ofs += (8); // RECEIVE CALL Recv_QueryConnectMatching(conid, any_key ); break; } case (Int32)Matching_FuncID.ID_QUERYCONNECTMATCHINGRESULT: // 1 { // ARGUMENTS // ARG 0 : Byte num Byte num; // BASIC TYPE rStream.get(out num); ofs += (1); // RECEIVE CALL Recv_QueryConnectMatchingResult(conid, num ); break; } case (Int32)Matching_FuncID.ID_QUERYHEALTHCHECKMATCHING: // 2 { // ARGUMENTS // RECEIVE CALL Recv_QueryHealthCheckMatching(conid ); break; } case (Int32)Matching_FuncID.ID_QUERYHEALTHCHECKMATCHINGRESULT: // 3 { // ARGUMENTS // RECEIVE CALL Recv_QueryHealthCheckMatchingResult(conid ); break; } case (Int32)Matching_FuncID.ID_ENTERMATCHINGROOMRESULT: // 5 { // ARGUMENTS // ARG 0 : UInt64 matching_room_id UInt64 matching_room_id; // BASIC TYPE rStream.get(out matching_room_id); ofs += (8); // ARG 1 : Int32 result Int32 result; // BASIC TYPE rStream.get(out result); ofs += (4); // RECEIVE CALL Recv_EnterMatchingRoomResult(conid, matching_room_id, result ); break; } case (Int32)Matching_FuncID.ID_GETMATCHINGSTATUSRESULT: // 7 { // ARGUMENTS // ARG 0 : UInt64 matching_room_id UInt64 matching_room_id; // BASIC TYPE rStream.get(out matching_room_id); ofs += (8); // ARG 1 : Byte status Byte status; // BASIC TYPE rStream.get(out status); ofs += (1); // ARG 2 : BattlePuInfo battle_pu_info BattlePuInfo battle_pu_info = new BattlePuInfo(); // STRUCT TYPE ofs += BattlePuInfo.get(rStream, battle_pu_info); // RECEIVE CALL Recv_GetMatchingStatusResult(conid, matching_room_id, status, battle_pu_info ); break; } case (Int32)Matching_FuncID.ID_EXITMATCHINGROOMRESULT: // 9 { // ARGUMENTS // ARG 0 : Int32 result Int32 result; // BASIC TYPE rStream.get(out result); ofs += (4); // RECEIVE CALL Recv_ExitMatchingRoomResult(conid, result ); break; } case (Int32)Matching_FuncID.ID_QUERYDISCONNECTMATCHING: // 10 { // ARGUMENTS // RECEIVE CALL Recv_QueryDisconnectMatching(conid ); break; } } return(ofs); }
public UInt32 Send_QueryConnectMatchingResult( Byte num ) { UInt64 destID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 srcID = mln.ProcessUnitManager.INVALID_PUUID; // PUUID UInt64 conid = 0; GetSendID(ref destID, ref srcID, ref conid); if( destID == mln.ProcessUnitManager.INVALID_PUUID ) { mln.Utility.MLN_TRACE_LOG("Fail : GetSendID"); return 0; } // if( srcID == ProcessUnitManager::INVALID_PUUID ) return 0; UInt32 totalSize = 0; //RPCPRINT( fprintf(stderr, "Send_QueryConnectMatchingResult: start") ); // check send size // BASIC TYPE totalSize += ( 1 ); //if( totalSize > left ) ERROR_RETURN(0); // Check size OK mln.EndianStream sendEs = new mln.EndianStream( mln.EndianStream.STREAM_ENDIAN.STREAM_ENDIAN_LITTLE ); // little endian mln.PACKET_HEADER sendHead; sendHead.type = (UInt32)Matching_FuncID.ID_QUERYCONNECTMATCHINGRESULT; sendHead.dadr = (UInt64)( (UInt64)0<<32 | (UInt64)INTFID.MATCHING ); sendHead.sadr = conid; sendHead.size = (UInt16)totalSize; // serialize sendHead.put(sendEs); // serialize head sendEs.put(num); //RPCPRINT( "Send_QueryConnectMatchingResult: size %d done", totalSize ); // send done RPCSendPUBase( sendEs, destID, srcID ); // finish ClearSendID(); return totalSize; }
// return 0 if error or next public UInt32 Receive_Battle(UInt64 conid, UInt32 type, UInt16 totalSize, mln.EndianStream rStream) { UInt32 ofs = 0; switch (type) { case (Int32)Battle_FuncID.ID_QUERYCONNECTBATTLE: // 0 { // ARGUMENTS // ARG 0 : UInt64 any_key UInt64 any_key; // BASIC TYPE rStream.get(out any_key); ofs += (8); // RECEIVE CALL Recv_QueryConnectBattle(conid, any_key ); break; } case (Int32)Battle_FuncID.ID_QUERYCONNECTBATTLERESULT: // 1 { // ARGUMENTS // ARG 0 : Byte num Byte num; // BASIC TYPE rStream.get(out num); ofs += (1); // RECEIVE CALL Recv_QueryConnectBattleResult(conid, num ); break; } case (Int32)Battle_FuncID.ID_QUERYHEALTHCHECKBATTLE: // 2 { // ARGUMENTS // RECEIVE CALL Recv_QueryHealthCheckBattle(conid ); break; } case (Int32)Battle_FuncID.ID_QUERYHEALTHCHECKBATTLERESULT: // 3 { // ARGUMENTS // RECEIVE CALL Recv_QueryHealthCheckBattleResult(conid ); break; } case (Int32)Battle_FuncID.ID_ENTERROOMRESULT: // 5 { // ARGUMENTS // ARG 0 : Int32 result Int32 result; // BASIC TYPE rStream.get(out result); ofs += (4); // RECEIVE CALL Recv_EnterRoomResult(conid, result ); break; } case (Int32)Battle_FuncID.ID_EXITROOMRESULT: // 7 { // ARGUMENTS // ARG 0 : Int32 result Int32 result; // BASIC TYPE rStream.get(out result); ofs += (4); // RECEIVE CALL Recv_ExitRoomResult(conid, result ); break; } case (Int32)Battle_FuncID.ID_STARTBATTLE: // 9 { // ARGUMENTS // RECEIVE CALL Recv_StartBattle(conid ); break; } case (Int32)Battle_FuncID.ID_ENDBATTLE: // 10 { // ARGUMENTS // RECEIVE CALL Recv_EndBattle(conid ); break; } case (Int32)Battle_FuncID.ID_GETSTATUSRESULT: // 12 { // ARGUMENTS // ARG 0 : BattleStatusInfo status_info BattleStatusInfo status_info = new BattleStatusInfo(); // STRUCT TYPE ofs += BattleStatusInfo.get(rStream, status_info); // RECEIVE CALL Recv_GetStatusResult(conid, status_info ); break; } case (Int32)Battle_FuncID.ID_CHATRESULT: // 14 { // ARGUMENTS // ARG 0 : const char* str // string buffer //char str[RPC_STRLEN_SIZE+8]; string str; // STRING TYPE UInt32 str_length = 0U; UInt32 str_str_ofs = mln.cRPC_ID.GetStringFromStream(out str, rStream, out str_length); ofs += str_str_ofs; // RECEIVE CALL Recv_ChatResult(conid, str ); break; } case (Int32)Battle_FuncID.ID_UPDATESTATUSAPPOINTMENTRESULT: // 16 { // ARGUMENTS // ARG 0 : Int32 result Int32 result; // BASIC TYPE rStream.get(out result); ofs += (4); // ARG 1 : UInt64 battle_pu_list_pu_uid UInt64 battle_pu_list_pu_uid; // BASIC TYPE rStream.get(out battle_pu_list_pu_uid); ofs += (8); // ARG 2 : Int32 pid Int32 pid; // BASIC TYPE rStream.get(out pid); ofs += (4); // ARG 3 : BattleStatusInfo status_info BattleStatusInfo status_info = new BattleStatusInfo(); // STRUCT TYPE ofs += BattleStatusInfo.get(rStream, status_info); // ARG 4 : UInt64 matching_room_id UInt64 matching_room_id; // BASIC TYPE rStream.get(out matching_room_id); ofs += (8); // RECEIVE CALL Recv_UpdateStatusAppointmentResult(conid, result, battle_pu_list_pu_uid, pid, status_info, matching_room_id ); break; } case (Int32)Battle_FuncID.ID_QUERYDISCONNECTBATTLE: // 17 { // ARGUMENTS // RECEIVE CALL Recv_QueryDisconnectBattle(conid ); break; } } return(ofs); }
// set in stream static public UInt32 set(mln.EndianStream rEs, AppointmentResult rIn) { rEs.put((UInt32)rIn); return(4); }