コード例 #1
0
        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);
        }
コード例 #2
0
        public static UInt32 length(BattleRoomInfo _rChk)
        {
            UInt32 totalSize = 0;

            // STRUCT TYPE
            totalSize += BattlePuInfo.length(_rChk.pu_info);
            // STRUCT TYPE
            totalSize += BattleStatusInfo.length(_rChk.status_info);
            return(totalSize);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 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;
 }
コード例 #5
0
 // 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;
 }
コード例 #6
0
ファイル: RPC_BTL_cmn.cs プロジェクト: chroske/GYRO-FPS
 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;
 }
コード例 #7
0
ファイル: RPC_BTL_cmn.cs プロジェクト: chroske/GYRO-FPS
 public static UInt32 length( BattleRoomInfo _rChk )
 {
     UInt32 totalSize = 0;
     // STRUCT TYPE
     totalSize += BattlePuInfo.length( _rChk.pu_info );
     // STRUCT TYPE
     totalSize += BattleStatusInfo.length( _rChk.status_info );
     return totalSize;
 }
コード例 #8
0
ファイル: RPC_BTL_cmn.cs プロジェクト: chroske/GYRO-FPS
 public BattleRoomInfo(BattleRoomInfo rRef)
 {
     // copy constructor
     this.pu_info = new BattlePuInfo(rRef.pu_info);
     this.status_info = new BattleStatusInfo(rRef.status_info);
 }
コード例 #9
0
        // 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);
        }
コード例 #10
0
 public BattleRoomInfo(BattleRoomInfo rRef) // copy constructor
 {
     this.pu_info     = new BattlePuInfo(rRef.pu_info);
     this.status_info = new BattleStatusInfo(rRef.status_info);
 }