Пример #1
0
// 加载数据
bool CPlayer::LoadData(Msg *pMsg)
{
	svrData::LoadPlayerData msg;
	_CHECK_PARSE_(pMsg, msg) false;

	if (!UnPackData(msg.data().c_str(), msg.data().size()))
		return false;

	SetAccount(msg.account());
	SetName(msg.name().c_str());
	SetGuid(msg.nguid());
	SetSex(msg.nsex());
	SetJob(msg.njob());
	SetLevel(msg.nlevel());
	SetCreateTime(msg.ncreatetime());
	SetLoginTime(msg.nlogintime());
	SetMapID(msg.nmapid());
	SetNowPos(msg.nx(), msg.ny(), msg.nz());
	m_LastSaveTime = CTimer::GetTime() + CRandomPool::GetOneLess(60);

	RunStateLog("加载玩家:%s数据成功!账号:%s", GetName(), msg.account().c_str());

	if (!msg.bchangeline())
	{
		svrData::AddPlayerToCenter SendMsg;
		SendMsg.set_nguid(GetGuid());
		SendMsg.set_ngameid(GetGameID());
		SendMsg.set_nclientid(GetClientID());
		SendMsg.set_ngateid(GetGateID());
		SendMsg.set_account(GetAccount());
		FuncUti::SendMsgToCenter(this, SendMsg, SERVER_TYPE_MAIN, SVR_SUB_ADD_PLAYER_TO_CENTER);
	}
	m_LoadDataSucc = true;
	return true;
}
Пример #2
0
void CMemPmBasicPage::SetSexList()
{
    if(!m_ppc)
        return;

    WORD	wBreed;
    BYTE	bPreFR, bFR;
    BOOL	bChange = TRUE;
    BreedListEntry *	pPreBreed = NULL;
    BreedListEntry *	pBreed = NULL;

    wBreed = m_ppc->GetBreed();
    if(wBreed < BREED_COUNT)
    {
        pBreed = g_MemRom.GetBreedListEntry(wBreed);
        bFR = pBreed->bFemaleRatio;

        if(m_wPreBreed < BREED_COUNT)
        {
            pPreBreed = g_MemRom.GetBreedListEntry(m_wPreBreed);
            bPreFR = pPreBreed->bFemaleRatio;

            if((bPreFR == bFR) ||
                    (bPreFR > 0 && bPreFR < 0xFE &&
                     bFR > 0 && bFR < 0xFE))
            {
                // no need to change sex list
                bChange = FALSE;
            }
        }

        if(bChange)
        {
            m_ctrlSexList.ResetContent();
            switch(bFR)
            {
            case 0xFF:
                m_ctrlSexList.AddString(_T("不明"));
                break;

            case 0xFE:
                m_ctrlSexList.AddString(_T("全♀"));
                break;

            case 0x00:
                m_ctrlSexList.AddString(_T("全♂"));
                break;

            default:
                m_ctrlSexList.AddString(_T("♀"));
                m_ctrlSexList.AddString(_T("♂"));
                break;
            }
        }

        SetSex();
    }
}
Пример #3
0
void CMemPmBasicPage::GetChar()
{
    if(!m_ppc)
        return;

    CString	szText;

    GetDlgItemText(IDC_CHAR, szText);
    m_ppc->SetChar(_tcstoul(szText, 0, 0));

    // ps
    SetPs();

    // sex
    SetSex();

    // shiny
    CheckDlgButton(IDC_SHINY, m_ppc->GetIsShiny() ? BST_CHECKED : BST_UNCHECKED);
}
Пример #4
0
CStandInput::CStandInput()
{
	setWindowTitle("标准输入框");

	label1=new QLabel("姓名");
	label2=new QLabel("性别");
	label3=new QLabel("年龄");
	label4=new QLabel("身高");

	labelName=new QLabel("李明");
	labelName->setFrameStyle(QFrame::Panel|QFrame::Sunken);

	labelSex=new QLabel("男");
	labelSex->setFrameStyle(QFrame::Panel|QFrame::Sunken);

	labelAge=new QLabel("22");
	labelAge->setFrameStyle(QFrame::Panel|QFrame::Sunken);

	labelStature=new QLabel("175cm");
	labelStature->setFrameStyle(QFrame::Panel|QFrame::Sunken);

	nameButton=new QPushButton;
	nameButton->setIcon(QIcon("btn.png"));
	nameButton->setText("设置姓名");

	sexButton=new QPushButton;
	sexButton->setIcon(QIcon("btn.png"));
	sexButton->setText("设置性别");

	ageButton=new QPushButton;
	ageButton->setIcon(QIcon("btn.png"));
	ageButton->setText("设置年龄");

	statureButton=new QPushButton;
	statureButton->setIcon(QIcon("btn.png"));
	statureButton->setText("设置身高");

	QGridLayout *layout=new QGridLayout(this);

	connect(nameButton,SIGNAL(clicked()),this,SLOT(SetName()));
	connect(sexButton,SIGNAL(clicked()),this,SLOT(SetSex()));
	connect(ageButton,SIGNAL(clicked()),this,SLOT(SetAge()));
	connect(statureButton,SIGNAL(clicked()),this,SLOT(SetStature()));

	layout->addWidget(label1,0,0);
	layout->addWidget(labelName,0,1);
	layout->addWidget(nameButton,0,2);

	layout->addWidget(label2,1,0);
	layout->addWidget(labelSex,1,1);
	layout->addWidget(sexButton,1,2);

	layout->addWidget(label3,2,0);
	layout->addWidget(labelAge,2,1);
	layout->addWidget(ageButton,2,2);

	layout->addWidget(label4,3,0);
	layout->addWidget(labelStature,3,1);
	layout->addWidget(statureButton,3,2);

	resize(250,150);
}
Пример #5
0
void LogEntry1Data::ResumeSyncSend(void)
	{
	if (!SyncSendPaused)
		{
		return;
		}

	SyncSendPaused = FALSE;

	if (SyncNumber == CERROR)
		{
		return;
		}

	// We just unpaused and we're assigned a record number... tell everybody
	// else all about ourselves.
	GAINEXCLUSIVEACCESS();
	char Buffer[256];
	
	CopyStringToBuffer(Buffer, Name);
	SetName(Buffer);

	CopyStringToBuffer(Buffer, Initials);
	SetInitials(Buffer);

	CopyStringToBuffer(Buffer, Password);
	SetPassword(Buffer);

	CopyStringToBuffer(Buffer, Surname);
	SetSurname(Buffer);

	CopyStringToBuffer(Buffer, Title);
	SetTitle(Buffer);

	CopyStringToBuffer(Buffer, RealName);
	SetRealName(Buffer);

	CopyStringToBuffer(Buffer, PhoneNumber);
	SetPhoneNumber(Buffer);

	CopyStringToBuffer(Buffer, ForwardAddr);
	SetForwardAddr(Buffer);

	CopyStringToBuffer(Buffer, ForwardAddrNode);
	SetForwardAddrNode(Buffer);

	CopyStringToBuffer(Buffer, ForwardAddrRegion);
	SetForwardAddrRegion(Buffer);

	CopyStringToBuffer(Buffer, PromptFormat);
	SetPromptFormat(Buffer);

	CopyStringToBuffer(Buffer, DateStamp);
	SetDateStamp(Buffer);

	CopyStringToBuffer(Buffer, VerboseDateStamp);
	SetVerboseDateStamp(Buffer);

	CopyStringToBuffer(Buffer, Signature);
	SetSignature(Buffer);

	CopyStringToBuffer(Buffer, NetPrefix);
	SetNetPrefix(Buffer);

	CopyStringToBuffer(Buffer, MailAddr1);
	SetMailAddr1(Buffer);

	CopyStringToBuffer(Buffer, MailAddr2);
	SetMailAddr2(Buffer);

	CopyStringToBuffer(Buffer, MailAddr3);
	SetMailAddr3(Buffer);

	CopyStringToBuffer(Buffer, Alias);
	SetAlias(Buffer);

	CopyStringToBuffer(Buffer, LocID);
	SetLocID(Buffer);

	CopyStringToBuffer(Buffer, MorePrompt);
	SetMorePrompt(Buffer);

	CopyStringToBuffer(Buffer, Occupation);
	SetOccupation(Buffer);

	CopyStringToBuffer(Buffer, WhereHear);
	SetWhereHear(Buffer);

	CopyStringToBuffer(Buffer, LastRoom);
	SetLastRoom(Buffer);

	CopyStringToBuffer(Buffer, LastHall);
	SetLastHall(Buffer);

	CopyStringToBuffer(Buffer, DefaultRoom);
	SetDefaultRoom(Buffer);

	CopyStringToBuffer(Buffer, DefaultHall);
	SetDefaultHall(Buffer);

	CopyStringToBuffer(Buffer, TermType);
	SetTermType(Buffer);
	RELEASEEXCLUSIVEACCESS();

	SetBirthDate(BirthDate);
	SetFirstOn(FirstOn);
	SetSex(Sex);
	SetNulls(Nulls);
	SetWidth(Width);
	SetLinesPerScreen(LinesPerScreen);
	SetAttribute(ATTR_NORMAL, attributes[ATTR_NORMAL]);
	SetAttribute(ATTR_BLINK, attributes[ATTR_BLINK]);
	SetAttribute(ATTR_REVERSE, attributes[ATTR_REVERSE]);
	SetAttribute(ATTR_BOLD, attributes[ATTR_BOLD]);
	SetAttribute(ATTR_UNDERLINE, attributes[ATTR_UNDERLINE]);
	SetNumUserShow(NumUserShow);
	SetDefaultProtocol(DefaultProtocol);
	SetCallTime(CallTime);
	SetCallNumber(CallNumber);
	SetTotalTime(TotalTime);
	SetCredits(Credits);
	SetLogins(Logins);
	SetPosted(Posted);
	SetRead(Read);
	SetPasswordChangeTime(PasswordChangeTime);
	SetCallsToday(CallsToday);
	SetCallLimit(CallLimit);
	SetLastMessage(LastMessage);
	SetDL_Bytes(DL_Bytes);
	SetUL_Bytes(UL_Bytes);
	SetDL_Num(DL_Num);
	SetUL_Num(UL_Num);
	SetPoopcount(Poopcount);

	SetDungeoned(IsDungeoned());
	SetForwardToNode(IsForwardToNode());
	SetAutoNextHall(IsAutoNextHall());
	SetEnterBorders(IsEnterBorders());
	SetVerified(IsVerified());
	SetSurnameLocked(IsSurnameLocked());
	SetDefaultHallLocked(IsDefaultHallLocked());
	SetPsycho(IsPsycho());
	SetViewTitleSurname(IsViewTitleSurname());
	SetViewSubjects(IsViewSubjects());
	SetViewSignatures(IsViewSignatures());
	SetOldIBMGraph(IsOldIBMGraph());
	SetOldIBMANSI(IsOldIBMANSI());
	SetOldIBMColor(IsOldIBMColor());
	SetTwirly(IsTwirly());
	SetAutoVerbose(IsAutoVerbose());
	SetPauseBetweenMessages(IsPauseBetweenMessages());
	SetMinibin(IsMinibin());
	SetClearScreenBetweenMessages(IsClearScreenBetweenMessages());
	SetViewRoomInfoLines(IsViewRoomInfoLines());
	SetViewHallDescription(IsViewHallDescription());
	SetVerboseContinue(IsVerboseContinue());
	SetViewCensoredMessages(IsViewCensoredMessages());
	SetViewBorders(IsViewBorders());
	SetOut300(IsOut300());
	SetUserSignatureLocked(IsUserSignatureLocked());
	SetHideMessageExclusions(IsHideMessageExclusions());
	SetDownload(IsDownload());
	SetUpload(IsUpload());
	SetChat(IsChat());
	SetPrintFile(IsPrintFile());
	SetSpellCheckMode(GetSpellCheckMode());
	SetMakeRoom(IsMakeRoom());
	SetVerboseLogOut(IsVerboseLogOut());
	SetConfirmSave(IsConfirmSave());
	SetConfirmAbort(IsConfirmAbort());
	SetConfirmNoEO(IsConfirmNoEO());
	SetUsePersonalHall(IsUsePersonalHall());
	SetYouAreHere(IsYouAreHere());
	SetIBMRoom(IsIBMRoom());
	SetWideRoom(IsWideRoom());
	SetMusic(IsMusic());
	SetCheckApostropheS(IsCheckApostropheS());
	SetCheckAllCaps(IsCheckAllCaps());
	SetCheckDigits(IsCheckDigits());
	SetExcludeEncryptedMessages(IsExcludeEncryptedMessages());
	SetViewCommas(IsViewCommas());
	SetPUnPauses(IsPUnPauses());
	SetRoman(IsRoman());
	SetSuperSysop(IsSuperSysop());

	SetInuse(IsInuse());
	SetUpperOnly(IsUpperOnly());
	SetLinefeeds(IsLinefeeds());
	SetExpert(IsExpert());
	SetAide(IsAide());
	SetTabs(IsTabs());
	SetOldToo(IsOldToo());
	SetProblem(IsProblem());
	SetUnlisted(IsUnlisted());
	SetPermanent(IsPermanent());
	SetSysop(IsSysop());
	SetNode(IsNode());
	SetNetUser(IsNetUser());
	SetAccounting(IsAccounting());
	SetMail(IsMail());
	SetViewRoomDesc(IsViewRoomDesc());
	}