public void SetData( sPARTYLIST partyListData) { m_partyListData = partyListData; Tbl_ZoneMap_Record record = AsTableManager.Instance.GetZoneMapRecord( m_partyListData.nMapIdx); if( null != record) m_SelectArea.Text = AsTableManager.Instance.GetTbl_String( record.getTooltipStrIdx); StringBuilder sb = new StringBuilder(); sb.Insert( 0,m_partyListData.nUserCnt.ToString()); sb.Append( "/"); sb.Append( m_partyListData.sOption.nMaxUser); m_UserCnt.Text = sb.ToString(); string partyName = AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( m_partyListData.sOption.szPartyName)); m_PartyName.Text = partyName; }
void OnGUI() { GUILayout.BeginArea( new Rect( 1, 1, 200, 100)); if( true == GUILayout.Button( "EventNotify: " )) { body_SC_USER_EVENT_NOTIFY notify = new body_SC_USER_EVENT_NOTIFY(); notify.eType = (int)eUSEREVENTTYPE.eUSEREVENTTYPE_ITEM; notify.szCharName = System.Text.UTF8Encoding.UTF8.GetBytes("mmma"); notify.sItem = new sITEM(); notify.sItem.nItemTableIdx = 175041; notify.nValue_1 = (int)eUSEREVENT_ITEM_GETTYPE.eUSEREVENT_ITEM_GETTYPE_HUNTING; //notify.nValue_1 = 175041; //notify.nValue_2 = (int)eUSEREVENT_ITEM_GETTYPE.eUSEREVENT_ITEM_GETTYPE_HUNTING; AsEventNotifyMgr.Instance.ReceiveUserEventNotify(notify); sPARTYLIST[] pList = new sPARTYLIST[20]; for(int i = 0; i < 20; i++) { pList[i] = new sPARTYLIST(); pList[i].sOption = new sPARTYOPTION(); pList[i].sOption.bPublic = true; pList[i].nPartyIdx = i+1; pList[i].nLevel = i % 10; pList[i].nUserCnt = i % 4; pList[i].sOption.szPartyName = System.Text.UTF8Encoding.UTF8.GetBytes( pList[i].nLevel.ToString().ToCharArray(), 0, pList[i].nLevel.ToString().Length ); if(pList[i].nUserCnt==0) pList[i].nUserCnt = 1; } pList[0].sOption.nMaxUser = 4; pList[1].sOption.nMaxUser = 4; pList[2].sOption.nMaxUser = 4; pList[3].sOption.nMaxUser = 4; pList[4].sOption.nMaxUser = 4; pList[5].sOption.nMaxUser = 3; pList[6].sOption.nMaxUser = 3; pList[7].sOption.nMaxUser = 3; pList[8].sOption.nMaxUser = 3; pList[9].sOption.nMaxUser = 3; pList[10].sOption.nMaxUser = 2; pList[11].sOption.nMaxUser = 2; pList[12].sOption.nMaxUser = 2; pList[13].sOption.nMaxUser = 2; pList[14].sOption.nMaxUser = 2; pList[15].sOption.nMaxUser = 4; pList[16].sOption.nMaxUser = 3; pList[17].sOption.nMaxUser = 2; pList[18].sOption.nMaxUser = 4; pList[19].sOption.nMaxUser = 3; // AsPartyManager.Instance.ReceivePartyList(pList); // AS_SC_PARTY_DICE_ITEM_INFO data = new AS_SC_PARTY_DICE_ITEM_INFO(); // data.nDropItemIdx = 170002; //data.sItem = new sITEM(); // AsPartyManager.Instance.PartyDiceItemInfo(data); /* AS_SC_PARTY_DICE_ITEM_INFO dice = new AS_SC_PARTY_DICE_ITEM_INFO(); dice.nDropItemIdx = 170002; dice.sItem = new sITEM(); dice.sItem.nItemTableIdx = 170002; // dice.sItem AsPartyManager.Instance.PartyDiceItemInfo(dice); */ /* * public eRESULTCODE eResult; public UInt32 nUserUniqKey; //Check BlockList 2013.03.05 public UInt32 nCharUniqKey; public body_SC_CHAT_NAME kName = new body_SC_CHAT_NAME(); public body_SC_CHAT_MESSAGE kMessage = new body_SC_CHAT_MESSAGE(); */ //sEventNotifyMgr.Instance.CenterNotify.AddGMMessage("123456789"); // AsChatManager.Instance.InsertGMChat( "1234567890" ); } GUILayout.EndArea(); }
public new void PacketBytesToClass( byte[] data) { Type infotype = this.GetType(); FieldInfo headerinfo = null; int index = ParsePacketHeader( data); // nCnt byte[] nCount = new byte[ sizeof( Int32)]; headerinfo = infotype.GetField( "nCnt", BINDING_FLAGS_PIG); Buffer.BlockCopy( data, index, nCount, 0, sizeof( Int32)); headerinfo.SetValue( this, BitConverter.ToInt32( nCount, 0)); index += sizeof( Int32); if( 0 < nCnt) { body = new sPARTYLIST[nCnt]; for( int i = 0; i < nCnt; i++) { body[i] = new sPARTYLIST(); byte[] tmpData = new byte[sPARTYLIST.size]; Buffer.BlockCopy( data, index, tmpData, 0, tmpData.Length); body[i].ByteArrayToClass( tmpData); index += sPARTYLIST.size; } } }
public void ReceivePartyList( sPARTYLIST[] _list) { m_PartyList.Clear(); m_SortPartyList.Clear(); if( m_IsReadyUI) m_PartyUI.PartyListDlg.ClearPartyList(); if( null == _list) return; foreach( sPARTYLIST data in _list) { m_PartyList.Add( data.nPartyIdx, data); AsSortPartyList sortData = new AsSortPartyList(); sortData.m_sPARTYLIST = data; m_SortPartyList.Add( sortData); } if( m_PartyUI.PartyListDlg.eSortType == AsPartyListDlg.ePARTYLISTSORT.ePARTYLISTSORT_LEVEL) LevelSortList(); else MaxUserSortList(); if( m_IsReadyUI) { m_PartyUI.PartyListDlg.SetPartyList(); } }